PDAModuleService.cs 573 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278
  1. /*******************************************************************************
  2. * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:PDAModuleService.cs
  5. * 2.功能描述:PDA模块WCF服务
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 陈晓野 2014/09/16 1.00 新建
  9. *******************************************************************************/
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Data;
  13. using System.IO;
  14. using System.ServiceModel;
  15. using System.ServiceModel.Activation;
  16. using Dongke.IBOSS.PRD.Basics.BaseResources;
  17. using Dongke.IBOSS.PRD.Basics.Library;
  18. using Dongke.IBOSS.PRD.Service.BarcodePrintService;
  19. using Dongke.IBOSS.PRD.Service.CommonModuleLogic;
  20. using Dongke.IBOSS.PRD.Service.DataModels;
  21. using Dongke.IBOSS.PRD.Service.DKIBOSSPRDLogic;
  22. using Dongke.IBOSS.PRD.Service.PCModuleLogic;
  23. using Dongke.IBOSS.PRD.Service.PDAModuleLogic;
  24. using Dongke.IBOSS.PRD.Service.PMModuleLogic;
  25. using Dongke.IBOSS.PRD.Service.PublicModuleService;
  26. using Dongke.IBOSS.PRD.Service.ReportModuleLogic;
  27. using Dongke.IBOSS.PRD.Service.SmartDeviceService;
  28. using Dongke.IBOSS.PRD.Service.SystemModuleLogic;
  29. using Dongke.IBOSS.PRD.WCF.Contracts;
  30. using Dongke.IBOSS.PRD.WCF.DataModels;
  31. using Dongke.IBOSS.PRD.WCF.DataModels.ConfigModule;
  32. using Dongke.IBOSS.PRD.WCF.DataModels.HRModule;
  33. using Dongke.IBOSS.PRD.WCF.DataModels.PCModule;
  34. using Dongke.IBOSS.PRD.WCF.DataModels.PMModule;
  35. namespace Dongke.IBOSS.PRD.WCF.Services
  36. {
  37. // 服务实现类,继承服务声明接口
  38. // 该标签声明该服务可以在ASP.NET下运行
  39. [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
  40. [ServiceBehavior(ConfigurationName = "PDAModuleService",
  41. InstanceContextMode = InstanceContextMode.PerCall,
  42. ConcurrencyMode = ConcurrencyMode.Multiple,
  43. UseSynchronizationContext = false)]
  44. public partial class PDAModuleService : IPDAModule
  45. {
  46. #region 属性
  47. /// <summary>
  48. /// 用户登陆的信息
  49. /// </summary>
  50. SUserInfo sUserInfo
  51. {
  52. get;
  53. set;
  54. }
  55. #endregion
  56. #region 构造函数
  57. /// <summary>
  58. /// 构造函数
  59. /// </summary>
  60. public PDAModuleService()
  61. : base()
  62. {
  63. }
  64. #endregion
  65. #region 验证
  66. /// <summary>
  67. /// 验证访问头
  68. /// </summary>
  69. /// <param name="accountCode">帐套编码</param>
  70. /// <param name="userCode">用户编码</param>
  71. /// <param name="userPassword">用户密码</param>
  72. /// <param name="sessionKey">访问密钥</param>
  73. /// <returns></returns>
  74. private ActionResult DoPDACheck(string accountCode, string userCode, string userPassword, string sessionKey)
  75. {
  76. try
  77. {
  78. ActionResult actionResult = new ActionResult();
  79. LoginRequestEntity requestEntity = new LoginRequestEntity();
  80. requestEntity.AccountCode = accountCode;
  81. requestEntity.UserCode = userCode;
  82. requestEntity.Password = userPassword;
  83. requestEntity.SessionKey = sessionKey;
  84. SUserInfo userInfo = null;
  85. string loginStatus = DKIBOSSPRDLogic.AuthenticateRepeatLogin(requestEntity, out userInfo);
  86. // 用户登录信息错误
  87. if (Constant.INT_IS_ONE.ToString().Equals(loginStatus))
  88. {
  89. actionResult.Status = (int)Constant.PDAResult.LoginInfoError;
  90. actionResult.Message = Constant.PDA_RESULT_LOGININFOERROR;
  91. }
  92. // 用户在其它终端登陆
  93. else if (Constant.INT_IS_TWO.ToString().Equals(loginStatus))
  94. {
  95. actionResult.Status = (int)Constant.PDAResult.RepeatLogin;
  96. actionResult.Message = Constant.PDA_RESULT_REPEATLOGIN;
  97. }
  98. // Lic错误
  99. else if ("3".Equals(loginStatus))
  100. {
  101. actionResult.Status = (int)Constant.PDAResult.LicInfoError;
  102. actionResult.Message = "授权信息错误,请联系管理员。";
  103. }
  104. else
  105. {
  106. actionResult.Status = (int)Constant.PDAResult.Success;
  107. }
  108. sUserInfo = userInfo;
  109. return actionResult;
  110. }
  111. catch (Exception ex)
  112. {
  113. throw ex;
  114. }
  115. }
  116. #endregion
  117. #region WCF服务
  118. /// <summary>
  119. /// 测试PDA连接WCF服务
  120. /// </summary>
  121. /// <param name="value">测试文本</param>
  122. /// <returns>返回文本</returns>
  123. public string TestConnectionEx(string value)
  124. {
  125. return "连接成功!" + value;
  126. }
  127. public string TestConnection()
  128. {
  129. return "连接成功!";
  130. }
  131. #endregion
  132. #region 系统登录
  133. /// <summary>
  134. /// 系统登录
  135. /// </summary>
  136. /// <param name="accountCode"></param>
  137. /// <param name="userCode"></param>
  138. /// <param name="userPassword"></param>
  139. /// <param name="macAddress"></param>
  140. /// <param name="ipAddress"></param>
  141. /// <param name="phoneCode"></param>
  142. /// <param name="phoneType"></param>
  143. /// <param name="appVersion"></param>
  144. /// <param name="systemType"></param>
  145. /// <param name="systemVersion"></param>
  146. /// <returns></returns>
  147. public PDALoginResult DoPDALogin(string accountCode, string userCode, string userPassword,
  148. string macAddress, string ipAddress, string phoneCode, string phoneType,
  149. string appVersion, string systemType, string systemVersion)
  150. {
  151. try
  152. {
  153. LoginRequestEntity requestEntity = new LoginRequestEntity();
  154. requestEntity.AccountCode = accountCode;
  155. requestEntity.UserCode = userCode;
  156. requestEntity.Password = userPassword;
  157. requestEntity.ComputerName = phoneCode;
  158. requestEntity.IPAddress = ipAddress;
  159. requestEntity.MACAddress = macAddress;
  160. PDALoginResult result = ServiceInvoker.Invoke<PDALoginResult>(this,
  161. () => PDAModuleLogic.DoPDALogin(requestEntity));
  162. return result;
  163. }
  164. catch (Exception ex)
  165. {
  166. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  167. OutputLog.TraceLog(LogPriority.Error,
  168. this.ToString(),
  169. System.Reflection.MethodBase.GetCurrentMethod().Name,
  170. ex.ToString(),
  171. LocalPath.LogExePath);
  172. PDALoginResult result = new PDALoginResult();
  173. result.Status = (int)Constant.PDAResult.Exception;
  174. result.Message = Constant.PDA_RESULT_EXCEPTION;
  175. return result;
  176. }
  177. }
  178. /// <summary>
  179. /// 退出
  180. /// </summary>
  181. /// <param name="accountCode">帐套code</param>
  182. /// <param name="userCode">用户code</param>
  183. /// <param name="userPassword">用户密码</param>
  184. /// <param name="sessionKey">本次登陆密钥</param>
  185. /// <returns></returns>
  186. public ActionResult DoPDAOut(string accountCode, string userCode, string userPassword, string sessionKey)
  187. {
  188. ActionResult actionResult = new ActionResult();
  189. try
  190. {
  191. // 验证请求头信息
  192. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  193. // 验证失败
  194. if (actionResult.Status != (int)Constant.PDAResult.Success)
  195. {
  196. return actionResult;
  197. }
  198. bool result = DKIBOSSPRDLogic.Logout(sUserInfo.UserID, "3", sUserInfo);
  199. actionResult.Result = JsonHelper.ToJson(result);
  200. actionResult.Status = (int)Constant.PDAResult.Success;
  201. }
  202. catch (Exception ex)
  203. {
  204. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  205. OutputLog.TraceLog(LogPriority.Error,
  206. this.ToString(),
  207. System.Reflection.MethodBase.GetCurrentMethod().Name,
  208. ex.ToString(),
  209. LocalPath.LogExePath);
  210. actionResult.Status = (int)Constant.PDAResult.Exception;
  211. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  212. }
  213. return actionResult;
  214. }
  215. /// <summary>
  216. /// 修改密码
  217. /// </summary>
  218. /// <param name="accountCode"></param>
  219. /// <param name="userCode"></param>
  220. /// <param name="userPassword"></param>
  221. /// <param name="sessionKey"></param>
  222. /// <returns></returns>
  223. public ActionResult ChangeUserPassword(string accountCode, string userCode, string userPassword, string sessionKey,
  224. string newPassWord)
  225. {
  226. ActionResult actionResult = new ActionResult();
  227. try
  228. {
  229. // 验证请求头信息
  230. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  231. // 验证失败
  232. if (actionResult.Status != (int)Constant.PDAResult.Success)
  233. {
  234. return actionResult;
  235. }
  236. string result = ServiceInvoker.Invoke<string>(this,
  237. () => SystemModuleDAL.SaveUserPassWord(newPassWord, userCode, null, sUserInfo));
  238. actionResult.Status = (int)Constant.PDAResult.Success;
  239. }
  240. catch (Exception ex)
  241. {
  242. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  243. OutputLog.TraceLog(LogPriority.Error,
  244. this.ToString(),
  245. System.Reflection.MethodBase.GetCurrentMethod().Name,
  246. ex.ToString(),
  247. LocalPath.LogExePath);
  248. actionResult.Status = (int)Constant.PDAResult.Exception;
  249. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  250. }
  251. return actionResult;
  252. }
  253. /// <summary>
  254. /// 获取Apk信息
  255. /// </summary>
  256. /// <returns></returns>
  257. public string GetApkInfo()
  258. {
  259. try
  260. {
  261. ServiceResultEntity sre = PDAModuleLogic.GetApkInfo();
  262. return JsonHelper.ToJson(sre);
  263. }
  264. catch (Exception ex)
  265. {
  266. OutputLog.TraceLog(LogPriority.Error,
  267. this.ToString(),
  268. System.Reflection.MethodBase.GetCurrentMethod().Name,
  269. ex.ToString(),
  270. LocalPath.LogExePath);
  271. return null;
  272. }
  273. }
  274. #endregion
  275. #region 取得展示数据
  276. /// <summary>
  277. /// 获得生产线菜单
  278. /// </summary>
  279. /// <param name="accountCode">帐套code</param>
  280. /// <param name="userCode">用户code</param>
  281. /// <param name="userPassword">用户密码</param>
  282. /// <param name="sessionKey">本次登陆密钥</param>
  283. /// <returns></returns>
  284. /// <remarks>
  285. /// 陈冰 2014.09.18 新建
  286. /// </remarks>
  287. public ActionResult GetProductionLineMenu(string accountCode, string userCode, string userPassword, string sessionKey)
  288. {
  289. ActionResult actionResult = new ActionResult();
  290. try
  291. {
  292. // 验证请求头信息
  293. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  294. // 验证失败
  295. if (actionResult.Status != (int)Constant.PDAResult.Success)
  296. {
  297. return actionResult;
  298. }
  299. // 查询菜单
  300. DataTable dtPLM = ServiceInvoker.Invoke<DataTable>(this,
  301. () => PDAModuleLogic.GetProductionLineMenu(sUserInfo));
  302. PDAFunctionResult pdaFunction = new PDAFunctionResult();
  303. pdaFunction.MenuCode = "Root";
  304. DataRow[] navigationRows = dtPLM.Select("LEN(MenuCode) = " + Constant.INT_IS_TWO.ToString(), "MenuCode ASC"); // 编号2为一级菜单
  305. foreach (DataRow newRow in navigationRows)
  306. {
  307. #region 插入子节点数据
  308. int? intProcedureID = null;
  309. int? intModelType = null;
  310. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  311. {
  312. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  313. }
  314. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  315. {
  316. intModelType = Convert.ToInt32(newRow["ModelType"]);
  317. }
  318. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  319. //xuwei add 2020-01-02
  320. pdaFunctionChild.IsGlazeChange = string.IsNullOrEmpty(newRow["IsGlazeChange"].ToString()) ? 0 : Convert.ToInt32(newRow["IsGlazeChange"].ToString());
  321. //pdaFunctionChild.IsGlazeChange = 0;
  322. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  323. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  324. pdaFunctionChild.ProcedureID = intProcedureID;
  325. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  326. pdaFunctionChild.ModelType = intModelType;
  327. pdaFunction.PDAFunctions.Add(pdaFunctionChild);
  328. #endregion
  329. InitTreeView(dtPLM, newRow["MenuCode"].ToString(), pdaFunctionChild);
  330. }
  331. //actionResult.Result = JsonHelper.ToJson(dtPLM);
  332. actionResult.Result = JsonHelper.ToJson(pdaFunction);
  333. actionResult.Status = (int)Constant.PDAResult.Success;
  334. }
  335. catch (Exception ex)
  336. {
  337. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  338. OutputLog.TraceLog(LogPriority.Error,
  339. this.ToString(),
  340. System.Reflection.MethodBase.GetCurrentMethod().Name,
  341. ex.ToString(),
  342. LocalPath.LogExePath);
  343. actionResult.Status = (int)Constant.PDAResult.Exception;
  344. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  345. }
  346. return actionResult;
  347. }
  348. /// <summary>
  349. /// 初始化树形控件
  350. /// </summary>
  351. /// <param name="treeTable">菜单数据表</param>
  352. /// <param name="rows">待处理的菜单集合</param>
  353. /// <param name="node">当前树节点</param>
  354. private void InitTreeView(DataTable treeTable, string pFuncCode, PDAFunctionResult pFunctions)
  355. {
  356. string filterExpression = "MenuCode LIKE '" + pFuncCode + "%' AND LEN(MenuCode) = "
  357. + (pFuncCode.Length + Constant.INT_IS_TWO);
  358. DataRow[] subRows = treeTable.Select(filterExpression, "MenuCode ASC");
  359. //DataRow[] subRows = treeTable.Select(filterExpression, "ProcedureCode ASC");
  360. foreach (DataRow newRow in subRows)
  361. {
  362. #region 插入子节点数据
  363. int? intProcedureID = null;
  364. int? intModelType = null;
  365. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  366. {
  367. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  368. }
  369. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  370. {
  371. intModelType = Convert.ToInt32(newRow["ModelType"]);
  372. }
  373. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  374. //xuwei add 2020-01-02
  375. pdaFunctionChild.IsGlazeChange = string.IsNullOrEmpty(newRow["IsGlazeChange"].ToString()) ? 0 : Convert.ToInt32(newRow["IsGlazeChange"].ToString());
  376. //pdaFunctionChild.IsGlazeChange = 0;
  377. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  378. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  379. pdaFunctionChild.ProcedureID = intProcedureID;
  380. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  381. pdaFunctionChild.ModelType = intModelType;
  382. pFunctions.PDAFunctions.Add(pdaFunctionChild);
  383. #endregion
  384. // 递归方法
  385. InitTreeView(treeTable, newRow["MenuCode"].ToString(), pdaFunctionChild);
  386. }
  387. }
  388. #endregion
  389. #region 获得工序信息
  390. /// <summary>
  391. /// 获得工序信息
  392. /// </summary>
  393. /// <param name="accountCode">帐套code</param>
  394. /// <param name="userCode">用户code</param>
  395. /// <param name="userPassword">用户密码</param>
  396. /// <param name="sessionKey">本次登陆密钥</param>
  397. /// <param name="procedureID">工序ID</param>
  398. /// <returns></returns>
  399. /// <remarks>
  400. /// 陈冰 2014.09.18 新建
  401. /// </remarks>
  402. public ActionResult GetProcedureByID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  403. {
  404. ActionResult actionResult = new ActionResult();
  405. try
  406. {
  407. // 验证请求头信息
  408. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  409. // 验证失败
  410. if (actionResult.Status != (int)Constant.PDAResult.Success)
  411. {
  412. return actionResult;
  413. }
  414. ProcedureEntity procedureEntity = ServiceInvoker.Invoke<ProcedureEntity>(this,
  415. () => PMModuleLogic.GetProcedureDataEntityByID(procedureID, sUserInfo));
  416. actionResult.Result = JsonHelper.ToJson(procedureEntity);
  417. actionResult.Status = (int)Constant.PDAResult.Success;
  418. }
  419. catch (Exception ex)
  420. {
  421. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  422. OutputLog.TraceLog(LogPriority.Error,
  423. this.ToString(),
  424. System.Reflection.MethodBase.GetCurrentMethod().Name,
  425. ex.ToString(),
  426. LocalPath.LogExePath);
  427. actionResult.Status = (int)Constant.PDAResult.Exception;
  428. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  429. }
  430. return actionResult;
  431. }
  432. #endregion
  433. #region 校验
  434. /// <summary>
  435. /// 校验产品条码是否可以走到该工序
  436. /// </summary>
  437. /// <param name="accountCode">帐套code</param>
  438. /// <param name="userCode">用户code</param>
  439. /// <param name="userPassword">用户密码</param>
  440. /// <param name="sessionKey">本次登陆密钥</param>
  441. /// <param name="procedureID">工序ID</param>
  442. /// <param name="barcode">条码</param>
  443. /// <returns></returns>
  444. /// <remarks>
  445. /// 陈冰 2014.09.18 新建
  446. /// </remarks>
  447. public ActionResult CheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode, bool isNewCheck)
  448. {
  449. ActionResult actionResult = new ActionResult();
  450. try
  451. {
  452. // 验证请求头信息
  453. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  454. // 验证失败
  455. if (actionResult.Status != (int)Constant.PDAResult.Success)
  456. {
  457. return actionResult;
  458. }
  459. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  460. () => PMModuleLogic.CheckBarcodePDA(procedureID, barcode, sUserInfo));
  461. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  462. {
  463. if (isNewCheck)
  464. {
  465. actionResult.Result = JsonHelper.ToJson(barcodeDataSet);
  466. }
  467. else
  468. {
  469. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  470. }
  471. actionResult.Status = (int)Constant.PDAResult.Success;
  472. }
  473. else
  474. {
  475. actionResult.Status = (int)Constant.PDAResult.Fail;
  476. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  477. }
  478. }
  479. catch (Exception ex)
  480. {
  481. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  482. OutputLog.TraceLog(LogPriority.Error,
  483. this.ToString(),
  484. System.Reflection.MethodBase.GetCurrentMethod().Name,
  485. ex.ToString(),
  486. LocalPath.LogExePath);
  487. actionResult.Status = (int)Constant.PDAResult.Exception;
  488. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  489. }
  490. return actionResult;
  491. }
  492. /// <summary>
  493. /// 校验产品条码是否可以进行干补
  494. /// </summary>
  495. /// <param name="accountCode">帐套code</param>
  496. /// <param name="userCode">用户code</param>
  497. /// <param name="userPassword">用户密码</param>
  498. /// <param name="sessionKey">本次登陆密钥</param>
  499. /// <param name="procedureID">工序ID</param>
  500. /// <param name="barcode">条码</param>
  501. /// <returns></returns>
  502. /// <remarks>
  503. /// 袁新成 2015.4.1 新建
  504. /// </remarks>
  505. public ActionResult CheckDryRepairBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  506. {
  507. ActionResult actionResult = new ActionResult();
  508. try
  509. {
  510. // 验证请求头信息
  511. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  512. // 验证失败
  513. if (actionResult.Status != (int)Constant.PDAResult.Success)
  514. {
  515. return actionResult;
  516. }
  517. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  518. () => PMModuleLogic.CheckDryRepairBarcode(procedureID, barcode, sUserInfo));
  519. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  520. {
  521. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  522. actionResult.Status = (int)Constant.PDAResult.Success;
  523. }
  524. else
  525. {
  526. actionResult.Status = (int)Constant.PDAResult.Fail;
  527. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  528. }
  529. }
  530. catch (Exception ex)
  531. {
  532. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  533. OutputLog.TraceLog(LogPriority.Error,
  534. this.ToString(),
  535. System.Reflection.MethodBase.GetCurrentMethod().Name,
  536. ex.ToString(),
  537. LocalPath.LogExePath);
  538. actionResult.Status = (int)Constant.PDAResult.Exception;
  539. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  540. }
  541. return actionResult;
  542. }
  543. /// <summary>
  544. /// 检验生产工号
  545. /// </summary>
  546. /// <param name="accountCode">帐套code</param>
  547. /// <param name="userCode">用户code</param>
  548. /// <param name="userPassword">用户密码</param>
  549. /// <param name="sessionKey">本次登陆密钥</param>
  550. /// <param name="procedureID">工序ID</param>
  551. /// <param name="procedureUserCode">生产工号</param>
  552. /// <remarks>
  553. /// 陈冰 2014.09.18 新建
  554. /// </remarks>
  555. public ActionResult CheckProcedureUser(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string procedureUserCode)
  556. {
  557. ActionResult actionResult = new ActionResult();
  558. try
  559. {
  560. // 验证请求头信息
  561. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  562. // 验证失败
  563. if (actionResult.Status != (int)Constant.PDAResult.Success)
  564. {
  565. return actionResult;
  566. }
  567. CheckProcedureUserResult checkProcedureUserResult = ServiceInvoker.Invoke<CheckProcedureUserResult>(this,
  568. () => PMModuleLogic.CheckProcedureUser(procedureID, procedureUserCode, sUserInfo));
  569. actionResult.Result = JsonHelper.ToJson(checkProcedureUserResult);
  570. actionResult.Status = (int)Constant.PDAResult.Success;
  571. }
  572. catch (Exception ex)
  573. {
  574. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  575. OutputLog.TraceLog(LogPriority.Error,
  576. this.ToString(),
  577. System.Reflection.MethodBase.GetCurrentMethod().Name,
  578. ex.ToString(),
  579. LocalPath.LogExePath);
  580. actionResult.Status = (int)Constant.PDAResult.Exception;
  581. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  582. }
  583. return actionResult;
  584. }
  585. /// <summary>
  586. /// 校验窑车是否可装车并返回窑车信息
  587. /// </summary>
  588. /// <param name="accountCode">帐套code</param>
  589. /// <param name="userCode">用户code</param>
  590. /// <param name="userPassword">用户密码</param>
  591. /// <param name="sessionKey">本次登陆密钥</param>
  592. /// <param name="kilnCarCode">窑车号</param>
  593. /// <param name="modelType">工序类别</param>
  594. /// <returns></returns>
  595. /// <remarks>
  596. /// 陈冰 2014.10.04 新建
  597. /// </remarks>
  598. public ActionResult CheckKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int pProcedureId, string kilnCarCode, int modelType)
  599. {
  600. ActionResult actionResult = new ActionResult();
  601. try
  602. {
  603. // 验证请求头信息
  604. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  605. // 验证失败
  606. if (actionResult.Status != (int)Constant.PDAResult.Success)
  607. {
  608. return actionResult;
  609. }
  610. CheckKilnCarResultEntity checkKilnCarResultEntity = ServiceInvoker.Invoke<CheckKilnCarResultEntity>(this,
  611. () => PMModuleLogic.CheckKilnCar(pProcedureId, kilnCarCode, modelType, sUserInfo));
  612. actionResult.Result = JsonHelper.ToJson(checkKilnCarResultEntity);
  613. actionResult.Status = (int)Constant.PDAResult.Success;
  614. }
  615. catch (Exception ex)
  616. {
  617. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  618. OutputLog.TraceLog(LogPriority.Error,
  619. this.ToString(),
  620. System.Reflection.MethodBase.GetCurrentMethod().Name,
  621. ex.ToString(),
  622. LocalPath.LogExePath);
  623. actionResult.Status = (int)Constant.PDAResult.Exception;
  624. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  625. }
  626. return actionResult;
  627. }
  628. #endregion
  629. #region 保存条码信息
  630. /// <summary>
  631. /// 保存条码信息
  632. /// </summary>
  633. /// <param name="accountCode">帐套code</param>
  634. /// <param name="userCode">用户code</param>
  635. /// <param name="userPassword">用户密码</param>
  636. /// <param name="sessionKey">本次登陆密钥</param>
  637. /// <param name="procedureID">工序ID</param>
  638. /// <param name="productionDataEntitys">条码信息</param>
  639. public ActionResult AddWorkPiece(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID,
  640. ProductionDataEntity[] productionDataEntitys)
  641. {
  642. ActionResult actionResult = new ActionResult();
  643. try
  644. {
  645. // 验证请求头信息
  646. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  647. // 验证失败
  648. if (actionResult.Status != (int)Constant.PDAResult.Success)
  649. {
  650. return actionResult;
  651. }
  652. DataTable dtProductionData = DataConvert.ObjectConvertToTable<ProductionDataEntity>(productionDataEntitys);
  653. if (!dtProductionData.Columns.Contains("IsPDA"))
  654. {
  655. dtProductionData.Columns.Add("IsPDA");
  656. }
  657. ProcedureEntity procedureInfo = null;
  658. DataTable resultDT = ServiceInvoker.Invoke<DataTable>(this,
  659. () => PMModuleLogicDAL.AddWorkPiece(procedureID, dtProductionData, sUserInfo, out procedureInfo));
  660. actionResult.Result = JsonHelper.ToJson(resultDT);
  661. actionResult.Status = (int)Constant.PDAResult.Success;
  662. if (resultDT != null)
  663. {
  664. DataRow[] drs = resultDT.Select("out_errMsg is not null and out_errMsg <> ''");
  665. if (drs != null && drs.Length > 0)
  666. {
  667. return actionResult;
  668. }
  669. }
  670. #region PDA条码打印
  671. if (procedureInfo != null && procedureInfo.BarCodePrintCopies > 0 &&
  672. procedureInfo.ModelType == (int)Constant.ProcedureModelType.Normal)
  673. {
  674. try
  675. {
  676. if (procedureInfo.CollectType == 1)
  677. {
  678. //foreach (DataRow item in dtProductionData.Rows)
  679. //{
  680. // ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(item["barcode"].ToString(),
  681. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  682. // if (sre.Status != Constant.ServiceResultStatus.Success)
  683. // {
  684. // actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  685. // actionResult.Message = sre.Message;
  686. // return actionResult;
  687. // }
  688. //}
  689. }
  690. else
  691. {
  692. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(dtProductionData.Rows[0]["barcode"].ToString(),
  693. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  694. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(dtProductionData.Rows[0]["barcode"].ToString(),
  695. procedureInfo.BarCodePrintCopies, null, sUserInfo, 0);
  696. if (sre.Status != Constant.ServiceResultStatus.Success)
  697. {
  698. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  699. actionResult.Message = sre.Message;
  700. return actionResult;
  701. }
  702. }
  703. }
  704. catch (Exception ex)
  705. {
  706. OutputLog.TraceLog(LogPriority.Error,
  707. this.ToString(),
  708. System.Reflection.MethodBase.GetCurrentMethod().Name,
  709. ex.ToString(),
  710. LocalPath.LogExePath);
  711. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  712. actionResult.Message = "条码打印异常";
  713. return actionResult;
  714. }
  715. }
  716. #endregion PDA条码打印
  717. }
  718. catch (Exception ex)
  719. {
  720. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  721. OutputLog.TraceLog(LogPriority.Error,
  722. this.ToString(),
  723. System.Reflection.MethodBase.GetCurrentMethod().Name,
  724. ex.ToString(),
  725. LocalPath.LogExePath);
  726. try
  727. {
  728. string ss = JsonHelper.ToJson(productionDataEntitys);
  729. OutputLog.TraceLog(LogPriority.Error,
  730. this.ToString(),
  731. System.Reflection.MethodBase.GetCurrentMethod().Name,
  732. $" userCode:{userCode} procedureID:{procedureID} " + ss,
  733. LocalPath.LogExePath);
  734. }
  735. catch
  736. {
  737. }
  738. actionResult.Status = (int)Constant.PDAResult.Exception;
  739. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  740. }
  741. return actionResult;
  742. }
  743. #endregion
  744. #region 获得系统/基数数据
  745. /// <summary>
  746. /// 获得数据字典
  747. /// </summary>
  748. /// <param name="accountCode">帐套code</param>
  749. /// <param name="userCode">用户code</param>
  750. /// <param name="userPassword">用户密码</param>
  751. /// <param name="sessionKey">本次登陆密钥</param>
  752. /// <param name="dicType">字典类型</param>
  753. /// <returns></returns>
  754. public ActionResult GetDataDictionaryByType(string accountCode, string userCode, string userPassword, string sessionKey, string dicType)
  755. {
  756. ActionResult actionResult = new ActionResult();
  757. try
  758. {
  759. // 验证请求头信息
  760. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  761. // 验证失败
  762. if (actionResult.Status != (int)Constant.PDAResult.Success)
  763. {
  764. return actionResult;
  765. }
  766. DataTable dicDataTable = ServiceInvoker.Invoke<DataTable>(this,
  767. () => CommonModuleLogic.GetDataDictionaryByType(sUserInfo, dicType));
  768. actionResult.Result = JsonHelper.ToJson(dicDataTable);
  769. actionResult.Status = (int)Constant.PDAResult.Success;
  770. }
  771. catch (Exception ex)
  772. {
  773. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  774. OutputLog.TraceLog(LogPriority.Error,
  775. this.ToString(),
  776. System.Reflection.MethodBase.GetCurrentMethod().Name,
  777. ex.ToString(),
  778. LocalPath.LogExePath);
  779. actionResult.Status = (int)Constant.PDAResult.Exception;
  780. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  781. }
  782. return actionResult;
  783. }
  784. #endregion
  785. #region 检验工序接口
  786. /// <summary>
  787. /// 获得检验标识
  788. /// </summary>
  789. /// <param name="accountCode">帐套code</param>
  790. /// <param name="userCode">用户code</param>
  791. /// <param name="userPassword">用户密码</param>
  792. /// <param name="sessionKey">本次登陆密钥</param>
  793. /// <returns></returns>
  794. /// <remarks>
  795. /// 陈冰 2014.10.04 新建
  796. /// </remarks>
  797. public ActionResult GetDefectFlagData(string accountCode, string userCode, string userPassword, string sessionKey)
  798. {
  799. ActionResult actionResult = new ActionResult();
  800. try
  801. {
  802. // 验证请求头信息
  803. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  804. // 验证失败
  805. if (actionResult.Status != (int)Constant.PDAResult.Success)
  806. {
  807. return actionResult;
  808. }
  809. #region 构造缺陷标识的数据源
  810. DataTable dtDefectFlag = CreateDataSource.GetDefectFlagTable();
  811. #endregion
  812. actionResult.Result = JsonHelper.ToJson(dtDefectFlag);
  813. actionResult.Status = (int)Constant.PDAResult.Success;
  814. }
  815. catch (Exception ex)
  816. {
  817. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  818. OutputLog.TraceLog(LogPriority.Error,
  819. this.ToString(),
  820. System.Reflection.MethodBase.GetCurrentMethod().Name,
  821. ex.ToString(),
  822. LocalPath.LogExePath);
  823. actionResult.Status = (int)Constant.PDAResult.Exception;
  824. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  825. }
  826. return actionResult;
  827. }
  828. /// <summary>
  829. /// 由条码和当前检验工序获取返工工序
  830. /// </summary>
  831. /// <param name="accountCode">帐套code</param>
  832. /// <param name="userCode">用户code</param>
  833. /// <param name="userPassword">用户密码</param>
  834. /// <param name="sessionKey">本次登陆密钥</param>
  835. /// <param name="procedureID">当前检验工序ID</param>
  836. /// <param name="barcode">条码</param>
  837. /// <returns></returns>
  838. /// <remarks>
  839. /// 陈冰 2014.10.04 新建
  840. /// </remarks>
  841. public ActionResult GetReworkProcedureByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  842. {
  843. ActionResult actionResult = new ActionResult();
  844. try
  845. {
  846. // 验证请求头信息
  847. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  848. // 验证失败
  849. if (actionResult.Status != (int)Constant.PDAResult.Success)
  850. {
  851. return actionResult;
  852. }
  853. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  854. () => PMModuleLogic.GetReworkProcedureByBarcode(procedureID, barcode));
  855. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  856. {
  857. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  858. actionResult.Status = (int)Constant.PDAResult.Success;
  859. }
  860. else
  861. {
  862. actionResult.Status = (int)Constant.PDAResult.Fail;
  863. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  864. }
  865. }
  866. catch (Exception ex)
  867. {
  868. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  869. OutputLog.TraceLog(LogPriority.Error,
  870. this.ToString(),
  871. System.Reflection.MethodBase.GetCurrentMethod().Name,
  872. ex.ToString(),
  873. LocalPath.LogExePath);
  874. actionResult.Status = (int)Constant.PDAResult.Exception;
  875. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  876. }
  877. return actionResult;
  878. }
  879. /// <summary>
  880. /// 由当前检验工序获取缺陷列表
  881. /// </summary>
  882. /// <param name="accountCode">帐套code</param>
  883. /// <param name="userCode">用户code</param>
  884. /// <param name="userPassword">用户密码</param>
  885. /// <param name="sessionKey">本次登陆密钥</param>
  886. /// <param name="procedureID">当前检验工序ID</param>
  887. /// <param name="defectCode">缺陷编码</param>
  888. /// <returns></returns>
  889. /// <remarks>
  890. /// 陈冰 2014.10.04 新建
  891. /// </remarks>
  892. public ActionResult GetDefectByProcedureIDAndDefectCode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string defectCode)
  893. {
  894. ActionResult actionResult = new ActionResult();
  895. try
  896. {
  897. // 验证请求头信息
  898. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  899. // 验证失败
  900. if (actionResult.Status != (int)Constant.PDAResult.Success)
  901. {
  902. return actionResult;
  903. }
  904. object defectDs = ServiceInvoker.Invoke<object>(this,
  905. () => PMModuleLogic.GetDefectByProcedureIDAndDefectCode(procedureID, defectCode));
  906. if (defectDs != null)
  907. {
  908. actionResult.Result = JsonHelper.ToJson(defectDs);
  909. actionResult.Status = (int)Constant.PDAResult.Success;
  910. }
  911. else
  912. {
  913. actionResult.Status = (int)Constant.PDAResult.Fail;
  914. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  915. }
  916. }
  917. catch (Exception ex)
  918. {
  919. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  920. OutputLog.TraceLog(LogPriority.Error,
  921. this.ToString(),
  922. System.Reflection.MethodBase.GetCurrentMethod().Name,
  923. ex.ToString(),
  924. LocalPath.LogExePath);
  925. actionResult.Status = (int)Constant.PDAResult.Exception;
  926. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  927. }
  928. return actionResult;
  929. }
  930. /// <summary>
  931. /// 根据产品ID查出缺陷位置
  932. /// </summary>
  933. /// <param name="accountCode">帐套code</param>
  934. /// <param name="userCode">用户code</param>
  935. /// <param name="userPassword">用户密码</param>
  936. /// <param name="sessionKey">本次登陆密钥</param>
  937. /// <param name="goodsID">产品ID</param>
  938. /// <param name="positionCode">位置编码</param>
  939. /// <returns></returns>
  940. /// <remarks>
  941. /// 陈冰 2014.10.04 新建
  942. /// </remarks>
  943. public ActionResult GetDefectPositionByGoodsIDAndPositionCode(string accountCode, string userCode, string userPassword, string sessionKey, int goodsID, string positionCode)
  944. {
  945. ActionResult actionResult = new ActionResult();
  946. try
  947. {
  948. // 验证请求头信息
  949. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  950. // 验证失败
  951. if (actionResult.Status != (int)Constant.PDAResult.Success)
  952. {
  953. return actionResult;
  954. }
  955. // 缺陷位置已经不用在关联产品
  956. //object defectDs = ServiceInvoker.Invoke<object>(this,() => PMModuleLogic.GetDefectPositionByGoodsIDAndPositionCode(goodsID, positionCode));
  957. object defectDs = ServiceInvoker.Invoke<object>(this, () => PMModuleLogic.GetDefectPosition(positionCode, sUserInfo));
  958. if (defectDs != null)
  959. {
  960. actionResult.Result = JsonHelper.ToJson(defectDs);
  961. actionResult.Status = (int)Constant.PDAResult.Success;
  962. }
  963. else
  964. {
  965. actionResult.Status = (int)Constant.PDAResult.Fail;
  966. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  967. }
  968. }
  969. catch (Exception ex)
  970. {
  971. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  972. OutputLog.TraceLog(LogPriority.Error,
  973. this.ToString(),
  974. System.Reflection.MethodBase.GetCurrentMethod().Name,
  975. ex.ToString(),
  976. LocalPath.LogExePath);
  977. actionResult.Status = (int)Constant.PDAResult.Exception;
  978. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  979. }
  980. return actionResult;
  981. }
  982. /// <summary>
  983. /// 通过条码和缺陷查出责任工序
  984. /// </summary>
  985. /// <param name="accountCode">帐套code</param>
  986. /// <param name="userCode">用户code</param>
  987. /// <param name="userPassword">用户密码</param>
  988. /// <param name="sessionKey">本次登陆密钥</param>
  989. /// <param name="barcode">条码</param>
  990. /// <param name="defectid">缺陷ID</param>
  991. /// <returns></returns>
  992. /// <remarks>
  993. /// 陈冰 2014.10.04 新建
  994. /// </remarks>
  995. public ActionResult GetDutyProcedureByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int defectid)
  996. {
  997. ActionResult actionResult = new ActionResult();
  998. try
  999. {
  1000. // 验证请求头信息
  1001. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1002. // 验证失败
  1003. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1004. {
  1005. return actionResult;
  1006. }
  1007. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1008. () => PMModuleLogic.GetDutyProcedureByBarCode(barcode, defectid, sUserInfo.AccountID));
  1009. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1010. {
  1011. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs);
  1012. actionResult.Status = (int)Constant.PDAResult.Success;
  1013. }
  1014. else
  1015. {
  1016. actionResult.Status = (int)Constant.PDAResult.Fail;
  1017. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1018. }
  1019. }
  1020. catch (Exception ex)
  1021. {
  1022. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1023. OutputLog.TraceLog(LogPriority.Error,
  1024. this.ToString(),
  1025. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1026. ex.ToString(),
  1027. LocalPath.LogExePath);
  1028. actionResult.Status = (int)Constant.PDAResult.Exception;
  1029. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1030. }
  1031. return actionResult;
  1032. }
  1033. /// <summary>
  1034. /// 通过条码与工序查出责任工号(己废)
  1035. /// </summary>
  1036. /// <param name="accountCode">帐套code</param>
  1037. /// <param name="userCode">用户code</param>
  1038. /// <param name="userPassword">用户密码</param>
  1039. /// <param name="sessionKey">本次登陆密钥</param>
  1040. /// <param name="barcode">条码</param>
  1041. /// <param name="dutyProcedureID">责任工序</param>
  1042. /// <returns></returns>
  1043. /// <remarks>
  1044. /// 陈冰 2014.10.04 新建
  1045. /// </remarks>
  1046. public ActionResult GetDutyProcedureCodeByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int dutyProcedureID)
  1047. {
  1048. ActionResult actionResult = new ActionResult();
  1049. try
  1050. {
  1051. // 验证请求头信息
  1052. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1053. // 验证失败
  1054. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1055. {
  1056. return actionResult;
  1057. }
  1058. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1059. () => PMModuleLogic.GetDutyProcedureCodeByBarCode(barcode, dutyProcedureID));
  1060. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1061. {
  1062. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1063. actionResult.Status = (int)Constant.PDAResult.Success;
  1064. }
  1065. else
  1066. {
  1067. actionResult.Status = (int)Constant.PDAResult.Fail;
  1068. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1069. }
  1070. }
  1071. catch (Exception ex)
  1072. {
  1073. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1074. OutputLog.TraceLog(LogPriority.Error,
  1075. this.ToString(),
  1076. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1077. ex.ToString(),
  1078. LocalPath.LogExePath);
  1079. actionResult.Status = (int)Constant.PDAResult.Exception;
  1080. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1081. }
  1082. return actionResult;
  1083. }
  1084. /// <summary>
  1085. /// 通过条码与工序查出责任工号
  1086. /// </summary>
  1087. /// <param name="accountCode"></param>
  1088. /// <param name="userCode"></param>
  1089. /// <param name="userPassword"></param>
  1090. /// <param name="sessionKey"></param>
  1091. /// <param name="ProductionDataID">生产数据ID</param>
  1092. /// <returns></returns>
  1093. public ActionResult GetDutyProcedureCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  1094. {
  1095. ActionResult actionResult = new ActionResult();
  1096. try
  1097. {
  1098. // 验证请求头信息
  1099. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1100. // 验证失败
  1101. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1102. {
  1103. return actionResult;
  1104. }
  1105. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1106. () => PMModuleLogic.GetDutyProcedureCodeByProductionDataID(ProductionDataID));
  1107. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1108. {
  1109. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1110. actionResult.Status = (int)Constant.PDAResult.Success;
  1111. }
  1112. else
  1113. {
  1114. actionResult.Status = (int)Constant.PDAResult.Fail;
  1115. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1116. }
  1117. }
  1118. catch (Exception ex)
  1119. {
  1120. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1121. OutputLog.TraceLog(LogPriority.Error,
  1122. this.ToString(),
  1123. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1124. ex.ToString(),
  1125. LocalPath.LogExePath);
  1126. actionResult.Status = (int)Constant.PDAResult.Exception;
  1127. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1128. }
  1129. return actionResult;
  1130. }
  1131. /// <summary>
  1132. /// 通过生产数据与工号ID查询工种
  1133. /// </summary>
  1134. /// <param name="accountCode">帐套code</param>
  1135. /// <param name="userCode">用户code</param>
  1136. /// <param name="userPassword">用户密码</param>
  1137. /// <param name="sessionKey">本次登陆密钥</param>
  1138. /// <param name="productionDataID">生产数据ID</param>
  1139. /// <param name="userID">工号ID</param>
  1140. /// <returns></returns>
  1141. /// <remarks>
  1142. /// 陈冰 2014.10.08 新建
  1143. /// </remarks>
  1144. public ActionResult GetDutyJobsByUserIDAndProductionID(string accountCode, string userCode, string userPassword, string sessionKey,
  1145. //int productionDataID, int userID)
  1146. int classesSettingID, int defectid, int procedureID)
  1147. {
  1148. ActionResult actionResult = new ActionResult();
  1149. try
  1150. {
  1151. // 验证请求头信息
  1152. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1153. // 验证失败
  1154. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1155. {
  1156. return actionResult;
  1157. }
  1158. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1159. //() => PMModuleLogic.GetDutyJobsCodeByUser(userID, productionDataID));
  1160. () => PDAModuleLogic.GetDutyJobsCodeByUser(classesSettingID, defectid, procedureID));
  1161. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1162. {
  1163. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1164. actionResult.Status = (int)Constant.PDAResult.Success;
  1165. }
  1166. else
  1167. {
  1168. actionResult.Status = (int)Constant.PDAResult.Fail;
  1169. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1170. }
  1171. }
  1172. catch (Exception ex)
  1173. {
  1174. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1175. OutputLog.TraceLog(LogPriority.Error,
  1176. this.ToString(),
  1177. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1178. ex.ToString(),
  1179. LocalPath.LogExePath);
  1180. actionResult.Status = (int)Constant.PDAResult.Exception;
  1181. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1182. }
  1183. return actionResult;
  1184. }
  1185. /// <summary>
  1186. /// 根据生产数据ID,用户ID及工种选出责任员工
  1187. /// </summary>
  1188. /// <param name="accountCode">帐套code</param>
  1189. /// <param name="userCode">用户code</param>
  1190. /// <param name="userPassword">用户密码</param>
  1191. /// <param name="sessionKey">本次登陆密钥</param>
  1192. /// <param name="productionDataID">生产数据ID</param>
  1193. /// <param name="userID">工号ID</param>
  1194. /// <param name="jobsID">工种ID</param>
  1195. /// <returns></returns>
  1196. /// <remarks>
  1197. /// 陈冰 2014.10.08 新建
  1198. /// </remarks>
  1199. public ActionResult GetDutyStaffByUserIDAndJobs(string accountCode, string userCode, string userPassword, string sessionKey,
  1200. //int productionDataID, int userID, int jobsID)
  1201. int classesSettingID, int jobsID)
  1202. {
  1203. ActionResult actionResult = new ActionResult();
  1204. try
  1205. {
  1206. // 验证请求头信息
  1207. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1208. // 验证失败
  1209. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1210. {
  1211. return actionResult;
  1212. }
  1213. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1214. //() => PMModuleLogic.GetDutyStaffByUserIDAndJobs(productionDataID, userID, jobsID));
  1215. () => PDAModuleLogic.GetDutyStaffByUserIDAndJobs(classesSettingID, jobsID));
  1216. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1217. {
  1218. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1219. actionResult.Status = (int)Constant.PDAResult.Success;
  1220. }
  1221. else
  1222. {
  1223. actionResult.Status = (int)Constant.PDAResult.Fail;
  1224. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1225. }
  1226. }
  1227. catch (Exception ex)
  1228. {
  1229. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1230. OutputLog.TraceLog(LogPriority.Error,
  1231. this.ToString(),
  1232. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1233. ex.ToString(),
  1234. LocalPath.LogExePath);
  1235. actionResult.Status = (int)Constant.PDAResult.Exception;
  1236. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1237. }
  1238. return actionResult;
  1239. }
  1240. /// <summary>
  1241. /// 获得产品分级
  1242. /// </summary>
  1243. /// <param name="accountCode">帐套code</param>
  1244. /// <param name="userCode">用户code</param>
  1245. /// <param name="userPassword">用户密码</param>
  1246. /// <param name="sessionKey">本次登陆密钥</param>
  1247. /// <returns></returns>
  1248. /// <remarks>
  1249. /// 陈冰 2014.10.08 新建
  1250. /// xuwei 2019-12-4 添加参数type 默认为2成检 为1时 半检
  1251. /// </remarks>
  1252. public ActionResult GetGoodsGradeData(string accountCode, string userCode, string userPassword, string sessionKey, int type = 2)
  1253. {
  1254. ActionResult actionResult = new ActionResult();
  1255. try
  1256. {
  1257. // 验证请求头信息
  1258. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1259. // 验证失败
  1260. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1261. {
  1262. return actionResult;
  1263. }
  1264. #region 构造产品分级的数据源
  1265. //DataTable dtGrade = CreateDataSource.GetGoodsGradeTable();
  1266. //xuwei modify 2019-12-04 支持半检 没传参数 type=0
  1267. //DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(2 , sUserInfo);
  1268. DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(type == 0 ? 2 : type, sUserInfo);
  1269. if (dsGrade != null && dsGrade.Tables.Count > Constant.INT_IS_ZERO)
  1270. {
  1271. actionResult.Result = JsonHelper.ToJson(dsGrade.Tables[0]);
  1272. actionResult.Status = (int)Constant.PDAResult.Success;
  1273. }
  1274. else
  1275. {
  1276. actionResult.Status = (int)Constant.PDAResult.Fail;
  1277. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1278. }
  1279. #endregion
  1280. }
  1281. catch (Exception ex)
  1282. {
  1283. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1284. OutputLog.TraceLog(LogPriority.Error,
  1285. this.ToString(),
  1286. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1287. ex.ToString(),
  1288. LocalPath.LogExePath);
  1289. OutputLog.TraceLog(LogPriority.Error,
  1290. this.ToString(),
  1291. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1292. ex.ToString(),
  1293. LocalPath.LogExePath);
  1294. actionResult.Status = (int)Constant.PDAResult.Exception;
  1295. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1296. }
  1297. return actionResult;
  1298. }
  1299. #endregion
  1300. #region 保存检验条码
  1301. /// <summary>
  1302. /// 保存检验条码
  1303. /// </summary>
  1304. /// <param name="accountCode">帐套code</param>
  1305. /// <param name="userCode">用户code</param>
  1306. /// <param name="userPassword">用户密码</param>
  1307. /// <param name="sessionKey">本次登陆密钥</param>
  1308. /// <param name="procedureID">工序ID</param>
  1309. /// <param name="productionDataEntitys">条码信息</param>
  1310. /// <returns></returns>
  1311. public ActionResult AddCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  1312. {
  1313. ActionResult actionResult = new ActionResult();
  1314. if (productionDataEntitys == null || productionDataEntitys.Length == 0 ||
  1315. string.IsNullOrWhiteSpace(productionDataEntitys[0].Barcode))
  1316. {
  1317. actionResult.Status = (int)Constant.PDAResult.Fail;
  1318. actionResult.Message = "无效条码";
  1319. return actionResult;
  1320. }
  1321. try
  1322. {
  1323. // 验证请求头信息
  1324. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1325. // 验证失败
  1326. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1327. {
  1328. return actionResult;
  1329. }
  1330. //if(productionDataEntitys.Length>0)
  1331. //{
  1332. // if(productionDataEntitys[0].ProductionDataID>0)
  1333. // {
  1334. // productionDataEntitys[0].OPTimeStamp = Convert.ToDateTime(productionDataEntitys[0].OPTimeStampPDA.Replace("-","/"));
  1335. // }
  1336. //}
  1337. string err = ServiceInvoker.Invoke<string>(this,
  1338. //() => PMModuleLogicDAL.AddCheckBarcode(procedureID, productionDataEntitys, sUserInfo));
  1339. () => PMModuleLogicDAL.AddCheckBarcodePDA(procedureID, productionDataEntitys, sUserInfo));
  1340. if (err == null)
  1341. {
  1342. err = "";
  1343. }
  1344. if (err == "DataDouble")
  1345. {
  1346. actionResult.Result = string.Format(Messages.MSG_HR_W006, "成检", "保存");
  1347. actionResult.Status = 2;
  1348. return actionResult;
  1349. }
  1350. else if (!string.IsNullOrEmpty(err))
  1351. {
  1352. actionResult.Result = err;
  1353. actionResult.Message = err;
  1354. actionResult.Status = 666;
  1355. return actionResult;
  1356. }
  1357. //actionResult.Result = JsonHelper.ToJson(err);
  1358. actionResult.Result = err;// JsonHelper.ToJson(err);
  1359. actionResult.Status = (int)Constant.PDAResult.Success;
  1360. }
  1361. catch (Exception ex)
  1362. {
  1363. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1364. OutputLog.TraceLog(LogPriority.Error,
  1365. this.ToString(),
  1366. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1367. ex.ToString(),
  1368. LocalPath.LogExePath);
  1369. actionResult.Status = (int)Constant.PDAResult.Exception;
  1370. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1371. }
  1372. return actionResult;
  1373. }
  1374. /// <summary>
  1375. /// 保存检验条码
  1376. /// </summary>
  1377. /// <param name="accountCode">帐套code</param>
  1378. /// <param name="userCode">用户code</param>
  1379. /// <param name="userPassword">用户密码</param>
  1380. /// <param name="sessionKey">本次登陆密钥</param>
  1381. /// <param name="procedureID">工序ID</param>
  1382. /// <param name="productionDataEntitys">条码信息</param>
  1383. /// <returns></returns>
  1384. public ActionResult AddBarcodeIdnrkScrap(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  1385. {
  1386. ActionResult actionResult = new ActionResult();
  1387. if (productionDataEntitys == null || productionDataEntitys.Length == 0 ||
  1388. string.IsNullOrWhiteSpace(productionDataEntitys[0].Barcode))
  1389. {
  1390. actionResult.Status = (int)Constant.PDAResult.Fail;
  1391. actionResult.Message = "无效条码";
  1392. return actionResult;
  1393. }
  1394. try
  1395. {
  1396. // 验证请求头信息
  1397. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1398. // 验证失败
  1399. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1400. {
  1401. return actionResult;
  1402. }
  1403. string err = ServiceInvoker.Invoke<string>(this,
  1404. () => PMModuleLogicDAL.AddBarcodeIdnrkScrapPDA(procedureID, productionDataEntitys, sUserInfo));
  1405. if (err == null)
  1406. {
  1407. err = "";
  1408. }
  1409. actionResult.Result = err;
  1410. actionResult.Status = (int)Constant.PDAResult.Success;
  1411. }
  1412. catch (Exception ex)
  1413. {
  1414. OutputLog.TraceLog(LogPriority.Error,
  1415. this.ToString(),
  1416. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1417. ex.ToString(),
  1418. LocalPath.LogExePath);
  1419. actionResult.Status = (int)Constant.PDAResult.Exception;
  1420. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1421. }
  1422. return actionResult;
  1423. }
  1424. #endregion
  1425. #region 文件上传下载
  1426. /// <summary>
  1427. /// 软件更新
  1428. /// </summary>
  1429. /// <param name="accountCode">帐套code</param>
  1430. /// <param name="userCode">用户code</param>
  1431. /// <param name="userPassword">用户密码</param>
  1432. /// <param name="sessionKey">本次登陆密钥</param>
  1433. /// <returns></returns>
  1434. public Stream AutoUpgrade(string accountCode, string userCode, string userPassword, string sessionKey)
  1435. {
  1436. try
  1437. {
  1438. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.AutoUpgrade());
  1439. }
  1440. catch (Exception ex)
  1441. {
  1442. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1443. OutputLog.TraceLog(LogPriority.Error,
  1444. this.ToString(),
  1445. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1446. ex.ToString(),
  1447. LocalPath.LogExePath);
  1448. return null;
  1449. }
  1450. }
  1451. /// <summary>
  1452. /// 上传临时文件
  1453. /// </summary>
  1454. /// <param name="imgStream"></param>
  1455. /// <returns></returns>
  1456. public ActionResult SaveImg(Stream mageStream)
  1457. {
  1458. ActionResult actionResult = new ActionResult();
  1459. try
  1460. {
  1461. string err = PDAModuleLogic.SaveImg(mageStream);
  1462. if (err == null)
  1463. {
  1464. err = "";
  1465. }
  1466. actionResult.Result = err;
  1467. actionResult.Status = (int)Constant.PDAResult.Success;
  1468. }
  1469. catch (Exception ex)
  1470. {
  1471. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1472. OutputLog.TraceLog(LogPriority.Error,
  1473. this.ToString(),
  1474. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1475. ex.ToString(),
  1476. LocalPath.LogExePath);
  1477. actionResult.Status = (int)Constant.PDAResult.Exception;
  1478. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1479. }
  1480. return actionResult;
  1481. }
  1482. public Stream GetFileTest(string path)
  1483. {
  1484. return PDAModuleLogic.GetImg(path);
  1485. }
  1486. public Stream GetFileStream()
  1487. {
  1488. FileStream fs = new FileStream("999.apk", FileMode.OpenOrCreate, FileAccess.Read);
  1489. long l = fs.Length;
  1490. return fs;
  1491. }
  1492. public byte[] GetFileTestByte(string path)
  1493. {
  1494. FileStream stream = new FileInfo(path).OpenRead();
  1495. Byte[] buffer = new Byte[stream.Length];
  1496. //从流中读取字节块并将该数据写入给定缓冲区buffer中
  1497. stream.Read(buffer, 0, Convert.ToInt32(stream.Length));
  1498. return buffer;
  1499. }
  1500. public string GetFile(string path)
  1501. {
  1502. string imgFilePath = path;
  1503. System.IO.FileStream fs = new System.IO.FileStream(imgFilePath, System.IO.FileMode.Open);
  1504. int i = (int)fs.Length;
  1505. byte[] content = new byte[i];
  1506. fs.Read(content, 0, i);
  1507. string result = Convert.ToBase64String(content);
  1508. fs.Close();
  1509. FileStream fsTxt = new FileStream("A.txt", FileMode.OpenOrCreate);
  1510. StreamWriter sw = new StreamWriter(fsTxt, System.Text.Encoding.Default);
  1511. sw.Write(result);
  1512. sw.Close();
  1513. fsTxt.Close();
  1514. return result;
  1515. }
  1516. #endregion
  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. /// <remarks>
  1527. /// 陈冰 2014.10.22 新建
  1528. /// </remarks>
  1529. public ActionResult GetReworkProcedureByProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1530. {
  1531. ActionResult actionResult = new ActionResult();
  1532. try
  1533. {
  1534. // 验证请求头信息
  1535. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1536. // 验证失败
  1537. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1538. {
  1539. return actionResult;
  1540. }
  1541. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1542. () => PMModuleLogic.GetReworkProcedureByProcedureID(procedureID));
  1543. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1544. {
  1545. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1546. actionResult.Status = (int)Constant.PDAResult.Success;
  1547. }
  1548. else
  1549. {
  1550. actionResult.Status = (int)Constant.PDAResult.Fail;
  1551. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1552. }
  1553. }
  1554. catch (Exception ex)
  1555. {
  1556. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1557. OutputLog.TraceLog(LogPriority.Error,
  1558. this.ToString(),
  1559. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1560. ex.ToString(),
  1561. LocalPath.LogExePath);
  1562. actionResult.Status = (int)Constant.PDAResult.Exception;
  1563. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1564. }
  1565. return actionResult;
  1566. }
  1567. /// <summary>
  1568. /// 获得产品分级
  1569. /// </summary>
  1570. /// <param name="accountCode">帐套code</param>
  1571. /// <param name="userCode">用户code</param>
  1572. /// <param name="userPassword">用户密码</param>
  1573. /// <param name="sessionKey">本次登陆密钥</param>
  1574. /// <param name="barcode">条码</param>
  1575. /// <returns></returns>
  1576. public ActionResult GetKilnCarByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1577. {
  1578. ActionResult actionResult = new ActionResult();
  1579. try
  1580. {
  1581. // 验证请求头信息
  1582. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1583. // 验证失败
  1584. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1585. {
  1586. return actionResult;
  1587. }
  1588. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1589. () => PMModuleLogic.GetKilnCarByBarCode(barcode));
  1590. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1591. {
  1592. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1593. actionResult.Status = (int)Constant.PDAResult.Success;
  1594. }
  1595. else
  1596. {
  1597. actionResult.Status = (int)Constant.PDAResult.Fail;
  1598. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1599. }
  1600. }
  1601. catch (Exception ex)
  1602. {
  1603. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1604. OutputLog.TraceLog(LogPriority.Error,
  1605. this.ToString(),
  1606. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1607. ex.ToString(),
  1608. LocalPath.LogExePath);
  1609. actionResult.Status = (int)Constant.PDAResult.Exception;
  1610. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1611. }
  1612. return actionResult;
  1613. }
  1614. #region 统计
  1615. /// <summary>
  1616. /// 统计当日计数数量
  1617. /// </summary>
  1618. /// <param name="accountCode">帐套code</param>
  1619. /// <param name="userCode">用户code</param>
  1620. /// <param name="userPassword">用户密码</param>
  1621. /// <param name="sessionKey">本次登陆密钥</param>
  1622. /// <param name="procedureID">工序ID</param>
  1623. /// <returns></returns>
  1624. public ActionResult StatisticsCollectBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1625. {
  1626. ActionResult actionResult = new ActionResult();
  1627. try
  1628. {
  1629. // 验证请求头信息
  1630. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1631. // 验证失败
  1632. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1633. {
  1634. return actionResult;
  1635. }
  1636. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1637. () => PDAModuleLogic.StatisticsCollectBarcode(procedureID, sUserInfo));
  1638. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1639. {
  1640. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1641. actionResult.Status = (int)Constant.PDAResult.Success;
  1642. }
  1643. else
  1644. {
  1645. actionResult.Status = (int)Constant.PDAResult.Fail;
  1646. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1647. }
  1648. }
  1649. catch (Exception ex)
  1650. {
  1651. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1652. OutputLog.TraceLog(LogPriority.Error,
  1653. this.ToString(),
  1654. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1655. ex.ToString(),
  1656. LocalPath.LogExePath);
  1657. actionResult.Status = (int)Constant.PDAResult.Exception;
  1658. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1659. }
  1660. return actionResult;
  1661. }
  1662. /// <summary>
  1663. /// 统计当日计数数量
  1664. /// </summary>
  1665. /// <param name="accountCode">帐套code</param>
  1666. /// <param name="userCode">用户code</param>
  1667. /// <param name="userPassword">用户密码</param>
  1668. /// <param name="sessionKey">本次登陆密钥</param>
  1669. /// <param name="procedureID">工序ID</param>
  1670. /// <returns></returns>
  1671. public ActionResult StatisticsKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1672. {
  1673. ActionResult actionResult = new ActionResult();
  1674. try
  1675. {
  1676. // 验证请求头信息
  1677. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1678. // 验证失败
  1679. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1680. {
  1681. return actionResult;
  1682. }
  1683. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1684. () => PDAModuleLogic.StatisticsKilnCar(procedureID, sUserInfo));
  1685. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1686. {
  1687. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1688. actionResult.Status = (int)Constant.PDAResult.Success;
  1689. }
  1690. else
  1691. {
  1692. actionResult.Status = (int)Constant.PDAResult.Fail;
  1693. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1694. }
  1695. }
  1696. catch (Exception ex)
  1697. {
  1698. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1699. OutputLog.TraceLog(LogPriority.Error,
  1700. this.ToString(),
  1701. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1702. ex.ToString(),
  1703. LocalPath.LogExePath);
  1704. actionResult.Status = (int)Constant.PDAResult.Exception;
  1705. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1706. }
  1707. return actionResult;
  1708. }
  1709. /// <summary>
  1710. /// 统计产品跟踪
  1711. /// </summary>
  1712. /// <param name="accountCode">帐套code</param>
  1713. /// <param name="userCode">用户code</param>
  1714. /// <param name="userPassword">用户密码</param>
  1715. /// <param name="sessionKey">本次登陆密钥</param>
  1716. /// <param name="procedureID">工序ID</param>
  1717. /// <returns></returns>
  1718. public ActionResult StatisticsProductTrack(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1719. {
  1720. ActionResult actionResult = new ActionResult();
  1721. try
  1722. {
  1723. // 验证请求头信息
  1724. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1725. // 验证失败
  1726. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1727. {
  1728. return actionResult;
  1729. }
  1730. RPT020101_SE se = new RPT020101_SE();
  1731. se.Barcode = barcode;
  1732. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  1733. () => Dongke.IBOSS.PRD.Service.ReportModuleLogic.ReportModuleLogic.GetRPT020101SData(sUserInfo, se));
  1734. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  1735. {
  1736. actionResult.Status = (int)Constant.PDAResult.Fail;
  1737. actionResult.Message = Messages.MSG_CMN_I002;
  1738. }
  1739. else
  1740. {
  1741. actionResult.Result = JsonHelper.ToJson(sre.Data);
  1742. actionResult.Status = (int)Constant.PDAResult.Success;
  1743. }
  1744. //ProductionDataEntity productionDataEntity = ServiceInvoker.Invoke<ProductionDataEntity>(this,
  1745. // () => PDAModuleLogic.StatisticsProductTrack(barcode, sUserInfo));
  1746. //if (productionDataEntity != null)
  1747. //{
  1748. // actionResult.Result = JsonHelper.ToJson(productionDataEntity);
  1749. // actionResult.Status = (int)Constant.PDAResult.Success;
  1750. //}
  1751. //else
  1752. //{
  1753. // actionResult.Status = (int)Constant.PDAResult.Fail;
  1754. // actionResult.Message = Messages.MSG_CMN_I002;
  1755. //}
  1756. }
  1757. catch (Exception ex)
  1758. {
  1759. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1760. OutputLog.TraceLog(LogPriority.Error,
  1761. this.ToString(),
  1762. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1763. ex.ToString() + ex.HelpLink,
  1764. LocalPath.LogExePath);
  1765. actionResult.Status = (int)Constant.PDAResult.Exception;
  1766. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1767. }
  1768. return actionResult;
  1769. }
  1770. #endregion
  1771. #region 撤销装车及成检
  1772. /// <summary>
  1773. /// 检验条码是否可以撤销装车
  1774. /// </summary>
  1775. /// <param name="accountCode">帐套code</param>
  1776. /// <param name="userCode">用户code</param>
  1777. /// <param name="userPassword">用户密码</param>
  1778. /// <param name="sessionKey">本次登陆密钥</param>
  1779. /// <param name="procedureID">当前工序ID</param>
  1780. /// <param name="barcode">条码</param>
  1781. /// <returns></returns>
  1782. public ActionResult CheckCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1783. {
  1784. ActionResult actionResult = new ActionResult();
  1785. try
  1786. {
  1787. // 验证请求头信息
  1788. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1789. // 验证失败
  1790. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1791. {
  1792. return actionResult;
  1793. }
  1794. CheckCancelLoadCar checkCancelLoadCar = ServiceInvoker.Invoke<CheckCancelLoadCar>(this,
  1795. () => PMModuleLogic.CheckCancelLoadCar(procedureID, barcode, sUserInfo));
  1796. actionResult.Result = JsonHelper.ToJson(checkCancelLoadCar);
  1797. actionResult.Status = (int)Constant.PDAResult.Success;
  1798. }
  1799. catch (Exception ex)
  1800. {
  1801. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1802. OutputLog.TraceLog(LogPriority.Error,
  1803. this.ToString(),
  1804. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1805. ex.ToString(),
  1806. LocalPath.LogExePath);
  1807. actionResult.Status = (int)Constant.PDAResult.Exception;
  1808. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1809. }
  1810. return actionResult;
  1811. }
  1812. /// <summary>
  1813. /// 保存撤销装车的条码
  1814. /// </summary>
  1815. /// <param name="accountCode">帐套code</param>
  1816. /// <param name="userCode">用户code</param>
  1817. /// <param name="userPassword">用户密码</param>
  1818. /// <param name="sessionKey">本次登陆密钥</param>
  1819. /// <param name="procedureID">当前工序ID</param>
  1820. /// <param name="barcode">条码</param>
  1821. /// <returns></returns>
  1822. public ActionResult AddCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1823. {
  1824. ActionResult actionResult = new ActionResult();
  1825. try
  1826. {
  1827. // 验证请求头信息
  1828. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1829. // 验证失败
  1830. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1831. {
  1832. return actionResult;
  1833. }
  1834. string err = ServiceInvoker.Invoke<string>(this,
  1835. () => PMModuleLogicDAL.AddCancelLoadCar(procedureID, barcode, sUserInfo));
  1836. if (err == null)
  1837. {
  1838. err = "";
  1839. }
  1840. actionResult.Result = JsonHelper.ToJson(err);
  1841. actionResult.Status = (int)Constant.PDAResult.Success;
  1842. }
  1843. catch (Exception ex)
  1844. {
  1845. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1846. OutputLog.TraceLog(LogPriority.Error,
  1847. this.ToString(),
  1848. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1849. ex.ToString(),
  1850. LocalPath.LogExePath);
  1851. actionResult.Status = (int)Constant.PDAResult.Exception;
  1852. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1853. }
  1854. return actionResult;
  1855. }
  1856. /// <summary>
  1857. /// 由产品条码获取注浆信息
  1858. /// </summary>
  1859. /// <param name="barcode"></param>
  1860. /// <returns></returns>
  1861. public ActionResult GetGroutingProducttByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1862. {
  1863. ActionResult actionResult = new ActionResult();
  1864. try
  1865. {
  1866. // 验证请求头信息
  1867. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1868. // 验证失败
  1869. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1870. {
  1871. return actionResult;
  1872. }
  1873. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1874. () => PDAModuleLogic.GetGroutingProducttByBarCode(barcode));
  1875. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1876. {
  1877. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1878. actionResult.Status = (int)Constant.PDAResult.Success;
  1879. }
  1880. else
  1881. {
  1882. actionResult.Status = (int)Constant.PDAResult.Fail;
  1883. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1884. }
  1885. }
  1886. catch (Exception ex)
  1887. {
  1888. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1889. OutputLog.TraceLog(LogPriority.Error,
  1890. this.ToString(),
  1891. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1892. ex.ToString(),
  1893. LocalPath.LogExePath);
  1894. actionResult.Status = (int)Constant.PDAResult.Exception;
  1895. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1896. }
  1897. return actionResult;
  1898. }
  1899. /// <summary>
  1900. /// 获取工号下的所有工种信息
  1901. /// </summary>
  1902. /// <param name="UserID">工号ID</param>
  1903. /// <returns></returns>
  1904. public ActionResult GetAllJobsByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int UserID)
  1905. {
  1906. ActionResult actionResult = new ActionResult();
  1907. try
  1908. {
  1909. // 验证请求头信息
  1910. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1911. // 验证失败
  1912. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1913. {
  1914. return actionResult;
  1915. }
  1916. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1917. () => PDAModuleLogic.GetAllJobsByUserID(UserID, sUserInfo));
  1918. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1919. {
  1920. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1921. actionResult.Status = (int)Constant.PDAResult.Success;
  1922. }
  1923. else
  1924. {
  1925. actionResult.Status = (int)Constant.PDAResult.Fail;
  1926. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1927. }
  1928. }
  1929. catch (Exception ex)
  1930. {
  1931. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1932. OutputLog.TraceLog(LogPriority.Error,
  1933. this.ToString(),
  1934. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1935. ex.ToString(),
  1936. LocalPath.LogExePath);
  1937. actionResult.Status = (int)Constant.PDAResult.Exception;
  1938. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1939. }
  1940. return actionResult;
  1941. }
  1942. /// <summary>
  1943. /// 根据所选工号对应的工种,查出缺陷责任员工
  1944. /// </summary>
  1945. /// <param name="jobs">工种ID</param>
  1946. /// <returns></returns>
  1947. public ActionResult GetDutyStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs)
  1948. {
  1949. ActionResult actionResult = new ActionResult();
  1950. try
  1951. {
  1952. // 验证请求头信息
  1953. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1954. // 验证失败
  1955. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1956. {
  1957. return actionResult;
  1958. }
  1959. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1960. () => PDAModuleLogic.GetDutyStaffByUserID(jobs, sUserInfo));
  1961. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1962. {
  1963. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1964. actionResult.Status = (int)Constant.PDAResult.Success;
  1965. }
  1966. else
  1967. {
  1968. actionResult.Status = (int)Constant.PDAResult.Fail;
  1969. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1970. }
  1971. }
  1972. catch (Exception ex)
  1973. {
  1974. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1975. OutputLog.TraceLog(LogPriority.Error,
  1976. this.ToString(),
  1977. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1978. ex.ToString(),
  1979. LocalPath.LogExePath);
  1980. actionResult.Status = (int)Constant.PDAResult.Exception;
  1981. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1982. }
  1983. return actionResult;
  1984. }
  1985. /// <summary>
  1986. /// 根据所选工号,查出漏检责任员工
  1987. /// </summary>
  1988. /// <param name="userid">工号</param>
  1989. /// <returns></returns>
  1990. public ActionResult GetMissedStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  1991. {
  1992. ActionResult actionResult = new ActionResult();
  1993. try
  1994. {
  1995. // 验证请求头信息
  1996. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1997. // 验证失败
  1998. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1999. {
  2000. return actionResult;
  2001. }
  2002. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2003. () => PDAModuleLogic.GetMissedStaffByUserID(userid, sUserInfo));
  2004. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2005. {
  2006. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2007. actionResult.Status = (int)Constant.PDAResult.Success;
  2008. }
  2009. else
  2010. {
  2011. actionResult.Status = (int)Constant.PDAResult.Fail;
  2012. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2013. }
  2014. }
  2015. catch (Exception ex)
  2016. {
  2017. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2018. OutputLog.TraceLog(LogPriority.Error,
  2019. this.ToString(),
  2020. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2021. ex.ToString(),
  2022. LocalPath.LogExePath);
  2023. actionResult.Status = (int)Constant.PDAResult.Exception;
  2024. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2025. }
  2026. return actionResult;
  2027. }
  2028. /// <summary>
  2029. /// 获取用户列表
  2030. /// </summary>
  2031. /// <param name="requestEntity">用户实体</param>
  2032. /// <returns></returns>
  2033. public ActionResult SearchUserData(string accountCode, string userCode, string userPassword, string sessionKey, byte IsWorker)
  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. SUserEntity requestEntity = new SUserEntity();
  2046. requestEntity.IsWorker = IsWorker;
  2047. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2048. () => PDAModuleLogic.SearchUserData(requestEntity, sUserInfo));
  2049. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2050. {
  2051. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2052. actionResult.Status = (int)Constant.PDAResult.Success;
  2053. }
  2054. else
  2055. {
  2056. actionResult.Status = (int)Constant.PDAResult.Fail;
  2057. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2058. }
  2059. }
  2060. catch (Exception ex)
  2061. {
  2062. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2063. OutputLog.TraceLog(LogPriority.Error,
  2064. this.ToString(),
  2065. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2066. ex.ToString(),
  2067. LocalPath.LogExePath);
  2068. actionResult.Status = (int)Constant.PDAResult.Exception;
  2069. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2070. }
  2071. return actionResult;
  2072. }
  2073. /// <summary>
  2074. /// 获取数据字典管理的数据
  2075. /// </summary>
  2076. /// <param name="Pvalue">显示停用标识</param>
  2077. /// <param name="dictionaryType">字典类别</param>
  2078. /// <returns></returns>
  2079. /// <remarks>
  2080. /// 2014.12.03 新建
  2081. /// </remarks>
  2082. public ActionResult GetDictionaryData(string accountCode, string userCode, string userPassword, string sessionKey, byte Pvalue, string dictionaryType)
  2083. {
  2084. ActionResult actionResult = new ActionResult();
  2085. try
  2086. {
  2087. // 验证请求头信息
  2088. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2089. // 验证失败
  2090. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2091. {
  2092. return actionResult;
  2093. }
  2094. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2095. () => PDAModuleLogic.GetDictionaryData(Pvalue, dictionaryType, sUserInfo));
  2096. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2097. {
  2098. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2099. actionResult.Status = (int)Constant.PDAResult.Success;
  2100. }
  2101. else
  2102. {
  2103. actionResult.Status = (int)Constant.PDAResult.Fail;
  2104. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2105. }
  2106. }
  2107. catch (Exception ex)
  2108. {
  2109. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2110. OutputLog.TraceLog(LogPriority.Error,
  2111. this.ToString(),
  2112. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2113. ex.ToString(),
  2114. LocalPath.LogExePath);
  2115. actionResult.Status = (int)Constant.PDAResult.Exception;
  2116. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2117. }
  2118. return actionResult;
  2119. }
  2120. #endregion
  2121. #region 保存半检数据
  2122. /// <summary>
  2123. /// 保存半检数据
  2124. /// </summary>
  2125. /// <param name="accountCode">帐套code</param>
  2126. /// <param name="userCode">用户code</param>
  2127. /// <param name="userPassword">用户密码</param>
  2128. /// <param name="sessionKey">本次登陆密钥</param>
  2129. /// <param name="productionDataEntitys">半检信息</param>
  2130. /// <returns></returns>
  2131. public ActionResult AddSemiTest(string accountCode, string userCode, string userPassword, string sessionKey, SemiTestEntity[] semiTestEntitys)
  2132. {
  2133. ActionResult actionResult = new ActionResult();
  2134. try
  2135. {
  2136. // 验证请求头信息
  2137. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2138. // 验证失败
  2139. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2140. {
  2141. return actionResult;
  2142. }
  2143. string err = ServiceInvoker.Invoke<string>(this,
  2144. () => PMModuleLogicDAL.AddSemiTest(semiTestEntitys, sUserInfo));
  2145. if (err == null)
  2146. {
  2147. err = "";
  2148. }
  2149. actionResult.Result = JsonHelper.ToJson(err);
  2150. actionResult.Status = (int)Constant.PDAResult.Success;
  2151. }
  2152. catch (Exception ex)
  2153. {
  2154. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2155. OutputLog.TraceLog(LogPriority.Error,
  2156. this.ToString(),
  2157. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2158. ex.ToString(),
  2159. LocalPath.LogExePath);
  2160. actionResult.Status = (int)Constant.PDAResult.Exception;
  2161. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2162. }
  2163. return actionResult;
  2164. }
  2165. #endregion
  2166. /// <summary>
  2167. /// 获取产品列表
  2168. /// </summary>
  2169. /// <returns></returns>
  2170. public ActionResult SerachGoods(string accountCode, string userCode, string userPassword, string sessionKey, int valueFlag)
  2171. {
  2172. ActionResult actionResult = new ActionResult();
  2173. try
  2174. {
  2175. // 验证请求头信息
  2176. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2177. // 验证失败
  2178. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2179. {
  2180. return actionResult;
  2181. }
  2182. GoodsEntity goodsEntity = new GoodsEntity();
  2183. goodsEntity.ValueFlag = 1;//有效标记
  2184. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2185. () => PDAModuleLogic.SerachGoods(sUserInfo, goodsEntity));
  2186. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2187. {
  2188. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2189. actionResult.Status = (int)Constant.PDAResult.Success;
  2190. }
  2191. else
  2192. {
  2193. actionResult.Status = (int)Constant.PDAResult.Fail;
  2194. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2195. }
  2196. }
  2197. catch (Exception ex)
  2198. {
  2199. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2200. OutputLog.TraceLog(LogPriority.Error,
  2201. this.ToString(),
  2202. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2203. ex.ToString(),
  2204. LocalPath.LogExePath);
  2205. actionResult.Status = (int)Constant.PDAResult.Exception;
  2206. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2207. }
  2208. return actionResult;
  2209. }
  2210. /// <summary>
  2211. /// 使用存储过程PRO_PM_GetProductionData获取生产工序计件数据
  2212. /// </summary>
  2213. /// <param name="searchEntity">生产数据实体类</param>
  2214. /// <returns>DataTable</returns>
  2215. public ActionResult GetProductionData(string accountCode, string userCode, string userPassword, string sessionKey, int ProcedureID, string BarCode)
  2216. {
  2217. ActionResult actionResult = new ActionResult();
  2218. try
  2219. {
  2220. // 验证请求头信息
  2221. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2222. // 验证失败
  2223. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2224. {
  2225. return actionResult;
  2226. }
  2227. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2228. searchEntity.ProcedureID = ProcedureID;
  2229. searchEntity.BarCode = BarCode;
  2230. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2231. () => PDAModuleLogic.GetProductionData(searchEntity, sUserInfo));
  2232. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2233. {
  2234. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2235. actionResult.Status = (int)Constant.PDAResult.Success;
  2236. }
  2237. else
  2238. {
  2239. actionResult.Status = (int)Constant.PDAResult.Fail;
  2240. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2241. }
  2242. }
  2243. catch (Exception ex)
  2244. {
  2245. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2246. OutputLog.TraceLog(LogPriority.Error,
  2247. this.ToString(),
  2248. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2249. ex.ToString(),
  2250. LocalPath.LogExePath);
  2251. actionResult.Status = (int)Constant.PDAResult.Exception;
  2252. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2253. }
  2254. return actionResult;
  2255. }
  2256. /// <summary>
  2257. /// xuwei add 2020-03-23 此方法用于成检后 回收 再次成检 获取正确ID
  2258. /// </summary>
  2259. /// <param name="searchEntity">生产数据实体类</param>
  2260. /// <returns>DataTable</returns>
  2261. public ActionResult GetProductionDataCheckID(string accountCode, string userCode, string userPassword, string sessionKey, string BarCode)
  2262. {
  2263. ActionResult actionResult = new ActionResult();
  2264. try
  2265. {
  2266. // 验证请求头信息
  2267. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2268. // 验证失败
  2269. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2270. {
  2271. return actionResult;
  2272. }
  2273. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2274. searchEntity.BarCode = BarCode;
  2275. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2276. () => PDAModuleLogic.GetProductionDataCheckID(searchEntity, sUserInfo));
  2277. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2278. {
  2279. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2280. actionResult.Status = (int)Constant.PDAResult.Success;
  2281. }
  2282. else
  2283. {
  2284. actionResult.Status = (int)Constant.PDAResult.Fail;
  2285. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2286. }
  2287. }
  2288. catch (Exception ex)
  2289. {
  2290. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2291. OutputLog.TraceLog(LogPriority.Error,
  2292. this.ToString(),
  2293. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2294. ex.ToString(),
  2295. LocalPath.LogExePath);
  2296. actionResult.Status = (int)Constant.PDAResult.Exception;
  2297. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2298. }
  2299. return actionResult;
  2300. }
  2301. /// <summary>
  2302. /// 根据所选生产数据ID,显示成检数据信息
  2303. /// </summary>
  2304. /// <param name="productionDataID">生产数据ID</param>
  2305. /// <returns>DataSet</returns>
  2306. public ActionResult GetProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2307. {
  2308. ActionResult actionResult = new ActionResult();
  2309. try
  2310. {
  2311. // 验证请求头信息
  2312. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2313. // 验证失败
  2314. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2315. {
  2316. return actionResult;
  2317. }
  2318. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2319. () => PDAModuleLogic.GetProductionDataByID(productionDataID));
  2320. PDAProductionDataResult productionDatas = new PDAProductionDataResult();
  2321. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2322. {
  2323. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  2324. {
  2325. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  2326. {
  2327. PDAProductionDataResult productionData = new PDAProductionDataResult();
  2328. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2329. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  2330. {
  2331. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  2332. }
  2333. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  2334. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  2335. if (reworkDs.Tables[0].Rows[0]["DefectFlagID"].ToString() != "")
  2336. {
  2337. productionData.DefectFlagID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["DefectFlagID"].ToString());
  2338. }
  2339. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  2340. {
  2341. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  2342. }
  2343. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  2344. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  2345. {
  2346. productionData.UserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  2347. }
  2348. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  2349. {
  2350. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  2351. }
  2352. productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  2353. productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  2354. productionData.SpecialRepairflag = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SpecialRepairflag"]);
  2355. productionData.IsReFire = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsReFire"]);
  2356. productionData.KilnCarCode = reworkDs.Tables[0].Rows[i]["KilnCarCode"].ToString();
  2357. productionData.KilnCode = reworkDs.Tables[0].Rows[i]["KilnCode"].ToString();
  2358. productionData.GlazeName = reworkDs.Tables[0].Rows[i]["GlazeName"].ToString();
  2359. productionData.LeakFlag1 = reworkDs.Tables[0].Rows[i]["LeakFlag1"].ToString();
  2360. productionData.LeakFlag2 = reworkDs.Tables[0].Rows[i]["LeakFlag2"].ToString();
  2361. productionData.LeakFlag3 = reworkDs.Tables[0].Rows[i]["LeakFlag3"].ToString();
  2362. productionData.SpecialRepairFlagName = reworkDs.Tables[0].Rows[i]["specialRepairFlagName"].ToString();
  2363. productionData.IsReFireName = reworkDs.Tables[0].Rows[i]["isReFireName"].ToString();
  2364. productionData.LeakFlag1Name = reworkDs.Tables[0].Rows[i]["LeakFlag1Name"].ToString();
  2365. productionData.LeakFlag2Name = reworkDs.Tables[0].Rows[i]["LeakFlag2Name"].ToString();
  2366. productionData.LeakFlag3Name = reworkDs.Tables[0].Rows[i]["LeakFlag3Name"].ToString();
  2367. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  2368. {
  2369. productionData.LogoID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["logoid"]);
  2370. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  2371. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  2372. }
  2373. productionData.CreateTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CreateTime"]);
  2374. if (reworkDs.Tables[0].Rows[i]["CheckTime"].ToString() != "")
  2375. {
  2376. productionData.CheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CheckTime"].ToString());
  2377. }
  2378. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  2379. dvDefect.RowFilter = "BarCode=" + reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2380. DataTable dtDefect = dvDefect.ToTable();
  2381. for (int row = 0; row < dtDefect.Rows.Count; row++)
  2382. {
  2383. // 产品缺陷
  2384. PDADefectResult defect = new PDADefectResult();
  2385. defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  2386. defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  2387. if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  2388. {
  2389. defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  2390. }
  2391. defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  2392. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  2393. {
  2394. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  2395. }
  2396. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  2397. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  2398. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  2399. {
  2400. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  2401. }
  2402. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  2403. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  2404. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  2405. {
  2406. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  2407. }
  2408. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  2409. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  2410. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  2411. {
  2412. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  2413. }
  2414. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  2415. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  2416. if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  2417. {
  2418. defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  2419. }
  2420. if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  2421. {
  2422. defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  2423. }
  2424. defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  2425. defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  2426. defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  2427. defect.DefectRemarks = dtDefect.Rows[row]["DefectRemarks"].ToString();
  2428. if (dtDefect.Rows[row]["ProductionDataID"].ToString() != "")
  2429. {
  2430. defect.ProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDataID"].ToString());
  2431. }
  2432. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  2433. {
  2434. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  2435. }
  2436. if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  2437. {
  2438. defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  2439. }
  2440. defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  2441. defect.CheckTime = Convert.ToDateTime(dtDefect.Rows[row]["CheckTime"]);
  2442. //--------责任员工-------------------
  2443. DataRow[] drRow = reworkDs.Tables[2].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2444. if (drRow.Length > Constant.INT_IS_ZERO)
  2445. {
  2446. foreach (DataRow r in drRow)
  2447. {
  2448. PDADefectResponsibleResult defectResponsible = new PDADefectResponsibleResult();
  2449. if (r["ProductionDefectID"].ToString() != "")
  2450. {
  2451. defectResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2452. }
  2453. if (r["StaffID"].ToString() != "")
  2454. {
  2455. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2456. }
  2457. defectResponsible.StaffCode = r["StaffCode"].ToString();
  2458. defectResponsible.StaffName = r["StaffName"].ToString();
  2459. if (r["StaffStatus"].ToString() != "")
  2460. {
  2461. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2462. }
  2463. if (r["UJobsID"].ToString() != "")
  2464. {
  2465. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2466. }
  2467. if (r["SJobsID"].ToString() != "")
  2468. {
  2469. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2470. }
  2471. defect.PDADefectResponsibles.Add(defectResponsible);
  2472. }
  2473. }
  2474. //------------------------------
  2475. //--------漏检员工-------------------
  2476. DataRow[] drMissedRow = reworkDs.Tables[4].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[i]["ProductionDefectID"]);
  2477. if (drMissedRow.Length > Constant.INT_IS_ZERO)
  2478. {
  2479. foreach (DataRow r in drMissedRow)
  2480. {
  2481. PDADefectMissedResponsibleResult defectMissedResponsible = new PDADefectMissedResponsibleResult();
  2482. if (r["ProductionDefectID"].ToString() != "")
  2483. {
  2484. defectMissedResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2485. }
  2486. if (r["StaffID"].ToString() != "")
  2487. {
  2488. defectMissedResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2489. }
  2490. defectMissedResponsible.StaffCode = r["StaffCode"].ToString();
  2491. defectMissedResponsible.StaffName = r["StaffName"].ToString();
  2492. if (r["StaffStatus"].ToString() != "")
  2493. {
  2494. defectMissedResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2495. }
  2496. if (r["UJobsID"].ToString() != "")
  2497. {
  2498. defectMissedResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2499. }
  2500. if (r["SJobsID"].ToString() != "")
  2501. {
  2502. defectMissedResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2503. }
  2504. defect.PDADefectMissedResponsibles.Add(defectMissedResponsible);
  2505. }
  2506. }
  2507. //------------------------------
  2508. DataRow[] drImageRow = reworkDs.Tables[3].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2509. if (drImageRow.Length > Constant.INT_IS_ZERO)
  2510. {
  2511. foreach (DataRow r in drImageRow)
  2512. {
  2513. PDADefectImageResult defectImage = new PDADefectImageResult();
  2514. if (r["ProductionDefectID"].ToString() != "")
  2515. {
  2516. defectImage.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2517. }
  2518. defectImage.Thumbnailpath = r["Thumbnailpath"].ToString();
  2519. //if (File.Exists(System.AppDomain.CurrentDomain.BaseDirectory + r["Imagepath"].ToString()))
  2520. //{
  2521. defectImage.Imagepath = r["Imagepath"].ToString();// r["Imagepath"].ToString();
  2522. //}
  2523. defect.PDADefectImageResults.Add(defectImage);
  2524. }
  2525. }
  2526. productionData.PDADefects.Add(defect);
  2527. }
  2528. if (productionDatas.PDAProductionData == null)
  2529. {
  2530. productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  2531. }
  2532. productionDatas.PDAProductionData.Add(productionData);
  2533. //---------------------------------------------------------------------------------
  2534. }
  2535. }
  2536. actionResult.Result = JsonHelper.ToJson(productionDatas);
  2537. actionResult.Status = (int)Constant.PDAResult.Success;
  2538. }
  2539. else
  2540. {
  2541. actionResult.Status = (int)Constant.PDAResult.Fail;
  2542. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2543. }
  2544. }
  2545. catch (Exception ex)
  2546. {
  2547. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2548. OutputLog.TraceLog(LogPriority.Error,
  2549. this.ToString(),
  2550. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2551. ex.ToString(),
  2552. LocalPath.LogExePath);
  2553. actionResult.Status = (int)Constant.PDAResult.Exception;
  2554. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2555. }
  2556. return actionResult;
  2557. }
  2558. /// <summary>
  2559. /// 编辑后删除生产数据
  2560. /// </summary>
  2561. /// <param name="productionDataID">生产数据ID</param>
  2562. /// <returns>int</returns>
  2563. public ActionResult DeleteProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2564. {
  2565. ActionResult actionResult = new ActionResult();
  2566. try
  2567. {
  2568. // 验证请求头信息
  2569. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2570. // 验证失败
  2571. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2572. {
  2573. return actionResult;
  2574. }
  2575. int row = ServiceInvoker.Invoke<int>(this,
  2576. () => PMModuleLogic.DeleteProductionDataByID(productionDataID));
  2577. actionResult.Result = JsonHelper.ToJson(row);
  2578. actionResult.Status = (int)Constant.PDAResult.Success;
  2579. }
  2580. catch (Exception ex)
  2581. {
  2582. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2583. OutputLog.TraceLog(LogPriority.Error,
  2584. this.ToString(),
  2585. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2586. ex.ToString(),
  2587. LocalPath.LogExePath);
  2588. actionResult.Status = (int)Constant.PDAResult.Exception;
  2589. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2590. }
  2591. return actionResult;
  2592. }
  2593. /// <summary>
  2594. /// 获取产品完成工序的ID
  2595. /// </summary>
  2596. /// <param name="barcode">产品条码</param>
  2597. /// <returns>int</returns>
  2598. public ActionResult GetCompleteProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  2599. {
  2600. ActionResult actionResult = new ActionResult();
  2601. try
  2602. {
  2603. // 验证请求头信息
  2604. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2605. // 验证失败
  2606. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2607. {
  2608. return actionResult;
  2609. }
  2610. int row = ServiceInvoker.Invoke<int>(this,
  2611. () => PMModuleLogic.GetCompleteProcedureID(barcode));
  2612. actionResult.Result = JsonHelper.ToJson(row);
  2613. actionResult.Status = (int)Constant.PDAResult.Success;
  2614. }
  2615. catch (Exception ex)
  2616. {
  2617. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2618. OutputLog.TraceLog(LogPriority.Error,
  2619. this.ToString(),
  2620. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2621. ex.ToString(),
  2622. LocalPath.LogExePath);
  2623. actionResult.Status = (int)Constant.PDAResult.Exception;
  2624. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2625. }
  2626. return actionResult;
  2627. }
  2628. /// <summary>
  2629. /// 绑定图片
  2630. /// </summary>
  2631. /// <param name="accountCode">帐套code</param>
  2632. /// <param name="userCode">用户code</param>
  2633. /// <param name="userPassword">用户密码</param>
  2634. /// <param name="sessionKey">本次登陆密钥</param>
  2635. /// <param name="imagePath">图片路径</param>
  2636. /// <returns></returns>
  2637. public Stream BindDefectImage(string accountCode, string userCode, string userPassword, string sessionKey, string imagePath)
  2638. {
  2639. try
  2640. {
  2641. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.BindDefectImage(imagePath));
  2642. }
  2643. catch (Exception ex)
  2644. {
  2645. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2646. OutputLog.TraceLog(LogPriority.Error,
  2647. this.ToString(),
  2648. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2649. ex.ToString(),
  2650. LocalPath.LogExePath);
  2651. return null;
  2652. }
  2653. }
  2654. /// <summary>
  2655. /// 根据所选工号对应的工种,查出缺陷责任员工
  2656. /// </summary>
  2657. /// <param name="jobs">工种ID</param>
  2658. /// <returns></returns>
  2659. public ActionResult GetDutyStaffByUserJobsID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs, int userid)
  2660. {
  2661. ActionResult actionResult = new ActionResult();
  2662. try
  2663. {
  2664. // 验证请求头信息
  2665. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2666. // 验证失败
  2667. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2668. {
  2669. return actionResult;
  2670. }
  2671. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2672. () => PDAModuleLogic.GetDutyStaffByUserJobsID(jobs, sUserInfo, userid));
  2673. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2674. {
  2675. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2676. actionResult.Status = (int)Constant.PDAResult.Success;
  2677. }
  2678. else
  2679. {
  2680. actionResult.Status = (int)Constant.PDAResult.Fail;
  2681. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2682. }
  2683. }
  2684. catch (Exception ex)
  2685. {
  2686. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2687. OutputLog.TraceLog(LogPriority.Error,
  2688. this.ToString(),
  2689. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2690. ex.ToString(),
  2691. LocalPath.LogExePath);
  2692. actionResult.Status = (int)Constant.PDAResult.Exception;
  2693. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2694. }
  2695. return actionResult;
  2696. }
  2697. #region 产品报废
  2698. /// <summary>
  2699. /// 验证废弃产品唯一性
  2700. /// </summary>
  2701. /// <param name="barcode">产品条码</param>
  2702. /// <returns>int</returns>
  2703. public ActionResult ScrapProductChack(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2704. {
  2705. ActionResult actionResult = new ActionResult();
  2706. try
  2707. {
  2708. // 验证请求头信息
  2709. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2710. // 验证失败
  2711. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2712. {
  2713. return actionResult;
  2714. }
  2715. string row = ServiceInvoker.Invoke<string>(this,
  2716. () => PDAModuleLogic.ScrapProductChack(barCode, sUserInfo));
  2717. string[] rm = row.Split(':');
  2718. actionResult.Result = rm[0];//JsonHelper.ToJson(rm[0]);
  2719. if (rm.Length > 1)
  2720. {
  2721. actionResult.Message = rm[1];
  2722. }
  2723. actionResult.Status = (int)Constant.PDAResult.Success;
  2724. }
  2725. catch (Exception ex)
  2726. {
  2727. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2728. OutputLog.TraceLog(LogPriority.Error,
  2729. this.ToString(),
  2730. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2731. ex.ToString(),
  2732. LocalPath.LogExePath);
  2733. actionResult.Status = (int)Constant.PDAResult.Exception;
  2734. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2735. }
  2736. return actionResult;
  2737. }
  2738. /// <summary>
  2739. /// 根据条码获取该产品的在产信息以及生产数据
  2740. /// </summary>
  2741. /// <param name="Barcode">产品条码</param>
  2742. /// <returns>装有两个DataTable的数据集,第一个是在产信息,第二个是生产数据</returns>
  2743. public ActionResult GetInProductionAndProductionData(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2744. {
  2745. ActionResult actionResult = new ActionResult();
  2746. try
  2747. {
  2748. // 验证请求头信息
  2749. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2750. // 验证失败
  2751. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2752. {
  2753. return actionResult;
  2754. }
  2755. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2756. () => PDAModuleLogic.GetInProductionAndProductionData(barCode, sUserInfo));
  2757. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2758. {
  2759. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2760. actionResult.Status = (int)Constant.PDAResult.Success;
  2761. }
  2762. else
  2763. {
  2764. actionResult.Status = (int)Constant.PDAResult.Fail;
  2765. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2766. }
  2767. }
  2768. catch (Exception ex)
  2769. {
  2770. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2771. OutputLog.TraceLog(LogPriority.Error,
  2772. this.ToString(),
  2773. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2774. ex.ToString(),
  2775. LocalPath.LogExePath);
  2776. actionResult.Status = (int)Constant.PDAResult.Exception;
  2777. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2778. }
  2779. return actionResult;
  2780. }
  2781. /// <summary>
  2782. /// 根据工号查询员工档案信息
  2783. /// </summary>
  2784. /// <param name="accountCode"></param>
  2785. /// <param name="userCode"></param>
  2786. /// <param name="userPassword"></param>
  2787. /// <param name="sessionKey"></param>
  2788. /// <param name="userId"></param>
  2789. /// <returns></returns>
  2790. public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  2791. {
  2792. ActionResult actionResult = new ActionResult();
  2793. try
  2794. {
  2795. // 验证请求头信息
  2796. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2797. // 验证失败
  2798. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2799. {
  2800. return actionResult;
  2801. }
  2802. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2803. () => PDAModuleLogic.SearchHrStaffInfo(userId, sUserInfo));
  2804. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2805. {
  2806. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2807. actionResult.Status = (int)Constant.PDAResult.Success;
  2808. }
  2809. else
  2810. {
  2811. actionResult.Status = (int)Constant.PDAResult.Fail;
  2812. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2813. }
  2814. }
  2815. catch (Exception ex)
  2816. {
  2817. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2818. OutputLog.TraceLog(LogPriority.Error,
  2819. this.ToString(),
  2820. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2821. ex.ToString(),
  2822. LocalPath.LogExePath);
  2823. actionResult.Status = (int)Constant.PDAResult.Exception;
  2824. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2825. }
  2826. return actionResult;
  2827. }
  2828. /// <summary>
  2829. /// 添加废弃产品记录
  2830. /// </summary>
  2831. /// <param name="SProductEntity">废弃产品实体</param>
  2832. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  2833. /// <param name="SResponsibleList">责任者集合</param>
  2834. /// <param name="userInfo">用户基本信息</param>
  2835. /// <returns>int结果返回值</returns>
  2836. /// <remarks>
  2837. /// 庄天威 2014.09.24 新建
  2838. /// </remarks>
  2839. public ActionResult AddScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey,
  2840. ScrapProductEntity SProductEntity, ResponProcedureEntity RProcedureEntity,
  2841. ScrapResponsibleEntity[] SResponsibleList)
  2842. {
  2843. ActionResult actionResult = new ActionResult();
  2844. if (SResponsibleList == null || SResponsibleList.Length == 0)
  2845. {
  2846. actionResult.Status = (int)Constant.PDAResult.Fail;
  2847. actionResult.Message = "没有选择责任人";
  2848. }
  2849. try
  2850. {
  2851. // 验证请求头信息
  2852. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2853. // 验证失败
  2854. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2855. {
  2856. return actionResult;
  2857. }
  2858. int addRow = ServiceInvoker.Invoke<int>(this,
  2859. () => PDAModuleLogic.AddScrapProduct(SProductEntity, RProcedureEntity, SResponsibleList, sUserInfo));
  2860. actionResult.Result = JsonHelper.ToJson(addRow);
  2861. actionResult.Status = (int)Constant.PDAResult.Success;
  2862. }
  2863. catch (Exception ex)
  2864. {
  2865. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2866. OutputLog.TraceLog(LogPriority.Error,
  2867. this.ToString(),
  2868. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2869. ex.ToString(),
  2870. LocalPath.LogExePath);
  2871. actionResult.Status = (int)Constant.PDAResult.Exception;
  2872. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2873. // TODO 空指针异常问题检测
  2874. try
  2875. {
  2876. OutputLog.TraceLog(LogPriority.Error,
  2877. this.ToString(),
  2878. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2879. "accountCode:" + accountCode + "#userCode:" + userCode + "#sessionKey:" + sessionKey,
  2880. LocalPath.LogExePath);
  2881. string json1 = JsonHelper.ToJson(SProductEntity);
  2882. OutputLog.TraceLog(LogPriority.Error,
  2883. this.ToString(),
  2884. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2885. "SProductEntity:" + json1,
  2886. LocalPath.LogExePath);
  2887. string json2 = JsonHelper.ToJson(RProcedureEntity);
  2888. OutputLog.TraceLog(LogPriority.Error,
  2889. this.ToString(),
  2890. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2891. "RProcedureEntity:" + json2,
  2892. LocalPath.LogExePath);
  2893. string json3 = JsonHelper.ToJson(SResponsibleList);
  2894. OutputLog.TraceLog(LogPriority.Error,
  2895. this.ToString(),
  2896. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2897. "SResponsibleList:" + json3,
  2898. LocalPath.LogExePath);
  2899. }
  2900. catch (Exception exc)
  2901. {
  2902. OutputLog.TraceLog(LogPriority.Error,
  2903. this.ToString(),
  2904. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2905. "参数输入异常:" + exc.Message,
  2906. LocalPath.LogExePath);
  2907. }
  2908. }
  2909. return actionResult;
  2910. }
  2911. /// <summary>
  2912. /// 获取产品分级的数据(根据ID)
  2913. /// </summary>
  2914. /// <param name="GoodsLevelTypeID">分类类别ID</param>
  2915. /// <param name="GoodsLevelID">分类ID</param>
  2916. /// <param name="sUserInfo">用户基本信息</param>
  2917. /// <returns>DataSet</returns>
  2918. /// <remarks>
  2919. /// 2014.10.22 庄天威 新建
  2920. public ActionResult GetGoodsLevelDataById(string accountCode, string userCode, string userPassword, string sessionKey, int? GoodsLevelTypeID)
  2921. {
  2922. ActionResult actionResult = new ActionResult();
  2923. try
  2924. {
  2925. // 验证请求头信息
  2926. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2927. // 验证失败
  2928. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2929. {
  2930. return actionResult;
  2931. }
  2932. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2933. () => SystemModuleLogic.GetGoodsLevelDataById(GoodsLevelTypeID, null, sUserInfo));
  2934. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2935. {
  2936. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2937. actionResult.Status = (int)Constant.PDAResult.Success;
  2938. }
  2939. else
  2940. {
  2941. actionResult.Status = (int)Constant.PDAResult.Fail;
  2942. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2943. }
  2944. }
  2945. catch (Exception ex)
  2946. {
  2947. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2948. OutputLog.TraceLog(LogPriority.Error,
  2949. this.ToString(),
  2950. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2951. ex.ToString(),
  2952. LocalPath.LogExePath);
  2953. actionResult.Status = (int)Constant.PDAResult.Exception;
  2954. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2955. }
  2956. return actionResult;
  2957. }
  2958. /// <summary>
  2959. /// 获取账务日期
  2960. /// </summary>
  2961. /// <param name="accountCode"></param>
  2962. /// <param name="userCode"></param>
  2963. /// <param name="userPassword"></param>
  2964. /// <param name="sessionKey"></param>
  2965. /// <returns></returns>
  2966. public ActionResult GetAccountDate(string accountCode, string userCode, string userPassword, string sessionKey)
  2967. {
  2968. ActionResult actionResult = new ActionResult();
  2969. try
  2970. {
  2971. // 验证请求头信息
  2972. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2973. // 验证失败
  2974. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2975. {
  2976. return actionResult;
  2977. }
  2978. DateTime reworkDs = ServiceInvoker.Invoke<DateTime>(this,
  2979. () => CommonModuleLogic.GetAccountDate(sUserInfo));
  2980. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2981. actionResult.Status = (int)Constant.PDAResult.Success;
  2982. }
  2983. catch (Exception ex)
  2984. {
  2985. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2986. OutputLog.TraceLog(LogPriority.Error,
  2987. this.ToString(),
  2988. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2989. ex.ToString(),
  2990. LocalPath.LogExePath);
  2991. actionResult.Status = (int)Constant.PDAResult.Exception;
  2992. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2993. }
  2994. return actionResult;
  2995. }
  2996. /// <summary>
  2997. /// 获取登陆帐户有无报损权限
  2998. /// </summary>
  2999. /// <param name="accountCode"></param>
  3000. /// <param name="userCode"></param>
  3001. /// <param name="userPassword"></param>
  3002. /// <param name="sessionKey"></param>
  3003. /// <param name="usercode">工号编码</param>
  3004. /// <returns></returns>
  3005. public ActionResult GetScrapFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3006. {
  3007. ActionResult actionResult = new ActionResult();
  3008. try
  3009. {
  3010. // 验证请求头信息
  3011. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3012. // 验证失败
  3013. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3014. {
  3015. return actionResult;
  3016. }
  3017. int returnValue = ServiceInvoker.Invoke<int>(this,
  3018. () => PDAModuleLogic.GetScrapFuntion(userCode, sUserInfo));
  3019. actionResult.Result = JsonHelper.ToJson(returnValue);
  3020. actionResult.Status = (int)Constant.PDAResult.Success;
  3021. }
  3022. catch (Exception ex)
  3023. {
  3024. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3025. OutputLog.TraceLog(LogPriority.Error,
  3026. this.ToString(),
  3027. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3028. ex.ToString(),
  3029. LocalPath.LogExePath);
  3030. actionResult.Status = (int)Constant.PDAResult.Exception;
  3031. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3032. }
  3033. return actionResult;
  3034. }
  3035. #endregion
  3036. /// <summary>
  3037. /// 获取是否存在报损未审核产品
  3038. /// </summary>
  3039. /// <param name="barcode">产品条码</param>
  3040. /// <returns>int</returns>
  3041. public ActionResult GetScrapProductAuditStatus(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  3042. {
  3043. ActionResult actionResult = new ActionResult();
  3044. try
  3045. {
  3046. // 验证请求头信息
  3047. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3048. // 验证失败
  3049. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3050. {
  3051. return actionResult;
  3052. }
  3053. int row = ServiceInvoker.Invoke<int>(this,
  3054. () => PDAModuleLogic.GetScrapProductAuditStatus(barCode));
  3055. actionResult.Result = JsonHelper.ToJson(row);
  3056. actionResult.Status = (int)Constant.PDAResult.Success;
  3057. }
  3058. catch (Exception ex)
  3059. {
  3060. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3061. OutputLog.TraceLog(LogPriority.Error,
  3062. this.ToString(),
  3063. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3064. ex.ToString(),
  3065. LocalPath.LogExePath);
  3066. actionResult.Status = (int)Constant.PDAResult.Exception;
  3067. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3068. }
  3069. return actionResult;
  3070. }
  3071. /// <summary>
  3072. /// 查询报废产品信息
  3073. /// </summary>
  3074. /// <param name="accountCode"></param>
  3075. /// <param name="userCode"></param>
  3076. /// <param name="userPassword"></param>
  3077. /// <param name="sessionKey"></param>
  3078. /// <param name="barCode">产品条码</param>
  3079. /// <param name="scrapProductID">报废产品ID</param>
  3080. /// <returns></returns>
  3081. public ActionResult GetScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barCode, int scrapProductID)
  3082. {
  3083. ActionResult actionResult = new ActionResult();
  3084. try
  3085. {
  3086. // 验证请求头信息
  3087. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3088. // 验证失败
  3089. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3090. {
  3091. return actionResult;
  3092. }
  3093. ScrapProductEntity selectProEntity = new ScrapProductEntity();
  3094. selectProEntity.BarCode = barCode;
  3095. selectProEntity.ScrapProductID = scrapProductID;
  3096. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3097. () => PMModuleLogic.GetScrapProduct(selectProEntity, sUserInfo));
  3098. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3099. {
  3100. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3101. actionResult.Status = (int)Constant.PDAResult.Success;
  3102. }
  3103. else
  3104. {
  3105. actionResult.Status = (int)Constant.PDAResult.Fail;
  3106. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3107. }
  3108. }
  3109. catch (Exception ex)
  3110. {
  3111. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3112. OutputLog.TraceLog(LogPriority.Error,
  3113. this.ToString(),
  3114. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3115. ex.ToString(),
  3116. LocalPath.LogExePath);
  3117. actionResult.Status = (int)Constant.PDAResult.Exception;
  3118. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3119. }
  3120. return actionResult;
  3121. }
  3122. /// <summary>
  3123. /// 根据废弃产品ID获取责任工序
  3124. /// </summary>
  3125. /// <param name="accountCode"></param>
  3126. /// <param name="userCode"></param>
  3127. /// <param name="userPassword"></param>
  3128. /// <param name="sessionKey"></param>
  3129. /// <param name="scrapProductID">报废产品ID</param>
  3130. /// <returns></returns>
  3131. public ActionResult GetResponProcedureBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  3132. {
  3133. ActionResult actionResult = new ActionResult();
  3134. try
  3135. {
  3136. // 验证请求头信息
  3137. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3138. // 验证失败
  3139. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3140. {
  3141. return actionResult;
  3142. }
  3143. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3144. () => PMModuleLogic.GetResponProcedureBySPId(scrapProductID));
  3145. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3146. {
  3147. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3148. actionResult.Status = (int)Constant.PDAResult.Success;
  3149. }
  3150. else
  3151. {
  3152. actionResult.Status = (int)Constant.PDAResult.Fail;
  3153. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3154. }
  3155. }
  3156. catch (Exception ex)
  3157. {
  3158. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3159. OutputLog.TraceLog(LogPriority.Error,
  3160. this.ToString(),
  3161. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3162. ex.ToString(),
  3163. LocalPath.LogExePath);
  3164. actionResult.Status = (int)Constant.PDAResult.Exception;
  3165. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3166. }
  3167. return actionResult;
  3168. }
  3169. /// <summary>
  3170. /// 根据废弃产品ID获取责任人列表
  3171. /// </summary>
  3172. /// <param name="accountCode"></param>
  3173. /// <param name="userCode"></param>
  3174. /// <param name="userPassword"></param>
  3175. /// <param name="sessionKey"></param>
  3176. /// <param name="scrapProductID">报废产品ID</param>
  3177. /// <returns></returns>
  3178. public ActionResult GetScrapResponsibleBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  3179. {
  3180. ActionResult actionResult = new ActionResult();
  3181. try
  3182. {
  3183. // 验证请求头信息
  3184. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3185. // 验证失败
  3186. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3187. {
  3188. return actionResult;
  3189. }
  3190. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3191. () => PMModuleLogic.GetScrapResponsibleBySPId(scrapProductID));
  3192. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3193. {
  3194. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3195. actionResult.Status = (int)Constant.PDAResult.Success;
  3196. }
  3197. else
  3198. {
  3199. actionResult.Status = (int)Constant.PDAResult.Fail;
  3200. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3201. }
  3202. }
  3203. catch (Exception ex)
  3204. {
  3205. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3206. OutputLog.TraceLog(LogPriority.Error,
  3207. this.ToString(),
  3208. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3209. ex.ToString(),
  3210. LocalPath.LogExePath);
  3211. actionResult.Status = (int)Constant.PDAResult.Exception;
  3212. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3213. }
  3214. return actionResult;
  3215. }
  3216. /// <summary>
  3217. /// 添加废弃产品记录
  3218. /// </summary>
  3219. /// <param name="SProductEntity">废弃产品实体</param>
  3220. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  3221. /// <param name="SResponsibleList">责任者集合</param>
  3222. /// <param name="userInfo">用户基本信息</param>
  3223. /// <returns>int结果返回值</returns>
  3224. /// <remarks>
  3225. /// 庄天威 2014.09.24 新建
  3226. /// </remarks>
  3227. public ActionResult UpdateScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, ScrapProductEntity UpdateSProductEntity,
  3228. ResponProcedureEntity UpdateRProcedureEntity,
  3229. ScrapResponsibleEntity[] UpdateSResponsibleList, ScrapResponsibleEntity[] YSResponsibleList)
  3230. {
  3231. ActionResult actionResult = new ActionResult();
  3232. try
  3233. {
  3234. // 验证请求头信息
  3235. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3236. // 验证失败
  3237. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3238. {
  3239. return actionResult;
  3240. }
  3241. int addRow = ServiceInvoker.Invoke<int>(this,
  3242. () => PDAModuleLogic.UpdateScrapProduct(UpdateSProductEntity, UpdateRProcedureEntity, UpdateSResponsibleList, YSResponsibleList, sUserInfo));
  3243. actionResult.Result = JsonHelper.ToJson(addRow);
  3244. actionResult.Status = (int)Constant.PDAResult.Success;
  3245. }
  3246. catch (Exception ex)
  3247. {
  3248. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3249. OutputLog.TraceLog(LogPriority.Error,
  3250. this.ToString(),
  3251. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3252. ex.ToString(),
  3253. LocalPath.LogExePath);
  3254. actionResult.Status = (int)Constant.PDAResult.Exception;
  3255. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3256. }
  3257. return actionResult;
  3258. }
  3259. /// <summary>
  3260. /// 获取产品窑炉
  3261. /// </summary>
  3262. /// <param name="accountCode"></param>
  3263. /// <param name="userCode"></param>
  3264. /// <param name="userPassword"></param>
  3265. /// <param name="sessionKey"></param>
  3266. /// <returns>Datase</returns>
  3267. public ActionResult GetAllKilntInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  3268. {
  3269. ActionResult actionResult = new ActionResult();
  3270. try
  3271. {
  3272. // 验证请求头信息
  3273. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3274. // 验证失败
  3275. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3276. {
  3277. return actionResult;
  3278. }
  3279. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3280. () => PDAModuleLogic.GetAllKilntInfo(sUserInfo));
  3281. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3282. {
  3283. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3284. actionResult.Status = (int)Constant.PDAResult.Success;
  3285. }
  3286. else
  3287. {
  3288. actionResult.Status = (int)Constant.PDAResult.Fail;
  3289. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3290. }
  3291. }
  3292. catch (Exception ex)
  3293. {
  3294. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3295. OutputLog.TraceLog(LogPriority.Error,
  3296. this.ToString(),
  3297. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3298. ex.ToString(),
  3299. LocalPath.LogExePath);
  3300. actionResult.Status = (int)Constant.PDAResult.Exception;
  3301. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3302. }
  3303. return actionResult;
  3304. }
  3305. /// <summary>
  3306. /// 获取次品产品条码允许编辑
  3307. /// </summary>
  3308. /// <param name="accountCode"></param>
  3309. /// <param name="userCode"></param>
  3310. /// <param name="userPassword"></param>
  3311. /// <param name="sessionKey"></param>
  3312. /// <param name="barcode">产品条码</param>
  3313. /// <returns>Datase</returns>
  3314. public ActionResult GetSubstandardInfo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3315. {
  3316. ActionResult actionResult = new ActionResult();
  3317. try
  3318. {
  3319. // 验证请求头信息
  3320. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3321. // 验证失败
  3322. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3323. {
  3324. return actionResult;
  3325. }
  3326. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3327. () => PDAModuleLogic.GetSubstandardInfo(barcode));
  3328. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3329. {
  3330. actionResult.Result = JsonHelper.ToJson(1);
  3331. actionResult.Status = (int)Constant.PDAResult.Success;
  3332. }
  3333. else
  3334. {
  3335. actionResult.Result = JsonHelper.ToJson(0);
  3336. actionResult.Status = (int)Constant.PDAResult.Fail;
  3337. actionResult.Message = "次品条码:" + barcode + "不允许修改";
  3338. }
  3339. }
  3340. catch (Exception ex)
  3341. {
  3342. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3343. OutputLog.TraceLog(LogPriority.Error,
  3344. this.ToString(),
  3345. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3346. ex.ToString(),
  3347. LocalPath.LogExePath);
  3348. actionResult.Status = (int)Constant.PDAResult.Exception;
  3349. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3350. }
  3351. return actionResult;
  3352. }
  3353. /// <summary>
  3354. /// 获取产品条码是否重烧
  3355. /// </summary>
  3356. /// <param name="accountCode"></param>
  3357. /// <param name="userCode"></param>
  3358. /// <param name="userPassword"></param>
  3359. /// <param name="sessionKey"></param>
  3360. /// <param name="barcode">产品条码</param>
  3361. /// <returns>Datase</returns>
  3362. public ActionResult GetReFine(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3363. {
  3364. ActionResult actionResult = new ActionResult();
  3365. try
  3366. {
  3367. // 验证请求头信息
  3368. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3369. // 验证失败
  3370. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3371. {
  3372. return actionResult;
  3373. }
  3374. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3375. () => PDAModuleLogic.GetReFine(barcode));
  3376. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  3377. {
  3378. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(reworkDs.Tables[0].Rows[0]["IsReFire"]));
  3379. }
  3380. else
  3381. {
  3382. actionResult.Result = JsonHelper.ToJson(0);
  3383. }
  3384. actionResult.Status = (int)Constant.PDAResult.Success;
  3385. }
  3386. catch (Exception ex)
  3387. {
  3388. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3389. OutputLog.TraceLog(LogPriority.Error,
  3390. this.ToString(),
  3391. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3392. ex.ToString(),
  3393. LocalPath.LogExePath);
  3394. actionResult.Status = (int)Constant.PDAResult.Exception;
  3395. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3396. }
  3397. return actionResult;
  3398. }
  3399. /// <summary>
  3400. /// 获取登陆帐户有无成检编辑权限
  3401. /// </summary>
  3402. /// <param name="accountCode"></param>
  3403. /// <param name="userCode"></param>
  3404. /// <param name="userPassword"></param>
  3405. /// <param name="sessionKey"></param>
  3406. /// <param name="usercode">工号编码</param>
  3407. /// <returns></returns>
  3408. public ActionResult GetFinishedProductEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3409. {
  3410. ActionResult actionResult = new ActionResult();
  3411. try
  3412. {
  3413. // 验证请求头信息
  3414. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3415. // 验证失败
  3416. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3417. {
  3418. return actionResult;
  3419. }
  3420. int returnValue = ServiceInvoker.Invoke<int>(this,
  3421. () => PDAModuleLogic.GetFinishedProductEditFuntion(sUserInfo));
  3422. actionResult.Result = JsonHelper.ToJson(returnValue);
  3423. actionResult.Status = (int)Constant.PDAResult.Success;
  3424. }
  3425. catch (Exception ex)
  3426. {
  3427. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3428. OutputLog.TraceLog(LogPriority.Error,
  3429. this.ToString(),
  3430. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3431. ex.ToString(),
  3432. LocalPath.LogExePath);
  3433. actionResult.Status = (int)Constant.PDAResult.Exception;
  3434. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3435. }
  3436. return actionResult;
  3437. }
  3438. /// <summary>
  3439. /// 根据条码及工序判断是否漏扫
  3440. /// </summary>
  3441. /// <param name="accountCode"></param>
  3442. /// <param name="userCode"></param>
  3443. /// <param name="userPassword"></param>
  3444. /// <param name="sessionKey"></param>
  3445. /// <param name="usercode">工号编码</param>
  3446. /// <param name="barcode">产品条码</param>
  3447. /// <param name="produceid">工序ID</param>
  3448. /// <returns></returns>
  3449. public ActionResult AddBarCodeMissing(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int produceid)
  3450. {
  3451. ActionResult actionResult = new ActionResult();
  3452. try
  3453. {
  3454. // 验证请求头信息
  3455. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3456. // 验证失败
  3457. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3458. {
  3459. return actionResult;
  3460. }
  3461. int returnValue = 1;
  3462. //int returnValue = ServiceInvoker.Invoke<int>(this,
  3463. // () => PMModuleLogicDAL.AddBarCodeMissing(barcode, produceid, sUserInfo));
  3464. actionResult.Result = JsonHelper.ToJson(returnValue);
  3465. actionResult.Status = (int)Constant.PDAResult.Success;
  3466. }
  3467. catch (Exception ex)
  3468. {
  3469. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3470. OutputLog.TraceLog(LogPriority.Error,
  3471. this.ToString(),
  3472. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3473. ex.ToString(),
  3474. LocalPath.LogExePath);
  3475. actionResult.Status = (int)Constant.PDAResult.Exception;
  3476. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3477. }
  3478. return actionResult;
  3479. }
  3480. /// <summary>
  3481. /// 获取登陆帐户有无报损审批权限
  3482. /// </summary>
  3483. /// <param name="accountCode"></param>
  3484. /// <param name="userCode"></param>
  3485. /// <param name="userPassword"></param>
  3486. /// <param name="sessionKey"></param>
  3487. /// <param name="usercode">工号编码</param>
  3488. /// <returns></returns>
  3489. public ActionResult GetScrapProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3490. {
  3491. ActionResult actionResult = new ActionResult();
  3492. try
  3493. {
  3494. // 验证请求头信息
  3495. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3496. // 验证失败
  3497. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3498. {
  3499. return actionResult;
  3500. }
  3501. int returnValue = ServiceInvoker.Invoke<int>(this,
  3502. () => PDAModuleLogic.GetScrapProductFuntion(sUserInfo));
  3503. actionResult.Result = JsonHelper.ToJson(returnValue);
  3504. actionResult.Status = (int)Constant.PDAResult.Success;
  3505. }
  3506. catch (Exception ex)
  3507. {
  3508. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3509. OutputLog.TraceLog(LogPriority.Error,
  3510. this.ToString(),
  3511. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3512. ex.ToString(),
  3513. LocalPath.LogExePath);
  3514. actionResult.Status = (int)Constant.PDAResult.Exception;
  3515. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3516. }
  3517. return actionResult;
  3518. }
  3519. /// <summary>
  3520. /// 获取登陆帐户有无报损审批权限
  3521. /// </summary>
  3522. /// <param name="accountCode"></param>
  3523. /// <param name="userCode"></param>
  3524. /// <param name="userPassword"></param>
  3525. /// <param name="sessionKey"></param>
  3526. /// <param name="usercode">工号编码</param>
  3527. /// <returns></returns>
  3528. public ActionResult GetSpecialRepairflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3529. {
  3530. ActionResult actionResult = new ActionResult();
  3531. try
  3532. {
  3533. // 验证请求头信息
  3534. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3535. // 验证失败
  3536. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3537. {
  3538. return actionResult;
  3539. }
  3540. int returnValue = ServiceInvoker.Invoke<int>(this,
  3541. () => PMModuleLogic.GetSpecialRepairflagByBarcode(barcode, sUserInfo));
  3542. actionResult.Result = JsonHelper.ToJson(returnValue);
  3543. actionResult.Status = (int)Constant.PDAResult.Success;
  3544. }
  3545. catch (Exception ex)
  3546. {
  3547. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3548. OutputLog.TraceLog(LogPriority.Error,
  3549. this.ToString(),
  3550. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3551. ex.ToString(),
  3552. LocalPath.LogExePath);
  3553. actionResult.Status = (int)Constant.PDAResult.Exception;
  3554. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3555. }
  3556. return actionResult;
  3557. }
  3558. /// <summary>
  3559. /// 获取窑车对应产品列表
  3560. /// </summary>
  3561. /// <param name="accountCode"></param>
  3562. /// <param name="userCode"></param>
  3563. /// <param name="userPassword"></param>
  3564. /// <param name="sessionKey"></param>
  3565. /// <param name="KilnCarID">窑车ID</param>
  3566. /// <returns>Dataset</returns>
  3567. public ActionResult GetKilnCarGoodsByKilnCarID(string accountCode, string userCode, string userPassword, string sessionKey, int KilnCarID)
  3568. {
  3569. ActionResult actionResult = new ActionResult();
  3570. try
  3571. {
  3572. // 验证请求头信息
  3573. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3574. // 验证失败
  3575. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3576. {
  3577. return actionResult;
  3578. }
  3579. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3580. () => PMModuleLogic.GetKilnCarGoodsByKilnCarID(KilnCarID));
  3581. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3582. {
  3583. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3584. actionResult.Status = (int)Constant.PDAResult.Success;
  3585. }
  3586. else
  3587. {
  3588. actionResult.Status = (int)Constant.PDAResult.Fail;
  3589. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3590. }
  3591. }
  3592. catch (Exception ex)
  3593. {
  3594. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3595. OutputLog.TraceLog(LogPriority.Error,
  3596. this.ToString(),
  3597. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3598. ex.ToString(),
  3599. LocalPath.LogExePath);
  3600. actionResult.Status = (int)Constant.PDAResult.Exception;
  3601. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3602. }
  3603. return actionResult;
  3604. }
  3605. /// <summary>
  3606. /// 更换条码
  3607. /// </summary>
  3608. /// <param name="accountCode"></param>
  3609. /// <param name="userCode"></param>
  3610. /// <param name="userPassword"></param>
  3611. /// <param name="sessionKey"></param>
  3612. ///<param name="barcode">原条码</param>
  3613. /// <param name="newBarcode">新条码</param>
  3614. /// <param name="remarks">备注</param>
  3615. /// <returns>操作结果</returns>
  3616. public ActionResult SaveBarCodeChange(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, string newBarcode, string remarks, string groutingUserCode, string goodsCode)
  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.SetFPM0201Data(sUserInfo, barcode, newBarcode, remarks, groutingUserCode, goodsCode));
  3630. if (serviceResultEntity.Status == Constant.ServiceResultStatus.Success)
  3631. {
  3632. actionResult.Result = 1;
  3633. actionResult.Status = (int)Constant.PDAResult.Success;
  3634. }
  3635. else
  3636. {
  3637. actionResult.Status = (int)Constant.PDAResult.Fail;
  3638. actionResult.Message = serviceResultEntity.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 GetGroutingList(string accountCode, string userCode, string userPassword, string sessionKey, FPM0202_SE se)
  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. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3676. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0202SData(sUserInfo, se));
  3677. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3678. {
  3679. // PDA不显示的列删除掉
  3680. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyDetailID");
  3681. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyID");
  3682. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingLineName");
  3683. serviceResultEntity.Data.Tables[0].Columns.Remove("UserCode");
  3684. serviceResultEntity.Data.Tables[0].Columns.Remove("GoodsName");
  3685. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldStatusName");
  3686. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingCount");
  3687. serviceResultEntity.Data.Tables[0].Columns.Remove("Remarks");
  3688. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldTypeName");
  3689. //serviceResultEntity.Data.Tables[0].Columns.Remove("DMUserCode");
  3690. serviceResultEntity.Data.Tables[0].Columns.Remove("IsPublicBody");
  3691. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3692. actionResult.Status = (int)Constant.PDAResult.Success;
  3693. }
  3694. else
  3695. {
  3696. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3697. actionResult.Message = "无查询数据";
  3698. }
  3699. }
  3700. catch (Exception ex)
  3701. {
  3702. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3703. OutputLog.TraceLog(LogPriority.Error,
  3704. this.ToString(),
  3705. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3706. ex.ToString(),
  3707. LocalPath.LogExePath);
  3708. actionResult.Status = (int)Constant.PDAResult.Exception;
  3709. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3710. }
  3711. return actionResult;
  3712. }
  3713. /// <summary>
  3714. /// 获取(注浆登记)的查询数据
  3715. /// </summary>
  3716. /// <param name="accountCode"></param>
  3717. /// <param name="userCode"></param>
  3718. /// <param name="userPassword"></param>
  3719. /// <param name="sessionKey"></param>
  3720. /// <param name="se">查询条件</param>
  3721. /// <returns>Dataset</returns>
  3722. public ActionResult GetGroutingListByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3723. {
  3724. ActionResult actionResult = new ActionResult();
  3725. try
  3726. {
  3727. // 验证请求头信息
  3728. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3729. // 验证失败
  3730. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3731. {
  3732. return actionResult;
  3733. }
  3734. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3735. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0203SData(sUserInfo, barcode));
  3736. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3737. {
  3738. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3739. actionResult.Status = (int)Constant.PDAResult.Success;
  3740. }
  3741. else
  3742. {
  3743. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3744. actionResult.Message = "无查询数据";
  3745. }
  3746. }
  3747. catch (Exception ex)
  3748. {
  3749. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3750. OutputLog.TraceLog(LogPriority.Error,
  3751. this.ToString(),
  3752. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3753. ex.ToString(),
  3754. LocalPath.LogExePath);
  3755. actionResult.Status = (int)Constant.PDAResult.Exception;
  3756. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3757. }
  3758. return actionResult;
  3759. }
  3760. /// <summary>
  3761. ///获得成型线信息
  3762. /// </summary>
  3763. /// <param name="accountCode"></param>
  3764. /// <param name="userCode"></param>
  3765. /// <param name="userPassword"></param>
  3766. /// <param name="sessionKey"></param>
  3767. /// <param name="se">查询条件</param>
  3768. /// <returns>Dataset</returns>
  3769. public ActionResult GetGroutingLine(string accountCode, string userCode, string userPassword, string sessionKey, GroutingLineEntity groutingLineEntity)
  3770. {
  3771. ActionResult actionResult = new ActionResult();
  3772. try
  3773. {
  3774. // 验证请求头信息
  3775. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3776. // 验证失败
  3777. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3778. {
  3779. return actionResult;
  3780. }
  3781. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3782. () => Dongke.IBOSS.PRD.Service.PCModuleLogic.PCModuleLogic.GetGroutingLine(groutingLineEntity, sUserInfo));
  3783. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3784. {
  3785. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3786. actionResult.Status = (int)Constant.PDAResult.Success;
  3787. }
  3788. else
  3789. {
  3790. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3791. actionResult.Message = "无查询数据";
  3792. }
  3793. }
  3794. catch (Exception ex)
  3795. {
  3796. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3797. OutputLog.TraceLog(LogPriority.Error,
  3798. this.ToString(),
  3799. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3800. ex.ToString(),
  3801. LocalPath.LogExePath);
  3802. actionResult.Status = (int)Constant.PDAResult.Exception;
  3803. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3804. }
  3805. return actionResult;
  3806. }
  3807. /// <summary>
  3808. ///获取在产产品的信息标识列表
  3809. /// </summary>
  3810. /// <param name="accountCode"></param>
  3811. /// <param name="userCode"></param>
  3812. /// <param name="userPassword"></param>
  3813. /// <param name="sessionKey"></param>
  3814. /// <param name="barcode">查询条件</param>
  3815. /// <returns>Dataset</returns>
  3816. public ActionResult GetInProductionDataList(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3817. {
  3818. ActionResult actionResult = new ActionResult();
  3819. try
  3820. {
  3821. // 验证请求头信息
  3822. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3823. // 验证失败
  3824. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3825. {
  3826. return actionResult;
  3827. }
  3828. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3829. () => PMModuleLogic.GetInProductionDataList(barcode));
  3830. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3831. {
  3832. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3833. actionResult.Status = (int)Constant.PDAResult.Success;
  3834. }
  3835. else
  3836. {
  3837. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3838. actionResult.Message = "无查询数据";
  3839. }
  3840. }
  3841. catch (Exception ex)
  3842. {
  3843. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3844. OutputLog.TraceLog(LogPriority.Error,
  3845. this.ToString(),
  3846. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3847. ex.ToString(),
  3848. LocalPath.LogExePath);
  3849. actionResult.Status = (int)Constant.PDAResult.Exception;
  3850. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3851. }
  3852. return actionResult;
  3853. }
  3854. /// <summary>
  3855. ///获取条码是否注浆登记过,0行无效
  3856. /// </summary>
  3857. /// <param name="accountCode"></param>
  3858. /// <param name="userCode"></param>
  3859. /// <param name="userPassword"></param>
  3860. /// <param name="sessionKey"></param>
  3861. /// <param name="barcode">查询条件</param>
  3862. /// <returns>Dataset</returns>
  3863. public ActionResult GetBarCodeInGroutingDailyDetail(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3864. {
  3865. ActionResult actionResult = new ActionResult();
  3866. try
  3867. {
  3868. // 验证请求头信息
  3869. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3870. // 验证失败
  3871. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3872. {
  3873. return actionResult;
  3874. }
  3875. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3876. () => PMModuleLogic.GetBarCodeInGroutingDailyDetail(barcode));
  3877. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3878. {
  3879. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3880. actionResult.Status = (int)Constant.PDAResult.Success;
  3881. }
  3882. else
  3883. {
  3884. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3885. actionResult.Message = "该产品条码无效,无法报损!";
  3886. }
  3887. }
  3888. catch (Exception ex)
  3889. {
  3890. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3891. OutputLog.TraceLog(LogPriority.Error,
  3892. this.ToString(),
  3893. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3894. ex.ToString(),
  3895. LocalPath.LogExePath);
  3896. actionResult.Status = (int)Constant.PDAResult.Exception;
  3897. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3898. }
  3899. return actionResult;
  3900. }
  3901. /// <summary>
  3902. /// 获取登陆帐户有变更条码权限
  3903. /// </summary>
  3904. /// <param name="accountCode"></param>
  3905. /// <param name="userCode"></param>
  3906. /// <param name="userPassword"></param>
  3907. /// <param name="sessionKey"></param>
  3908. /// <returns></returns>
  3909. public ActionResult GetBarCodeRecordFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3910. {
  3911. ActionResult actionResult = new ActionResult();
  3912. try
  3913. {
  3914. // 验证请求头信息
  3915. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3916. // 验证失败
  3917. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3918. {
  3919. return actionResult;
  3920. }
  3921. int returnValue = ServiceInvoker.Invoke<int>(this,
  3922. () => PDAModuleLogic.GetBarCodeRecordFuntion(sUserInfo));
  3923. actionResult.Result = JsonHelper.ToJson(returnValue);
  3924. actionResult.Status = (int)Constant.PDAResult.Success;
  3925. }
  3926. catch (Exception ex)
  3927. {
  3928. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3929. OutputLog.TraceLog(LogPriority.Error,
  3930. this.ToString(),
  3931. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3932. ex.ToString(),
  3933. LocalPath.LogExePath);
  3934. actionResult.Status = (int)Constant.PDAResult.Exception;
  3935. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3936. }
  3937. return actionResult;
  3938. }
  3939. /// <summary>
  3940. /// 成检时获取此条码是否报损
  3941. /// </summary>
  3942. /// <param name="accountCode"></param>
  3943. /// <param name="userCode"></param>
  3944. /// <param name="userPassword"></param>
  3945. /// <param name="sessionKey"></param>
  3946. /// <param name="barcode">产品条码</param>
  3947. /// <returns></returns>
  3948. public ActionResult CheckScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3949. {
  3950. ActionResult actionResult = new ActionResult();
  3951. try
  3952. {
  3953. // 验证请求头信息
  3954. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3955. // 验证失败
  3956. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3957. {
  3958. return actionResult;
  3959. }
  3960. int returnValue = ServiceInvoker.Invoke<int>(this,
  3961. () => PMModuleLogic.CheckScrapProduct(barcode));
  3962. if (returnValue == -100)
  3963. {
  3964. actionResult.Result = JsonHelper.ToJson(returnValue);
  3965. actionResult.Status = (int)Constant.PDAResult.Success;
  3966. }
  3967. else
  3968. {
  3969. actionResult.Status = (int)Constant.PDAResult.Fail;
  3970. if (returnValue == 0)
  3971. {
  3972. actionResult.Message = "该条码:" + barcode + "存在报损记录(待审批)";
  3973. }
  3974. else
  3975. {
  3976. actionResult.Message = "该条码:" + barcode + "存在报损记录(审批通过)";
  3977. }
  3978. }
  3979. }
  3980. catch (Exception ex)
  3981. {
  3982. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3983. OutputLog.TraceLog(LogPriority.Error,
  3984. this.ToString(),
  3985. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3986. ex.ToString(),
  3987. LocalPath.LogExePath);
  3988. actionResult.Status = (int)Constant.PDAResult.Exception;
  3989. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3990. }
  3991. return actionResult;
  3992. }
  3993. /// <summary>
  3994. /// 获取产品完成工序的ID(PDA)
  3995. /// </summary>
  3996. /// <param name="barcode">产品条码</param>
  3997. /// <returns>int</returns>
  3998. public ActionResult GetCompleteProcedureIDPDA(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3999. {
  4000. ActionResult actionResult = new ActionResult();
  4001. try
  4002. {
  4003. // 验证请求头信息
  4004. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4005. // 验证失败
  4006. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4007. {
  4008. return actionResult;
  4009. }
  4010. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4011. () => PMModuleLogic.GetCompleteProcedureIDPDA(barcode));
  4012. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  4013. actionResult.Status = (int)Constant.PDAResult.Success;
  4014. }
  4015. catch (Exception ex)
  4016. {
  4017. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4018. OutputLog.TraceLog(LogPriority.Error,
  4019. this.ToString(),
  4020. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4021. ex.ToString(),
  4022. LocalPath.LogExePath);
  4023. actionResult.Status = (int)Constant.PDAResult.Exception;
  4024. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4025. }
  4026. return actionResult;
  4027. }
  4028. /// <summary>
  4029. /// 获取产品完成工序的ID(PDA)
  4030. /// </summary>
  4031. /// <param name="barcode">产品条码</param>
  4032. /// <returns>int</returns>
  4033. public ActionResult GetGoodsInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  4034. {
  4035. ActionResult actionResult = new ActionResult();
  4036. try
  4037. {
  4038. // 验证请求头信息
  4039. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4040. // 验证失败
  4041. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4042. {
  4043. return actionResult;
  4044. }
  4045. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4046. () => PMModuleLogic.GetGoodsInfoBybarcode(barcode));
  4047. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  4048. actionResult.Status = (int)Constant.PDAResult.Success;
  4049. }
  4050. catch (Exception ex)
  4051. {
  4052. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4053. OutputLog.TraceLog(LogPriority.Error,
  4054. this.ToString(),
  4055. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4056. ex.ToString(),
  4057. LocalPath.LogExePath);
  4058. actionResult.Status = (int)Constant.PDAResult.Exception;
  4059. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4060. }
  4061. return actionResult;
  4062. }
  4063. /// <summary>
  4064. /// 成检-校验生产工号
  4065. /// </summary>
  4066. /// <param name="usercode">生产工号</param>
  4067. /// <returns>int</returns>
  4068. public ActionResult GetUserCode(string accountCode, string userCode, string userPassword, string sessionKey, string usercode)
  4069. {
  4070. ActionResult actionResult = new ActionResult();
  4071. try
  4072. {
  4073. // 验证请求头信息
  4074. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4075. // 验证失败
  4076. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4077. {
  4078. return actionResult;
  4079. }
  4080. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4081. () => PDAModuleLogic.GetUserCode(usercode, sUserInfo));
  4082. actionResult.Result = JsonHelper.ToJson(ds);
  4083. actionResult.Status = (int)Constant.PDAResult.Success;
  4084. }
  4085. catch (Exception ex)
  4086. {
  4087. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4088. OutputLog.TraceLog(LogPriority.Error,
  4089. this.ToString(),
  4090. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4091. ex.ToString(),
  4092. LocalPath.LogExePath);
  4093. actionResult.Status = (int)Constant.PDAResult.Exception;
  4094. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4095. }
  4096. return actionResult;
  4097. }
  4098. /// <summary>
  4099. /// 更新漏扫的成型工号
  4100. /// </summary>
  4101. /// <param name="accountCode"></param>
  4102. /// <param name="userCode"></param>
  4103. /// <param name="userPassword"></param>
  4104. /// <param name="sessionKey"></param>
  4105. /// <param name="groutingUserCode">成型工号</param>
  4106. /// <param name="missingID">漏扫ID</param>
  4107. /// <returns></returns>
  4108. public ActionResult UpdateGroutingUserCodeByMissingID(string accountCode, string userCode, string userPassword, string sessionKey, string groutingUserCode, int missingID)
  4109. {
  4110. ActionResult actionResult = new ActionResult();
  4111. try
  4112. {
  4113. // 验证请求头信息
  4114. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4115. // 验证失败
  4116. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4117. {
  4118. return actionResult;
  4119. }
  4120. int returnValue = ServiceInvoker.Invoke<int>(this,
  4121. () => PMModuleLogicDAL.UpdateGroutingUserCodeByMissingID(groutingUserCode, missingID, sUserInfo));
  4122. if (returnValue != -1)
  4123. {
  4124. actionResult.Result = JsonHelper.ToJson(returnValue);
  4125. actionResult.Status = (int)Constant.PDAResult.Success;
  4126. }
  4127. else
  4128. {
  4129. actionResult.Status = (int)Constant.PDAResult.Fail;
  4130. actionResult.Message = "存在无效的漏扫工号";
  4131. }
  4132. }
  4133. catch (Exception ex)
  4134. {
  4135. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4136. OutputLog.TraceLog(LogPriority.Error,
  4137. this.ToString(),
  4138. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4139. ex.ToString(),
  4140. LocalPath.LogExePath);
  4141. actionResult.Status = (int)Constant.PDAResult.Exception;
  4142. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4143. }
  4144. return actionResult;
  4145. }
  4146. /// <summary>
  4147. /// 在入窑工序检验窑车号是否存在
  4148. /// </summary>
  4149. /// <param name="accountCode"></param>
  4150. /// <param name="userCode"></param>
  4151. /// <param name="userPassword"></param>
  4152. /// <param name="sessionKey"></param>
  4153. /// <param name="kilncarcode">窑车编码</param>
  4154. /// <param name="procedureid">工序ID</param>
  4155. /// <returns></returns>
  4156. public ActionResult CheckKilnCarByIntoCar(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  4157. {
  4158. ActionResult actionResult = new ActionResult();
  4159. try
  4160. {
  4161. // 验证请求头信息
  4162. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4163. // 验证失败
  4164. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4165. {
  4166. return actionResult;
  4167. }
  4168. int returnValue = ServiceInvoker.Invoke<int>(this,
  4169. () => PMModuleLogicDAL.CheckKilnCarByIntoCar(kilncarcode, procedureid, sUserInfo));
  4170. if (returnValue == 1)
  4171. {
  4172. actionResult.Result = JsonHelper.ToJson(returnValue);
  4173. actionResult.Status = (int)Constant.PDAResult.Success;
  4174. }
  4175. else
  4176. {
  4177. actionResult.Status = (int)Constant.PDAResult.Fail;
  4178. if (returnValue == -99)
  4179. actionResult.Message = "窑炉车号无效";
  4180. else if (returnValue == -98)
  4181. actionResult.Message = "窑车己无产品";
  4182. else if (returnValue == -97)
  4183. actionResult.Message = "窑车没有入窑,不可以撤销";
  4184. else if (returnValue == -1)
  4185. actionResult.Message = "保存失败";
  4186. }
  4187. }
  4188. catch (Exception ex)
  4189. {
  4190. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4191. OutputLog.TraceLog(LogPriority.Error,
  4192. this.ToString(),
  4193. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4194. ex.ToString(),
  4195. LocalPath.LogExePath);
  4196. actionResult.Status = (int)Constant.PDAResult.Exception;
  4197. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4198. }
  4199. return actionResult;
  4200. }
  4201. /// <summary>
  4202. /// 获取盘点单列表
  4203. /// </summary>
  4204. /// <param name="sUserInfo"></param>
  4205. /// <returns></returns>
  4206. public ActionResult GetInCheckedList(string accountCode, string userCode, string userPassword, string sessionKey)
  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. () => PMModuleLogic.GetInCheckedList(sUserInfo));
  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="accountCode"></param>
  4240. /// <param name="userCode"></param>
  4241. /// <param name="userPassword"></param>
  4242. /// <param name="sessionKey"></param>
  4243. /// <param name="InCheckedID">盘点单ID</param>
  4244. /// <param name="BarCode">产品条码</param>
  4245. /// <returns></returns>
  4246. public ActionResult UpdateInChecked(string accountCode, string userCode, string userPassword, string sessionKey, int InCheckedID, string BarCode)
  4247. {
  4248. ActionResult actionResult = new ActionResult();
  4249. try
  4250. {
  4251. // 验证请求头信息
  4252. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4253. // 验证失败
  4254. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4255. {
  4256. return actionResult;
  4257. }
  4258. int returnValue = ServiceInvoker.Invoke<int>(this,
  4259. () => PMModuleLogicDAL.UpdateInChecked(InCheckedID, BarCode, sUserInfo));
  4260. if (returnValue > 0)
  4261. {
  4262. actionResult.Result = JsonHelper.ToJson(returnValue);
  4263. actionResult.Status = (int)Constant.PDAResult.Success;
  4264. actionResult.Message = "产品" + BarCode + "盘点成功";
  4265. }
  4266. else if (returnValue == 10)
  4267. {
  4268. actionResult.Result = JsonHelper.ToJson(returnValue);
  4269. actionResult.Status = (int)Constant.PDAResult.Success;
  4270. actionResult.Message = "产品" + BarCode + "盘盈成功";
  4271. }
  4272. else
  4273. {
  4274. actionResult.Status = (int)Constant.PDAResult.Fail;
  4275. if (returnValue == -2)
  4276. actionResult.Message = "产品" + BarCode + "不是在产产品";
  4277. //if (returnValue == 10)
  4278. // actionResult.Message = "产品" + BarCode + "盘盈成功";
  4279. //if (returnValue > 0)
  4280. // actionResult.Message = "产品" + BarCode + "盘点成功";
  4281. if (returnValue == -22)
  4282. actionResult.Message = "产品" + BarCode + "己被其他工号盘点";
  4283. if (returnValue == -23)
  4284. actionResult.Message = "产品" + BarCode + "己被其他工号盘盈";
  4285. if (returnValue == -24)
  4286. actionResult.Message = "产品" + BarCode + "己被此工号盘点";
  4287. if (returnValue == -25)
  4288. actionResult.Message = "产品" + BarCode + "己被此工号盘盈";
  4289. else if (returnValue == 0)
  4290. actionResult.Message = "盘点失败";
  4291. }
  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. #region 班次配置
  4307. /// <summary>
  4308. /// 班次配置-通过工号获取工种列表
  4309. /// </summary>
  4310. /// <param name="userId">工号ID</param>
  4311. /// <returns></returns>
  4312. public ActionResult BindUserJobs(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4313. {
  4314. ActionResult actionResult = new ActionResult();
  4315. try
  4316. {
  4317. // 验证请求头信息
  4318. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4319. // 验证失败
  4320. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4321. {
  4322. return actionResult;
  4323. }
  4324. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4325. () => SystemModuleLogic.GetJobByUserId(userId));
  4326. actionResult.Result = JsonHelper.ToJson(ds);
  4327. actionResult.Status = (int)Constant.PDAResult.Success;
  4328. }
  4329. catch (Exception ex)
  4330. {
  4331. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4332. OutputLog.TraceLog(LogPriority.Error,
  4333. this.ToString(),
  4334. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4335. ex.ToString(),
  4336. LocalPath.LogExePath);
  4337. actionResult.Status = (int)Constant.PDAResult.Exception;
  4338. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4339. }
  4340. return actionResult;
  4341. }
  4342. ///// <summary>
  4343. ///// 班次配置-根据工号查询员工档案信息
  4344. ///// </summary>
  4345. ///// <param name="userId">工号ID</param>
  4346. ///// <returns></returns>
  4347. //public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4348. //{
  4349. // ActionResult actionResult = new ActionResult();
  4350. // try
  4351. // {
  4352. // // 验证请求头信息
  4353. // actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4354. // // 验证失败
  4355. // if (actionResult.Status != (int)Constant.PDAResult.Success)
  4356. // {
  4357. // return actionResult;
  4358. // }
  4359. // DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4360. // () => HRModuleLogic.SearchHrStaffInfo(userId,sUserInfo));
  4361. // actionResult.Result = JsonHelper.ToJson(ds);
  4362. // actionResult.Status = (int)Constant.PDAResult.Success;
  4363. // }
  4364. // catch (Exception ex)
  4365. // {
  4366. // //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4367. // OutputLog.TraceLog(LogPriority.Error,
  4368. // this.ToString(),
  4369. // System.Reflection.MethodBase.GetCurrentMethod().Name,
  4370. // ex.ToString(),
  4371. // LocalPath.LogExePath);
  4372. // actionResult.Status = (int)Constant.PDAResult.Exception;
  4373. // actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4374. // }
  4375. // return actionResult;
  4376. //}
  4377. /// <summary>
  4378. /// 班次配置-根据员工姓名查员工信息
  4379. /// </summary>
  4380. /// <param name="searchStaffEntity"></param>
  4381. /// <returns></returns>
  4382. public ActionResult SearchStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, SearchStaffEntity searchStaffEntity)
  4383. {
  4384. ActionResult actionResult = new ActionResult();
  4385. try
  4386. {
  4387. // 验证请求头信息
  4388. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4389. // 验证失败
  4390. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4391. {
  4392. return actionResult;
  4393. }
  4394. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4395. () => PDAModuleLogic.SearchStaffInfo(searchStaffEntity, sUserInfo));
  4396. actionResult.Result = JsonHelper.ToJson(ds);
  4397. actionResult.Status = (int)Constant.PDAResult.Success;
  4398. }
  4399. catch (Exception ex)
  4400. {
  4401. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4402. OutputLog.TraceLog(LogPriority.Error,
  4403. this.ToString(),
  4404. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4405. ex.ToString(),
  4406. LocalPath.LogExePath);
  4407. actionResult.Status = (int)Constant.PDAResult.Exception;
  4408. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4409. }
  4410. return actionResult;
  4411. }
  4412. /// <summary>
  4413. /// 获取班次配置信息
  4414. /// </summary>
  4415. /// <param name="searchEntity"></param>
  4416. /// <returns></returns>
  4417. public ActionResult SearchClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, SearchClassesSettingEntity searchEntity)
  4418. {
  4419. ActionResult actionResult = new ActionResult();
  4420. try
  4421. {
  4422. // 验证请求头信息
  4423. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4424. // 验证失败
  4425. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4426. {
  4427. return actionResult;
  4428. }
  4429. searchEntity.StartAccountDate = Convert.ToDateTime(searchEntity.StartAccountDatePDA);
  4430. searchEntity.EndAccountDate = Convert.ToDateTime(searchEntity.EndAccountDatePDA).AddDays(1).AddMinutes(-1);
  4431. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4432. () => PCModuleLogic.SearchClassesSetting(searchEntity, sUserInfo));
  4433. actionResult.Result = JsonHelper.ToJson(ds);
  4434. actionResult.Status = (int)Constant.PDAResult.Success;
  4435. }
  4436. catch (Exception ex)
  4437. {
  4438. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4439. OutputLog.TraceLog(LogPriority.Error,
  4440. this.ToString(),
  4441. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4442. ex.ToString(),
  4443. LocalPath.LogExePath);
  4444. actionResult.Status = (int)Constant.PDAResult.Exception;
  4445. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4446. }
  4447. return actionResult;
  4448. }
  4449. public ActionResult SaveClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, ClassesSettingEntity setEntity, ClassesDetailSettingEntity[] setDetailEntity)
  4450. {
  4451. ActionResult actionResult = new ActionResult();
  4452. try
  4453. {
  4454. // 验证请求头信息
  4455. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4456. // 验证失败
  4457. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4458. {
  4459. return actionResult;
  4460. }
  4461. int returnValue = ServiceInvoker.Invoke<int>(this,
  4462. () => PDAModuleLogic.SaveClassesSetting(setEntity, setDetailEntity, sUserInfo));
  4463. if (returnValue > 0)
  4464. {
  4465. actionResult.Result = JsonHelper.ToJson(returnValue);
  4466. actionResult.Status = (int)Constant.PDAResult.Success;
  4467. }
  4468. else
  4469. {
  4470. actionResult.Status = (int)Constant.PDAResult.Fail;
  4471. actionResult.Message = "保存失败";
  4472. }
  4473. }
  4474. catch (Exception ex)
  4475. {
  4476. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4477. OutputLog.TraceLog(LogPriority.Error,
  4478. this.ToString(),
  4479. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4480. ex.ToString(),
  4481. LocalPath.LogExePath);
  4482. actionResult.Status = (int)Constant.PDAResult.Exception;
  4483. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4484. }
  4485. return actionResult;
  4486. }
  4487. /// <summary>
  4488. /// 班次配置--获取详细信息
  4489. /// </summary>
  4490. /// <param name="searchEntity"></param>
  4491. /// <returns></returns>
  4492. public ActionResult SearchClassesDetail(string accountCode, string userCode, string userPassword, string sessionKey, int classesSettingID)
  4493. {
  4494. ActionResult actionResult = new ActionResult();
  4495. try
  4496. {
  4497. // 验证请求头信息
  4498. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4499. // 验证失败
  4500. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4501. {
  4502. return actionResult;
  4503. }
  4504. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4505. () => PCModuleLogic.SearchClassesDetail(classesSettingID, sUserInfo));
  4506. actionResult.Result = JsonHelper.ToJson(ds);
  4507. actionResult.Status = (int)Constant.PDAResult.Success;
  4508. }
  4509. catch (Exception ex)
  4510. {
  4511. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4512. OutputLog.TraceLog(LogPriority.Error,
  4513. this.ToString(),
  4514. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4515. ex.ToString(),
  4516. LocalPath.LogExePath);
  4517. actionResult.Status = (int)Constant.PDAResult.Exception;
  4518. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4519. }
  4520. return actionResult;
  4521. }
  4522. /// <summary>
  4523. /// 获取用户是否有班次配置权限
  4524. /// </summary>
  4525. /// <param name="accountCode"></param>
  4526. /// <param name="userCode"></param>
  4527. /// <param name="userPassword"></param>
  4528. /// <param name="sessionKey"></param>
  4529. /// <returns></returns>
  4530. public ActionResult GetClassesSettingFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4531. {
  4532. ActionResult actionResult = new ActionResult();
  4533. try
  4534. {
  4535. // 验证请求头信息
  4536. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4537. // 验证失败
  4538. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4539. {
  4540. return actionResult;
  4541. }
  4542. int returnValue = ServiceInvoker.Invoke<int>(this,
  4543. () => PDAModuleLogic.GetClassesSettingFuntion(sUserInfo));
  4544. actionResult.Result = JsonHelper.ToJson(returnValue);
  4545. actionResult.Status = (int)Constant.PDAResult.Success;
  4546. }
  4547. catch (Exception ex)
  4548. {
  4549. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4550. OutputLog.TraceLog(LogPriority.Error,
  4551. this.ToString(),
  4552. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4553. ex.ToString(),
  4554. LocalPath.LogExePath);
  4555. actionResult.Status = (int)Constant.PDAResult.Exception;
  4556. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4557. }
  4558. return actionResult;
  4559. }
  4560. /// <summary>
  4561. /// 获取盘点单列表
  4562. /// </summary>
  4563. /// <param name="sUserInfo"></param>
  4564. /// <returns></returns>
  4565. public ActionResult GetAllInChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  4566. {
  4567. ActionResult actionResult = new ActionResult();
  4568. try
  4569. {
  4570. // 验证请求头信息
  4571. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4572. // 验证失败
  4573. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4574. {
  4575. return actionResult;
  4576. }
  4577. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  4578. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  4579. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4580. () => PDAModuleLogic.GetAllInChecked(entity, sUserInfo));
  4581. actionResult.Result = JsonHelper.ToJson(ds);
  4582. actionResult.Status = (int)Constant.PDAResult.Success;
  4583. }
  4584. catch (Exception ex)
  4585. {
  4586. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4587. OutputLog.TraceLog(LogPriority.Error,
  4588. this.ToString(),
  4589. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4590. ex.ToString(),
  4591. LocalPath.LogExePath);
  4592. actionResult.Status = (int)Constant.PDAResult.Exception;
  4593. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4594. }
  4595. return actionResult;
  4596. }
  4597. #endregion
  4598. #region PDA报表
  4599. /// <summary>
  4600. /// 产品质量跟踪
  4601. /// </summary>
  4602. /// <param name="accountCode"></param>
  4603. /// <param name="userCode"></param>
  4604. /// <param name="userPassword"></param>
  4605. /// <param name="sessionKey"></param>
  4606. /// <param name="se"></param>
  4607. /// <returns></returns>
  4608. public ActionResult GetRPT040104SData(string accountCode, string userCode, string userPassword, string sessionKey, RPT040104_SE se)
  4609. {
  4610. ActionResult actionResult = new ActionResult();
  4611. try
  4612. {
  4613. // 验证请求头信息
  4614. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4615. // 验证失败
  4616. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4617. {
  4618. return actionResult;
  4619. }
  4620. se.CreateTimeStart = Convert.ToDateTime(se.CreateTimeStartPDA);
  4621. se.CreateTimeEnd = Convert.ToDateTime(se.CreateTimeEndPDA).AddDays(1);
  4622. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4623. () => PDAModuleLogic.GetRPT040104SData(sUserInfo, se));
  4624. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4625. {
  4626. actionResult.Status = (int)Constant.PDAResult.Fail;
  4627. actionResult.Message = Messages.MSG_CMN_I002;
  4628. }
  4629. else
  4630. {
  4631. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4632. actionResult.Status = (int)Constant.PDAResult.Success;
  4633. }
  4634. }
  4635. catch (Exception ex)
  4636. {
  4637. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4638. OutputLog.TraceLog(LogPriority.Error,
  4639. this.ToString(),
  4640. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4641. ex.ToString(),
  4642. LocalPath.LogExePath);
  4643. actionResult.Status = (int)Constant.PDAResult.Exception;
  4644. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4645. }
  4646. return actionResult;
  4647. }
  4648. /// <summary>
  4649. /// 工号产量质量分析表
  4650. /// </summary>
  4651. /// <param name="accountCode"></param>
  4652. /// <param name="userCode"></param>
  4653. /// <param name="userPassword"></param>
  4654. /// <param name="sessionKey"></param>
  4655. /// <param name="se"></param>
  4656. /// <returns></returns>
  4657. public ActionResult GetFP00002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4658. int rptSProcedureID, string workcode, string date)
  4659. {
  4660. ActionResult actionResult = new ActionResult();
  4661. try
  4662. {
  4663. // 验证请求头信息
  4664. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4665. // 验证失败
  4666. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4667. {
  4668. return actionResult;
  4669. }
  4670. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4671. () => PDAModuleLogic.GetFP00002Data(sUserInfo, rptSProcedureID, workcode, Convert.ToDateTime(date)));
  4672. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4673. {
  4674. actionResult.Status = (int)Constant.PDAResult.Fail;
  4675. actionResult.Message = Messages.MSG_CMN_I002;
  4676. }
  4677. else
  4678. {
  4679. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4680. actionResult.Status = (int)Constant.PDAResult.Success;
  4681. }
  4682. }
  4683. catch (Exception ex)
  4684. {
  4685. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4686. OutputLog.TraceLog(LogPriority.Error,
  4687. this.ToString(),
  4688. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4689. ex.ToString(),
  4690. LocalPath.LogExePath);
  4691. actionResult.Status = (int)Constant.PDAResult.Exception;
  4692. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4693. }
  4694. return actionResult;
  4695. }
  4696. /// <summary>
  4697. /// 工号产量质量分析表(中陶)
  4698. /// </summary>
  4699. /// <param name="accountCode"></param>
  4700. /// <param name="userCode"></param>
  4701. /// <param name="userPassword"></param>
  4702. /// <param name="sessionKey"></param>
  4703. /// <param name="se"></param>
  4704. /// <returns></returns>
  4705. public ActionResult GetFP00002_1Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4706. int rptSProcedureID, string workcode, string date, string goodscode)
  4707. {
  4708. ActionResult actionResult = new ActionResult();
  4709. try
  4710. {
  4711. // 验证请求头信息
  4712. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4713. // 验证失败
  4714. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4715. {
  4716. return actionResult;
  4717. }
  4718. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4719. () => PDAModuleLogic.GetFP00002_1Data(sUserInfo, rptSProcedureID, workcode,
  4720. Convert.ToDateTime(date), goodscode));
  4721. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4722. {
  4723. actionResult.Status = (int)Constant.PDAResult.Fail;
  4724. actionResult.Message = Messages.MSG_CMN_I002;
  4725. }
  4726. else
  4727. {
  4728. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4729. actionResult.Status = (int)Constant.PDAResult.Success;
  4730. }
  4731. }
  4732. catch (Exception ex)
  4733. {
  4734. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4735. OutputLog.TraceLog(LogPriority.Error,
  4736. this.ToString(),
  4737. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4738. ex.ToString(),
  4739. LocalPath.LogExePath);
  4740. actionResult.Status = (int)Constant.PDAResult.Exception;
  4741. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4742. }
  4743. return actionResult;
  4744. }
  4745. /// <summary>
  4746. /// 半检数据统计表
  4747. /// </summary>
  4748. /// <param name="accountCode"></param>
  4749. /// <param name="userCode"></param>
  4750. /// <param name="userPassword"></param>
  4751. /// <param name="sessionKey"></param>
  4752. /// <param name="se"></param>
  4753. /// <returns></returns>
  4754. public ActionResult GetPDARPT000001Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4755. string workcode, string datebegin, string dateend)
  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. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4768. DateTime datetimeend = Convert.ToDateTime(dateend);
  4769. datetimebegin = datetimebegin.Date;
  4770. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4771. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4772. () => PDAModuleLogic.GetPDARPT000001Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4773. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4774. {
  4775. actionResult.Status = (int)Constant.PDAResult.Fail;
  4776. actionResult.Message = Messages.MSG_CMN_I002;
  4777. }
  4778. else
  4779. {
  4780. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4781. actionResult.Status = (int)Constant.PDAResult.Success;
  4782. }
  4783. }
  4784. catch (Exception ex)
  4785. {
  4786. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4787. OutputLog.TraceLog(LogPriority.Error,
  4788. this.ToString(),
  4789. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4790. ex.ToString(),
  4791. LocalPath.LogExePath);
  4792. actionResult.Status = (int)Constant.PDAResult.Exception;
  4793. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4794. }
  4795. return actionResult;
  4796. }
  4797. /// <summary>
  4798. /// 工号质量统计表
  4799. /// </summary>
  4800. /// <param name="accountCode"></param>
  4801. /// <param name="userCode"></param>
  4802. /// <param name="userPassword"></param>
  4803. /// <param name="sessionKey"></param>
  4804. /// <param name="se"></param>
  4805. /// <returns></returns>
  4806. public ActionResult GetPDARPT000002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4807. int rptSProcedureID, string workcode, string datebegin, string dateend)
  4808. {
  4809. ActionResult actionResult = new ActionResult();
  4810. try
  4811. {
  4812. // 验证请求头信息
  4813. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4814. // 验证失败
  4815. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4816. {
  4817. return actionResult;
  4818. }
  4819. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4820. DateTime datetimeend = Convert.ToDateTime(dateend);
  4821. datetimebegin = datetimebegin.Date;
  4822. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4823. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4824. () => PDAModuleLogic.GetPDARPT000002Data(sUserInfo, rptSProcedureID, workcode, datetimebegin, datetimeend));
  4825. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4826. {
  4827. actionResult.Status = (int)Constant.PDAResult.Fail;
  4828. actionResult.Message = Messages.MSG_CMN_I002;
  4829. }
  4830. else
  4831. {
  4832. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4833. actionResult.Status = (int)Constant.PDAResult.Success;
  4834. }
  4835. }
  4836. catch (Exception ex)
  4837. {
  4838. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4839. OutputLog.TraceLog(LogPriority.Error,
  4840. this.ToString(),
  4841. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4842. ex.ToString(),
  4843. LocalPath.LogExePath);
  4844. actionResult.Status = (int)Constant.PDAResult.Exception;
  4845. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4846. }
  4847. return actionResult;
  4848. }
  4849. /// <summary>
  4850. /// 损坯数据统计表
  4851. /// </summary>
  4852. /// <param name="accountCode"></param>
  4853. /// <param name="userCode"></param>
  4854. /// <param name="userPassword"></param>
  4855. /// <param name="sessionKey"></param>
  4856. /// <param name="se"></param>
  4857. /// <returns></returns>
  4858. public ActionResult GetPDARPT000003Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4859. string workcode, string datebegin, string dateend)
  4860. {
  4861. ActionResult actionResult = new ActionResult();
  4862. try
  4863. {
  4864. // 验证请求头信息
  4865. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4866. // 验证失败
  4867. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4868. {
  4869. return actionResult;
  4870. }
  4871. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4872. DateTime datetimeend = Convert.ToDateTime(dateend);
  4873. datetimebegin = datetimebegin.Date;
  4874. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4875. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4876. () => PDAModuleLogic.GetPDARPT000003Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4877. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4878. {
  4879. actionResult.Status = (int)Constant.PDAResult.Fail;
  4880. actionResult.Message = Messages.MSG_CMN_I002;
  4881. }
  4882. else
  4883. {
  4884. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4885. actionResult.Status = (int)Constant.PDAResult.Success;
  4886. }
  4887. }
  4888. catch (Exception ex)
  4889. {
  4890. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4891. OutputLog.TraceLog(LogPriority.Error,
  4892. this.ToString(),
  4893. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4894. ex.ToString(),
  4895. LocalPath.LogExePath);
  4896. actionResult.Status = (int)Constant.PDAResult.Exception;
  4897. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4898. }
  4899. return actionResult;
  4900. }
  4901. #endregion
  4902. /// <summary>
  4903. /// 取得报表数据源数据
  4904. /// </summary>
  4905. /// <param name="accountCode"></param>
  4906. /// <param name="userCode"></param>
  4907. /// <param name="userPassword"></param>
  4908. /// <param name="sessionKey"></param>
  4909. /// <returns></returns>
  4910. public ActionResult GetRptProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey)
  4911. {
  4912. ActionResult actionResult = new ActionResult();
  4913. try
  4914. {
  4915. // 验证请求头信息
  4916. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4917. // 验证失败
  4918. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4919. {
  4920. return actionResult;
  4921. }
  4922. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4923. () => ReportModuleLogic.GetRptProcedureModule(sUserInfo));
  4924. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4925. {
  4926. actionResult.Status = (int)Constant.PDAResult.Fail;
  4927. actionResult.Message = Messages.MSG_CMN_I002;
  4928. }
  4929. else
  4930. {
  4931. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4932. actionResult.Status = (int)Constant.PDAResult.Success;
  4933. }
  4934. }
  4935. catch (Exception ex)
  4936. {
  4937. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4938. OutputLog.TraceLog(LogPriority.Error,
  4939. this.ToString(),
  4940. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4941. ex.ToString(),
  4942. LocalPath.LogExePath);
  4943. actionResult.Status = (int)Constant.PDAResult.Exception;
  4944. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4945. }
  4946. return actionResult;
  4947. }
  4948. /// <summary>
  4949. /// 取得报表的查询数据源统计工序数据
  4950. /// </summary>
  4951. /// <param name="accountCode"></param>
  4952. /// <param name="userCode"></param>
  4953. /// <param name="userPassword"></param>
  4954. /// <param name="sessionKey"></param>
  4955. /// <param name="RptProcedureID"></param>
  4956. /// <returns></returns>
  4957. public ActionResult GetRptSourceProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey, int? RptProcedureID)
  4958. {
  4959. ActionResult actionResult = new ActionResult();
  4960. try
  4961. {
  4962. // 验证请求头信息
  4963. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4964. // 验证失败
  4965. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4966. {
  4967. return actionResult;
  4968. }
  4969. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4970. () => ReportModuleLogic.GetRptSourceProcedureModule(sUserInfo, RptProcedureID));
  4971. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4972. {
  4973. actionResult.Status = (int)Constant.PDAResult.Fail;
  4974. actionResult.Message = Messages.MSG_CMN_I002;
  4975. }
  4976. else
  4977. {
  4978. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4979. actionResult.Status = (int)Constant.PDAResult.Success;
  4980. }
  4981. }
  4982. catch (Exception ex)
  4983. {
  4984. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4985. OutputLog.TraceLog(LogPriority.Error,
  4986. this.ToString(),
  4987. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4988. ex.ToString(),
  4989. LocalPath.LogExePath);
  4990. actionResult.Status = (int)Constant.PDAResult.Exception;
  4991. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4992. }
  4993. return actionResult;
  4994. }
  4995. /// <summary>
  4996. /// 获取用户是否有统计产成品权限
  4997. /// </summary>
  4998. /// <param name="accountCode"></param>
  4999. /// <param name="userCode"></param>
  5000. /// <param name="userPassword"></param>
  5001. /// <param name="sessionKey"></param>
  5002. /// <returns></returns>
  5003. public ActionResult GetStatisticsFinishedProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5004. {
  5005. ActionResult actionResult = new ActionResult();
  5006. try
  5007. {
  5008. // 验证请求头信息
  5009. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5010. // 验证失败
  5011. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5012. {
  5013. return actionResult;
  5014. }
  5015. int returnValue = ServiceInvoker.Invoke<int>(this,
  5016. () => PDAModuleLogic.GetStatisticsFinishedProductFuntion(sUserInfo));
  5017. actionResult.Result = JsonHelper.ToJson(returnValue);
  5018. actionResult.Status = (int)Constant.PDAResult.Success;
  5019. }
  5020. catch (Exception ex)
  5021. {
  5022. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5023. OutputLog.TraceLog(LogPriority.Error,
  5024. this.ToString(),
  5025. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5026. ex.ToString(),
  5027. LocalPath.LogExePath);
  5028. actionResult.Status = (int)Constant.PDAResult.Exception;
  5029. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5030. }
  5031. return actionResult;
  5032. }
  5033. /// <summary>
  5034. /// 获取用户是否有盘点权限
  5035. /// </summary>
  5036. /// <param name="accountCode"></param>
  5037. /// <param name="userCode"></param>
  5038. /// <param name="userPassword"></param>
  5039. /// <param name="sessionKey"></param>
  5040. /// <returns></returns>
  5041. public ActionResult GetInCheckedFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5042. {
  5043. ActionResult actionResult = new ActionResult();
  5044. try
  5045. {
  5046. // 验证请求头信息
  5047. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5048. // 验证失败
  5049. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5050. {
  5051. return actionResult;
  5052. }
  5053. int returnValue = ServiceInvoker.Invoke<int>(this,
  5054. () => PDAModuleLogic.GetInCheckedFuntion(sUserInfo));
  5055. actionResult.Result = JsonHelper.ToJson(returnValue);
  5056. actionResult.Status = (int)Constant.PDAResult.Success;
  5057. }
  5058. catch (Exception ex)
  5059. {
  5060. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5061. OutputLog.TraceLog(LogPriority.Error,
  5062. this.ToString(),
  5063. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5064. ex.ToString(),
  5065. LocalPath.LogExePath);
  5066. actionResult.Status = (int)Constant.PDAResult.Exception;
  5067. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5068. }
  5069. return actionResult;
  5070. }
  5071. /// <summary>
  5072. /// 根据条件查询是否存在班次配置
  5073. /// </summary>
  5074. /// <param name="accountCode"></param>
  5075. /// <param name="userCode"></param>
  5076. /// <param name="userPassword"></param>
  5077. /// <param name="sessionKey"></param>
  5078. /// <param name="userCode">工号编码</param>
  5079. /// <returns></returns>
  5080. public ActionResult GetClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, string uCode)
  5081. {
  5082. ActionResult actionResult = new ActionResult();
  5083. try
  5084. {
  5085. // 验证请求头信息
  5086. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5087. // 验证失败
  5088. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5089. {
  5090. return actionResult;
  5091. }
  5092. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  5093. () => PDAModuleLogic.GetClassesSetting(uCode, sUserInfo));
  5094. actionResult.Result = JsonHelper.ToJson(ds);
  5095. actionResult.Status = (int)Constant.PDAResult.Success;
  5096. }
  5097. catch (Exception ex)
  5098. {
  5099. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5100. OutputLog.TraceLog(LogPriority.Error,
  5101. this.ToString(),
  5102. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5103. ex.ToString(),
  5104. LocalPath.LogExePath);
  5105. actionResult.Status = (int)Constant.PDAResult.Exception;
  5106. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5107. }
  5108. return actionResult;
  5109. }
  5110. /// <summary>
  5111. /// 报损工序查出工号根据生产数据ID
  5112. /// </summary>
  5113. /// <param name="accountCode"></param>
  5114. /// <param name="userCode"></param>
  5115. /// <param name="userPassword"></param>
  5116. /// <param name="sessionKey"></param>
  5117. /// <param name="ProductionDataID">生产数据ID</param>
  5118. /// <returns></returns>
  5119. public ActionResult GetScrapProductUserCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  5120. {
  5121. ActionResult actionResult = new ActionResult();
  5122. try
  5123. {
  5124. // 验证请求头信息
  5125. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5126. // 验证失败
  5127. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5128. {
  5129. return actionResult;
  5130. }
  5131. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5132. () => PMModuleLogic.GetScrapProductUserCodeByProductionDataID(ProductionDataID));
  5133. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5134. {
  5135. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5136. actionResult.Status = (int)Constant.PDAResult.Success;
  5137. }
  5138. else
  5139. {
  5140. actionResult.Status = (int)Constant.PDAResult.Fail;
  5141. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5142. }
  5143. }
  5144. catch (Exception ex)
  5145. {
  5146. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5147. OutputLog.TraceLog(LogPriority.Error,
  5148. this.ToString(),
  5149. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5150. ex.ToString(),
  5151. LocalPath.LogExePath);
  5152. actionResult.Status = (int)Constant.PDAResult.Exception;
  5153. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5154. }
  5155. return actionResult;
  5156. }
  5157. /// <summary>
  5158. /// 在入窑工序检验窑车号是否存在
  5159. /// </summary>
  5160. /// <param name="accountCode"></param>
  5161. /// <param name="userCode"></param>
  5162. /// <param name="userPassword"></param>
  5163. /// <param name="sessionKey"></param>
  5164. /// <param name="kilncarcode">窑车编码</param>
  5165. /// <param name="procedureid">工序ID</param>
  5166. /// <returns></returns>
  5167. public ActionResult CheckKilnCarByIntoCar2(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  5168. {
  5169. ActionResult actionResult = new ActionResult();
  5170. try
  5171. {
  5172. // 验证请求头信息
  5173. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5174. // 验证失败
  5175. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5176. {
  5177. return actionResult;
  5178. }
  5179. int returnValue = ServiceInvoker.Invoke<int>(this,
  5180. () => PMModuleLogicDAL.CheckKilnCarByIntoCar2(kilncarcode, procedureid, sUserInfo));
  5181. if (returnValue == 1)
  5182. {
  5183. actionResult.Result = JsonHelper.ToJson(returnValue);
  5184. actionResult.Status = (int)Constant.PDAResult.Success;
  5185. }
  5186. else
  5187. {
  5188. actionResult.Status = (int)Constant.PDAResult.Fail;
  5189. if (returnValue == -99)
  5190. actionResult.Message = "窑炉车号无效";
  5191. else if (returnValue == -98)
  5192. actionResult.Message = "窑车己无产品";
  5193. else if (returnValue == -97)
  5194. actionResult.Message = "窑车没有入窑,不可以撤销";
  5195. else if (returnValue == -1)
  5196. actionResult.Message = "保存失败";
  5197. }
  5198. }
  5199. catch (Exception ex)
  5200. {
  5201. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5202. OutputLog.TraceLog(LogPriority.Error,
  5203. this.ToString(),
  5204. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5205. ex.ToString(),
  5206. LocalPath.LogExePath);
  5207. actionResult.Status = (int)Constant.PDAResult.Exception;
  5208. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5209. }
  5210. return actionResult;
  5211. }
  5212. /// <summary>
  5213. /// 撤销包装
  5214. /// </summary>
  5215. /// <param name="accountCode"></param>
  5216. /// <param name="userCode"></param>
  5217. /// <param name="userPassword"></param>
  5218. /// <param name="sessionKey"></param>
  5219. /// <param name="barcode"></param>
  5220. /// <returns></returns>
  5221. public ActionResult AddChancelFinishedproduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5222. {
  5223. ActionResult actionResult = new ActionResult();
  5224. try
  5225. {
  5226. // 验证请求头信息
  5227. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5228. // 验证失败
  5229. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5230. {
  5231. return actionResult;
  5232. }
  5233. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5234. () => PMModuleLogicDAL.AddChancelFinishedproduct(barcode, sUserInfo));
  5235. if (Convert.ToInt32(returnValue.Result) > 0)
  5236. {
  5237. actionResult.Result = JsonHelper.ToJson(returnValue);
  5238. actionResult.Status = (int)Constant.PDAResult.Success;
  5239. }
  5240. else
  5241. {
  5242. actionResult.Status = (int)Constant.PDAResult.Fail;
  5243. if (Convert.ToInt32(returnValue.Result) == -1)
  5244. actionResult.Message = "产品条码不存在包装记录";
  5245. else if (Convert.ToInt32(returnValue.Result) == -200)
  5246. actionResult.Message = returnValue.Message;
  5247. else
  5248. actionResult.Message = "成品撤销失败";
  5249. }
  5250. }
  5251. catch (Exception ex)
  5252. {
  5253. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5254. OutputLog.TraceLog(LogPriority.Error,
  5255. this.ToString(),
  5256. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5257. ex.ToString(),
  5258. LocalPath.LogExePath);
  5259. actionResult.Status = (int)Constant.PDAResult.Exception;
  5260. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5261. }
  5262. return actionResult;
  5263. }
  5264. /*
  5265. /// <summary>
  5266. /// 获取用户是否有撤销包装权限
  5267. /// </summary>
  5268. /// <param name="accountCode"></param>
  5269. /// <param name="userCode"></param>
  5270. /// <param name="userPassword"></param>
  5271. /// <param name="sessionKey"></param>
  5272. /// <returns></returns>
  5273. public ActionResult GetChancelFinishedproductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5274. {
  5275. ActionResult actionResult = new ActionResult();
  5276. try
  5277. {
  5278. // 验证请求头信息
  5279. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5280. // 验证失败
  5281. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5282. {
  5283. return actionResult;
  5284. }
  5285. int returnValue = ServiceInvoker.Invoke<int>(this,
  5286. () => PDAModuleLogic.GetChancelFinishedproductFuntion(sUserInfo));
  5287. actionResult.Result = JsonHelper.ToJson(returnValue);
  5288. actionResult.Status = (int)Constant.PDAResult.Success;
  5289. }
  5290. catch (Exception ex)
  5291. {
  5292. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5293. OutputLog.TraceLog(LogPriority.Error,
  5294. this.ToString(),
  5295. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5296. ex.ToString(),
  5297. LocalPath.LogExePath);
  5298. actionResult.Status = (int)Constant.PDAResult.Exception;
  5299. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5300. }
  5301. return actionResult;
  5302. }
  5303. */
  5304. /// <summary>
  5305. /// 窑车状态明细表查询
  5306. /// </summary>
  5307. /// <param name="accountCode"></param>
  5308. /// <param name="userCode"></param>
  5309. /// <param name="userPassword"></param>
  5310. /// <param name="sessionKey"></param>
  5311. /// <param name="kilnCarCode"></param>
  5312. /// <returns></returns>
  5313. public ActionResult GetKilnCarStatusDetailByCode(string accountCode, string userCode, string userPassword, string sessionKey, string kilnCarCode)
  5314. {
  5315. ActionResult actionResult = new ActionResult();
  5316. try
  5317. {
  5318. // 验证请求头信息
  5319. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5320. // 验证失败
  5321. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5322. {
  5323. return actionResult;
  5324. }
  5325. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5326. () => ReportModuleLogic.GetKilnCarStatusDetailByCode(kilnCarCode, sUserInfo));
  5327. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  5328. {
  5329. actionResult.Status = (int)Constant.PDAResult.Fail;
  5330. actionResult.Message = Messages.MSG_CMN_I002;
  5331. }
  5332. else
  5333. {
  5334. actionResult.Result = JsonHelper.ToJson(sre.Data);
  5335. actionResult.Status = (int)Constant.PDAResult.Success;
  5336. }
  5337. }
  5338. catch (Exception ex)
  5339. {
  5340. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5341. OutputLog.TraceLog(LogPriority.Error,
  5342. this.ToString(),
  5343. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5344. ex.ToString(),
  5345. LocalPath.LogExePath);
  5346. actionResult.Status = (int)Constant.PDAResult.Exception;
  5347. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5348. }
  5349. return actionResult;
  5350. }
  5351. /// <summary>
  5352. /// 损坯撤销
  5353. /// </summary>
  5354. /// <param name="accountCode"></param>
  5355. /// <param name="userCode"></param>
  5356. /// <param name="userPassword"></param>
  5357. /// <param name="sessionKey"></param>
  5358. /// <param name="barcode"></param>
  5359. /// <returns></returns>
  5360. public ActionResult AddCancelScrapProduction(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5361. {
  5362. ActionResult actionResult = new ActionResult();
  5363. try
  5364. {
  5365. // 验证请求头信息
  5366. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5367. // 验证失败
  5368. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5369. {
  5370. return actionResult;
  5371. }
  5372. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5373. () => PMModuleLogicDAL.AddCancelScrapProduction(barcode, sUserInfo));
  5374. if (Convert.ToInt32(returnValue.Result) > 0)
  5375. {
  5376. actionResult.Result = JsonHelper.ToJson(returnValue);
  5377. actionResult.Status = (int)Constant.PDAResult.Success;
  5378. }
  5379. else
  5380. {
  5381. actionResult.Status = (int)Constant.PDAResult.Fail;
  5382. if (Convert.ToInt32(returnValue.Result) == -1)
  5383. actionResult.Message = "此产品没有损坯,不能撤销";
  5384. else if (Convert.ToInt32(returnValue.Result) == -200)
  5385. actionResult.Message = returnValue.Message;
  5386. else
  5387. actionResult.Message = "损坯撤销失败";
  5388. }
  5389. }
  5390. catch (Exception ex)
  5391. {
  5392. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5393. OutputLog.TraceLog(LogPriority.Error,
  5394. this.ToString(),
  5395. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5396. ex.ToString(),
  5397. LocalPath.LogExePath);
  5398. actionResult.Status = (int)Constant.PDAResult.Exception;
  5399. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5400. }
  5401. return actionResult;
  5402. }
  5403. /*
  5404. /// <summary>
  5405. /// 获取用户是否有损坯撤销权限
  5406. /// </summary>
  5407. /// <param name="accountCode"></param>
  5408. /// <param name="userCode"></param>
  5409. /// <param name="userPassword"></param>
  5410. /// <param name="sessionKey"></param>
  5411. /// <returns></returns>
  5412. public ActionResult GetCancelScrapProductionFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5413. {
  5414. ActionResult actionResult = new ActionResult();
  5415. try
  5416. {
  5417. // 验证请求头信息
  5418. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5419. // 验证失败
  5420. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5421. {
  5422. return actionResult;
  5423. }
  5424. int returnValue = ServiceInvoker.Invoke<int>(this,
  5425. () => PDAModuleLogic.GetCancelScrapProductionFuntion(sUserInfo));
  5426. actionResult.Result = JsonHelper.ToJson(returnValue);
  5427. actionResult.Status = (int)Constant.PDAResult.Success;
  5428. }
  5429. catch (Exception ex)
  5430. {
  5431. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5432. OutputLog.TraceLog(LogPriority.Error,
  5433. this.ToString(),
  5434. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5435. ex.ToString(),
  5436. LocalPath.LogExePath);
  5437. actionResult.Status = (int)Constant.PDAResult.Exception;
  5438. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5439. }
  5440. return actionResult;
  5441. }
  5442. */
  5443. /// <summary>
  5444. /// 获取条码注浆信息
  5445. /// </summary>
  5446. /// <param name="accountCode"></param>
  5447. /// <param name="userCode"></param>
  5448. /// <param name="userPassword"></param>
  5449. /// <param name="sessionKey"></param>
  5450. /// <returns></returns>
  5451. public ActionResult GetGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5452. {
  5453. ActionResult actionResult = new ActionResult();
  5454. try
  5455. {
  5456. // 验证请求头信息
  5457. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5458. // 验证失败
  5459. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5460. {
  5461. return actionResult;
  5462. }
  5463. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5464. () => PMModuleLogic.GetGroutingInfoBybarcode(barcode, sUserInfo));
  5465. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5466. {
  5467. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5468. actionResult.Status = (int)Constant.PDAResult.Success;
  5469. }
  5470. else
  5471. {
  5472. actionResult.Status = (int)Constant.PDAResult.Fail;
  5473. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5474. }
  5475. }
  5476. catch (Exception ex)
  5477. {
  5478. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5479. OutputLog.TraceLog(LogPriority.Error,
  5480. this.ToString(),
  5481. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5482. ex.ToString(),
  5483. LocalPath.LogExePath);
  5484. actionResult.Status = (int)Constant.PDAResult.Exception;
  5485. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5486. }
  5487. return actionResult;
  5488. }
  5489. /// <summary>
  5490. /// 获取条码注浆信息
  5491. /// </summary>
  5492. /// <param name="accountCode"></param>
  5493. /// <param name="userCode"></param>
  5494. /// <param name="userPassword"></param>
  5495. /// <param name="sessionKey"></param>
  5496. /// <returns></returns>
  5497. public ActionResult GetFinishedProductGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5498. {
  5499. ActionResult actionResult = new ActionResult();
  5500. try
  5501. {
  5502. // 验证请求头信息
  5503. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5504. // 验证失败
  5505. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5506. {
  5507. return actionResult;
  5508. }
  5509. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5510. () => PMModuleLogic.GetFinishedProductGroutingInfoBybarcode(barcode, sUserInfo));
  5511. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5512. {
  5513. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5514. actionResult.Status = (int)Constant.PDAResult.Success;
  5515. }
  5516. else
  5517. {
  5518. actionResult.Status = (int)Constant.PDAResult.Fail;
  5519. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5520. }
  5521. }
  5522. catch (Exception ex)
  5523. {
  5524. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5525. OutputLog.TraceLog(LogPriority.Error,
  5526. this.ToString(),
  5527. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5528. ex.ToString(),
  5529. LocalPath.LogExePath);
  5530. actionResult.Status = (int)Constant.PDAResult.Exception;
  5531. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5532. }
  5533. return actionResult;
  5534. }
  5535. /// <summary>
  5536. /// 公坯设定
  5537. /// </summary>
  5538. /// <param name="accountCode"></param>
  5539. /// <param name="userCode"></param>
  5540. /// <param name="userPassword"></param>
  5541. /// <param name="sessionKey"></param>
  5542. /// <param name="barcode"></param>
  5543. /// <returns></returns>
  5544. public ActionResult AddPublicBodyProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5545. {
  5546. ActionResult actionResult = new ActionResult();
  5547. try
  5548. {
  5549. // 验证请求头信息
  5550. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5551. // 验证失败
  5552. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5553. {
  5554. return actionResult;
  5555. }
  5556. int returnValue = ServiceInvoker.Invoke<int>(this,
  5557. () => PMModuleLogicDAL.AddPublicBodyProduct(barcode, sUserInfo));
  5558. if (returnValue > 0)
  5559. {
  5560. actionResult.Result = JsonHelper.ToJson(returnValue);
  5561. actionResult.Status = (int)Constant.PDAResult.Success;
  5562. }
  5563. else
  5564. {
  5565. actionResult.Status = (int)Constant.PDAResult.Fail;
  5566. if (returnValue == -1)
  5567. actionResult.Message = "此产品不在生产线上";
  5568. else if (returnValue == -2)
  5569. actionResult.Message = "该产品已经标识为公坯";
  5570. else
  5571. actionResult.Message = "公坯设定失败";
  5572. }
  5573. }
  5574. catch (Exception ex)
  5575. {
  5576. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5577. OutputLog.TraceLog(LogPriority.Error,
  5578. this.ToString(),
  5579. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5580. ex.ToString(),
  5581. LocalPath.LogExePath);
  5582. actionResult.Status = (int)Constant.PDAResult.Exception;
  5583. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5584. }
  5585. return actionResult;
  5586. }
  5587. /*
  5588. /// <summary>
  5589. /// 获取用户是否有公坯设定
  5590. /// </summary>
  5591. /// <param name="accountCode"></param>
  5592. /// <param name="userCode"></param>
  5593. /// <param name="userPassword"></param>
  5594. /// <param name="sessionKey"></param>
  5595. /// <returns></returns>
  5596. public ActionResult GetPublicBodyProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5597. {
  5598. ActionResult actionResult = new ActionResult();
  5599. try
  5600. {
  5601. // 验证请求头信息
  5602. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5603. // 验证失败
  5604. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5605. {
  5606. return actionResult;
  5607. }
  5608. int returnValue = ServiceInvoker.Invoke<int>(this,
  5609. () => PDAModuleLogic.GetPublicBodyProductFuntion(sUserInfo));
  5610. actionResult.Result = JsonHelper.ToJson(returnValue);
  5611. actionResult.Status = (int)Constant.PDAResult.Success;
  5612. }
  5613. catch (Exception ex)
  5614. {
  5615. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5616. OutputLog.TraceLog(LogPriority.Error,
  5617. this.ToString(),
  5618. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5619. ex.ToString(),
  5620. LocalPath.LogExePath);
  5621. actionResult.Status = (int)Constant.PDAResult.Exception;
  5622. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5623. }
  5624. return actionResult;
  5625. }
  5626. */
  5627. /// <summary>
  5628. /// 校验产品条码是否可以走到该工序
  5629. /// </summary>
  5630. /// <param name="accountCode">帐套code</param>
  5631. /// <param name="userCode">用户code</param>
  5632. /// <param name="userPassword">用户密码</param>
  5633. /// <param name="sessionKey">本次登陆密钥</param>
  5634. /// <param name="procedureID">工序ID</param>
  5635. /// <param name="barcode">条码</param>
  5636. /// <returns></returns>
  5637. /// <remarks>
  5638. /// 陈冰 2014.09.18 新建
  5639. /// </remarks>
  5640. public ActionResult CheckBarcodeDeliverMud(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  5641. {
  5642. ActionResult actionResult = new ActionResult();
  5643. try
  5644. {
  5645. // 验证请求头信息
  5646. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5647. // 验证失败
  5648. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5649. {
  5650. return actionResult;
  5651. }
  5652. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  5653. () => PMModuleLogic.CheckBarcodeDeliverMud(procedureID, barcode, sUserInfo));
  5654. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  5655. {
  5656. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  5657. actionResult.Status = (int)Constant.PDAResult.Success;
  5658. }
  5659. else
  5660. {
  5661. actionResult.Status = (int)Constant.PDAResult.Fail;
  5662. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5663. }
  5664. }
  5665. catch (Exception ex)
  5666. {
  5667. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5668. OutputLog.TraceLog(LogPriority.Error,
  5669. this.ToString(),
  5670. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5671. ex.ToString(),
  5672. LocalPath.LogExePath);
  5673. actionResult.Status = (int)Constant.PDAResult.Exception;
  5674. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5675. }
  5676. return actionResult;
  5677. }
  5678. /// <summary>
  5679. /// 获取用户所有菜单权限
  5680. /// </summary>
  5681. /// <param name="accountCode"></param>
  5682. /// <param name="userCode"></param>
  5683. /// <param name="userPassword"></param>
  5684. /// <param name="sessionKey"></param>
  5685. /// <returns></returns>
  5686. public ActionResult GetUserAllFunction(string accountCode, string userCode, string userPassword, string sessionKey)
  5687. {
  5688. ActionResult actionResult = new ActionResult();
  5689. try
  5690. {
  5691. // 验证请求头信息
  5692. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5693. // 验证失败
  5694. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5695. {
  5696. return actionResult;
  5697. }
  5698. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5699. () => PDAModuleLogic.GetUserAllFunction(sUserInfo));
  5700. actionResult.Result = JsonHelper.ToJson(returnValue);
  5701. actionResult.Status = (int)Constant.PDAResult.Success;
  5702. }
  5703. catch (Exception ex)
  5704. {
  5705. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5706. OutputLog.TraceLog(LogPriority.Error,
  5707. this.ToString(),
  5708. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5709. ex.ToString(),
  5710. LocalPath.LogExePath);
  5711. actionResult.Status = (int)Constant.PDAResult.Exception;
  5712. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5713. }
  5714. return actionResult;
  5715. }
  5716. public ActionResult AddChancelBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5717. {
  5718. ActionResult actionResult = new ActionResult();
  5719. try
  5720. {
  5721. // 验证请求头信息
  5722. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5723. // 验证失败
  5724. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5725. {
  5726. return actionResult;
  5727. }
  5728. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5729. () => PMModuleLogicDAL.AddChancelBarCode(barcode, sUserInfo));
  5730. if (Convert.ToInt32(returnValue.Result) > 0)
  5731. {
  5732. actionResult.Result = JsonHelper.ToJson(returnValue);
  5733. actionResult.Status = (int)Constant.PDAResult.Success;
  5734. }
  5735. else
  5736. {
  5737. actionResult.Status = (int)Constant.PDAResult.Fail;
  5738. if (Convert.ToInt32(returnValue.Result) == -1)
  5739. actionResult.Message = "无效条码";
  5740. else if (Convert.ToInt32(returnValue.Result) == -2)
  5741. actionResult.Message = "已经生产完成";
  5742. else if (Convert.ToInt32(returnValue.Result) == -3)
  5743. actionResult.Message = "条码已经申请报废";
  5744. else if (Convert.ToInt32(returnValue.Result) == -4)
  5745. actionResult.Message = "此条码当前工序不允许进行撤销";
  5746. else if (Convert.ToInt32(returnValue.Result) == -5)
  5747. actionResult.Message = "此条码没有生产数据";
  5748. else if (Convert.ToInt32(returnValue.Result) == -6)
  5749. actionResult.Message = "没有当前工序权限";
  5750. else if (Convert.ToInt32(returnValue.Result) == -7)
  5751. actionResult.Message = "条码不在生产线上";
  5752. else if (Convert.ToInt32(returnValue.Result) == -8)
  5753. actionResult.Message = "操作用户无此工序的撤销范围权限";
  5754. else if (Convert.ToInt32(returnValue.Result) == -9)
  5755. actionResult.Message = "条码已经是返工状态";
  5756. else if (Convert.ToInt32(returnValue.Result) == -200)
  5757. actionResult.Message = returnValue.Message;
  5758. }
  5759. }
  5760. catch (Exception ex)
  5761. {
  5762. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5763. OutputLog.TraceLog(LogPriority.Error,
  5764. this.ToString(),
  5765. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5766. ex.ToString(),
  5767. LocalPath.LogExePath);
  5768. actionResult.Status = (int)Constant.PDAResult.Exception;
  5769. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5770. }
  5771. return actionResult;
  5772. }
  5773. public ActionResult AddChancelDeliverMudBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5774. {
  5775. ActionResult actionResult = new ActionResult();
  5776. try
  5777. {
  5778. // 验证请求头信息
  5779. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5780. // 验证失败
  5781. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5782. {
  5783. return actionResult;
  5784. }
  5785. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5786. () => PMModuleLogicDAL.AddChancelDeliverMudBarCode(barcode, sUserInfo));
  5787. if (Convert.ToInt32(returnValue.Result) > 0)
  5788. {
  5789. actionResult.Result = JsonHelper.ToJson(returnValue);
  5790. actionResult.Status = (int)Constant.PDAResult.Success;
  5791. }
  5792. else
  5793. {
  5794. actionResult.Status = (int)Constant.PDAResult.Fail;
  5795. if (Convert.ToInt32(returnValue.Result) == -1)
  5796. actionResult.Message = "无效条码";
  5797. else if (Convert.ToInt32(returnValue.Result) == -2)
  5798. actionResult.Message = "已经生产完成";
  5799. else if (Convert.ToInt32(returnValue.Result) == -3)
  5800. actionResult.Message = "条码已经申请报废";
  5801. else if (Convert.ToInt32(returnValue.Result) == -4)
  5802. actionResult.Message = "此条码当前工序不允许进行撤销";
  5803. else if (Convert.ToInt32(returnValue.Result) == -5)
  5804. actionResult.Message = "此条码没有生产数据";
  5805. else if (Convert.ToInt32(returnValue.Result) == -55)
  5806. actionResult.Message = "条码已经不在交坯工序,不允许撤销";
  5807. else if (Convert.ToInt32(returnValue.Result) == -6)
  5808. actionResult.Message = "没有任何影响行";
  5809. else if (Convert.ToInt32(returnValue.Result) == -7)
  5810. actionResult.Message = "条码不在生产线上";
  5811. else if (Convert.ToInt32(returnValue.Result) == -8)
  5812. actionResult.Message = "条码已经是返工状态";
  5813. else if (Convert.ToInt32(returnValue.Result) == -200)
  5814. actionResult.Message = returnValue.Message;
  5815. }
  5816. }
  5817. catch (Exception ex)
  5818. {
  5819. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5820. OutputLog.TraceLog(LogPriority.Error,
  5821. this.ToString(),
  5822. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5823. ex.ToString(),
  5824. LocalPath.LogExePath);
  5825. actionResult.Status = (int)Constant.PDAResult.Exception;
  5826. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5827. }
  5828. return actionResult;
  5829. }
  5830. public ActionResult GetAllLogoInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  5831. {
  5832. ActionResult actionResult = new ActionResult();
  5833. try
  5834. {
  5835. // 验证请求头信息
  5836. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5837. // 验证失败
  5838. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5839. {
  5840. return actionResult;
  5841. }
  5842. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5843. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5844. () => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5845. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5846. {
  5847. //DataView dv = returnValue.Tables[0].DefaultView;
  5848. //dv.RowFilter = "ValueFlag=1";
  5849. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5850. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5851. actionResult.Status = (int)Constant.PDAResult.Success;
  5852. }
  5853. }
  5854. catch (Exception ex)
  5855. {
  5856. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5857. OutputLog.TraceLog(LogPriority.Error,
  5858. this.ToString(),
  5859. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5860. ex.ToString(),
  5861. LocalPath.LogExePath);
  5862. actionResult.Status = (int)Constant.PDAResult.Exception;
  5863. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5864. }
  5865. return actionResult;
  5866. }
  5867. /// <summary>
  5868. /// 变更产品商标用
  5869. /// </summary>
  5870. /// <param name="accountCode"></param>
  5871. /// <param name="userCode"></param>
  5872. /// <param name="userPassword"></param>
  5873. /// <param name="sessionKey"></param>
  5874. /// <param name="goodsid"></param>
  5875. /// <returns></returns>
  5876. public ActionResult GetLogoInfoForChange(string accountCode, string userCode, string userPassword, string sessionKey
  5877. , int goodsid)
  5878. {
  5879. ActionResult actionResult = new ActionResult();
  5880. try
  5881. {
  5882. // 验证请求头信息
  5883. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5884. // 验证失败
  5885. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5886. {
  5887. return actionResult;
  5888. }
  5889. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5890. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5891. //() => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5892. () => SystemModuleLogic.GetLogoInfoForChange(sUserInfo, goodsid));
  5893. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5894. {
  5895. //DataView dv = returnValue.Tables[0].DefaultView;
  5896. //dv.RowFilter = "ValueFlag=1";
  5897. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5898. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5899. actionResult.Status = (int)Constant.PDAResult.Success;
  5900. }
  5901. }
  5902. catch (Exception ex)
  5903. {
  5904. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5905. OutputLog.TraceLog(LogPriority.Error,
  5906. this.ToString(),
  5907. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5908. ex.ToString(),
  5909. LocalPath.LogExePath);
  5910. actionResult.Status = (int)Constant.PDAResult.Exception;
  5911. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5912. }
  5913. return actionResult;
  5914. }
  5915. public ActionResult GetLogoID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  5916. {
  5917. ActionResult actionResult = new ActionResult();
  5918. try
  5919. {
  5920. // 验证请求头信息
  5921. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5922. // 验证失败
  5923. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5924. {
  5925. return actionResult;
  5926. }
  5927. int returnValue = ServiceInvoker.Invoke<int>(this,
  5928. () => PMModuleLogic.GetLogoID(procedureID, sUserInfo));
  5929. actionResult.Result = JsonHelper.ToJson(returnValue);
  5930. actionResult.Status = (int)Constant.PDAResult.Success;
  5931. }
  5932. catch (Exception ex)
  5933. {
  5934. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5935. OutputLog.TraceLog(LogPriority.Error,
  5936. this.ToString(),
  5937. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5938. ex.ToString(),
  5939. LocalPath.LogExePath);
  5940. actionResult.Status = (int)Constant.PDAResult.Exception;
  5941. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5942. }
  5943. return actionResult;
  5944. }
  5945. public ActionResult SaveBarCodeLogo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int logoid)
  5946. {
  5947. ActionResult actionResult = new ActionResult();
  5948. try
  5949. {
  5950. // 验证请求头信息
  5951. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5952. // 验证失败
  5953. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5954. {
  5955. return actionResult;
  5956. }
  5957. string returnMessage = "";
  5958. int returnValue = ServiceInvoker.Invoke<int>(this,
  5959. () => PMModuleLogicDAL.SaveBarCodeLogo(barcode, logoid, sUserInfo, out returnMessage));
  5960. actionResult.Result = JsonHelper.ToJson(returnValue);
  5961. if (returnValue > 0)
  5962. {
  5963. actionResult.Status = (int)Constant.PDAResult.Success;
  5964. }
  5965. else if (returnValue == -2)
  5966. {
  5967. //lsq 20210723 已注浆非产成品没有商标可以变更商标
  5968. //begin
  5969. //actionResult.Message = "条码不存在";
  5970. actionResult.Message = "该条码未注浆";
  5971. //end
  5972. actionResult.Status = (int)Constant.PDAResult.Fail;
  5973. }
  5974. else if (returnValue == -3)
  5975. {
  5976. actionResult.Message = "已交接的产品不能变更商标";
  5977. actionResult.Status = (int)Constant.PDAResult.Fail;
  5978. }
  5979. else
  5980. {
  5981. actionResult.Message = returnMessage;
  5982. actionResult.Status = (int)Constant.PDAResult.Fail;
  5983. }
  5984. }
  5985. catch (Exception ex)
  5986. {
  5987. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5988. OutputLog.TraceLog(LogPriority.Error,
  5989. this.ToString(),
  5990. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5991. ex.ToString(),
  5992. LocalPath.LogExePath);
  5993. actionResult.Status = (int)Constant.PDAResult.Exception;
  5994. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5995. }
  5996. return actionResult;
  5997. }
  5998. public ActionResult SaveBarCodeLogoAndGlazetype(string accountCode, string userCode, string userPassword, string sessionKey,
  5999. string barcode, int logoid, int glazetypeid)
  6000. {
  6001. ActionResult actionResult = new ActionResult();
  6002. try
  6003. {
  6004. // 验证请求头信息
  6005. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6006. // 验证失败
  6007. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6008. {
  6009. return actionResult;
  6010. }
  6011. string returnMessage = "";
  6012. int returnValue = ServiceInvoker.Invoke<int>(this,
  6013. () => PMModuleLogicDAL.SaveBarCodeLogoAndGlazetype(barcode, logoid, glazetypeid, sUserInfo, out returnMessage));
  6014. actionResult.Result = JsonHelper.ToJson(returnValue);
  6015. if (returnValue > 0)
  6016. {
  6017. actionResult.Status = (int)Constant.PDAResult.Success;
  6018. }
  6019. else
  6020. {
  6021. actionResult.Status = (int)Constant.PDAResult.Fail;
  6022. actionResult.Message = returnMessage;
  6023. }
  6024. }
  6025. catch (Exception ex)
  6026. {
  6027. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6028. OutputLog.TraceLog(LogPriority.Error,
  6029. this.ToString(),
  6030. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6031. ex.ToString(),
  6032. LocalPath.LogExePath);
  6033. actionResult.Status = (int)Constant.PDAResult.Exception;
  6034. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6035. }
  6036. return actionResult;
  6037. }
  6038. public ActionResult SaveBarCodesLogoAndGlazetype(string accountCode, string userCode, string userPassword, string sessionKey,
  6039. string barcodes, int logoid, int glazetypeid, int procedureID)
  6040. {
  6041. ActionResult actionResult = new ActionResult();
  6042. try
  6043. {
  6044. // 验证请求头信息
  6045. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6046. // 验证失败
  6047. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6048. {
  6049. return actionResult;
  6050. }
  6051. string returnMessage = "";
  6052. int returnValue = ServiceInvoker.Invoke<int>(this,
  6053. () => PMModuleLogicDAL.SaveBarCodesLogoAndGlazetype(barcodes, logoid, glazetypeid, procedureID, sUserInfo, out returnMessage));
  6054. actionResult.Result = JsonHelper.ToJson(returnValue);
  6055. if (returnValue > 0)
  6056. {
  6057. actionResult.Status = (int)Constant.PDAResult.Success;
  6058. }
  6059. else
  6060. {
  6061. actionResult.Status = (int)Constant.PDAResult.Fail;
  6062. actionResult.Message = returnMessage;
  6063. }
  6064. }
  6065. catch (Exception ex)
  6066. {
  6067. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6068. OutputLog.TraceLog(LogPriority.Error,
  6069. this.ToString(),
  6070. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6071. ex.ToString(),
  6072. LocalPath.LogExePath);
  6073. actionResult.Status = (int)Constant.PDAResult.Exception;
  6074. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6075. }
  6076. return actionResult;
  6077. }
  6078. public ActionResult GetBarCodeLogoID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6079. {
  6080. ActionResult actionResult = new ActionResult();
  6081. try
  6082. {
  6083. // 验证请求头信息
  6084. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6085. // 验证失败
  6086. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6087. {
  6088. return actionResult;
  6089. }
  6090. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  6091. () => PMModuleLogic.GetBarCodeLogoID(barcode, sUserInfo));
  6092. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  6093. {
  6094. string err_msg = returnValue.Tables[0].Rows[0]["err_msg"] + "";
  6095. if (!string.IsNullOrWhiteSpace(err_msg))
  6096. {
  6097. actionResult.Status = (int)Constant.PDAResult.Fail;
  6098. actionResult.Message = err_msg;
  6099. }
  6100. else
  6101. {
  6102. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  6103. actionResult.Status = (int)Constant.PDAResult.Success;
  6104. }
  6105. }
  6106. else
  6107. {
  6108. actionResult.Status = (int)Constant.PDAResult.Fail;
  6109. }
  6110. }
  6111. catch (Exception ex)
  6112. {
  6113. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6114. OutputLog.TraceLog(LogPriority.Error,
  6115. this.ToString(),
  6116. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6117. ex.ToString(),
  6118. LocalPath.LogExePath);
  6119. actionResult.Status = (int)Constant.PDAResult.Exception;
  6120. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6121. }
  6122. return actionResult;
  6123. }
  6124. /// <summary>
  6125. /// 半检时,入窑前检验获取此条码是否报损为废品
  6126. /// </summary>
  6127. /// <param name="accountCode"></param>
  6128. /// <param name="userCode"></param>
  6129. /// <param name="userPassword"></param>
  6130. /// <param name="sessionKey"></param>
  6131. /// <param name="barcode">产品条码</param>
  6132. /// <returns></returns>
  6133. public ActionResult CheckWasteScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6134. {
  6135. ActionResult actionResult = new ActionResult();
  6136. try
  6137. {
  6138. // 验证请求头信息
  6139. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6140. // 验证失败
  6141. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6142. {
  6143. return actionResult;
  6144. }
  6145. int returnValue = ServiceInvoker.Invoke<int>(this,
  6146. () => PMModuleLogic.CheckWasteScrapProduct(barcode));
  6147. if (returnValue != -100)
  6148. {
  6149. actionResult.Result = JsonHelper.ToJson(returnValue);
  6150. actionResult.Status = (int)Constant.PDAResult.Success;
  6151. }
  6152. else
  6153. {
  6154. actionResult.Status = (int)Constant.PDAResult.Fail;
  6155. actionResult.Message = "条码[" + barcode + "]不是废品,不能进行编辑";
  6156. }
  6157. }
  6158. catch (Exception ex)
  6159. {
  6160. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6161. OutputLog.TraceLog(LogPriority.Error,
  6162. this.ToString(),
  6163. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6164. ex.ToString(),
  6165. LocalPath.LogExePath);
  6166. actionResult.Status = (int)Constant.PDAResult.Exception;
  6167. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6168. }
  6169. return actionResult;
  6170. }
  6171. /// <summary>
  6172. /// 获取登陆帐户有无入窑前检验数据编辑权限
  6173. /// </summary>
  6174. /// <param name="accountCode"></param>
  6175. /// <param name="userCode"></param>
  6176. /// <param name="userPassword"></param>
  6177. /// <param name="sessionKey"></param>
  6178. /// <param name="usercode">工号编码</param>
  6179. /// <returns></returns>
  6180. public ActionResult GetIntoKilnCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6181. {
  6182. ActionResult actionResult = new ActionResult();
  6183. try
  6184. {
  6185. // 验证请求头信息
  6186. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6187. // 验证失败
  6188. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6189. {
  6190. return actionResult;
  6191. }
  6192. int returnValue = ServiceInvoker.Invoke<int>(this,
  6193. () => PDAModuleLogic.GetIntoKilnCheckEditFuntion(sUserInfo));
  6194. actionResult.Result = JsonHelper.ToJson(returnValue);
  6195. actionResult.Status = (int)Constant.PDAResult.Success;
  6196. }
  6197. catch (Exception ex)
  6198. {
  6199. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6200. OutputLog.TraceLog(LogPriority.Error,
  6201. this.ToString(),
  6202. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6203. ex.ToString(),
  6204. LocalPath.LogExePath);
  6205. actionResult.Status = (int)Constant.PDAResult.Exception;
  6206. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6207. }
  6208. return actionResult;
  6209. }
  6210. /// <summary>
  6211. /// 获取登陆帐户有无半检验数据编辑权限
  6212. /// </summary>
  6213. /// <param name="accountCode"></param>
  6214. /// <param name="userCode"></param>
  6215. /// <param name="userPassword"></param>
  6216. /// <param name="sessionKey"></param>
  6217. /// <param name="usercode">工号编码</param>
  6218. /// <returns></returns>
  6219. public ActionResult GetNormalCheckEditFuntion(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. int returnValue = ServiceInvoker.Invoke<int>(this,
  6232. () => PDAModuleLogic.GetNormalCheckEditFuntion(sUserInfo));
  6233. actionResult.Result = JsonHelper.ToJson(returnValue);
  6234. actionResult.Status = (int)Constant.PDAResult.Success;
  6235. }
  6236. catch (Exception ex)
  6237. {
  6238. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6239. OutputLog.TraceLog(LogPriority.Error,
  6240. this.ToString(),
  6241. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6242. ex.ToString(),
  6243. LocalPath.LogExePath);
  6244. actionResult.Status = (int)Constant.PDAResult.Exception;
  6245. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6246. }
  6247. return actionResult;
  6248. }
  6249. /// <summary>
  6250. /// 获取缺陷扣罚管理的全部数据
  6251. /// </summary>
  6252. /// <param name="accountCode"></param>
  6253. /// <param name="userCode"></param>
  6254. /// <param name="userPassword"></param>
  6255. /// <param name="sessionKey"></param>
  6256. /// <returns></returns>
  6257. public ActionResult GetAllDefectFine(string accountCode, string userCode, string userPassword, string sessionKey)
  6258. {
  6259. ActionResult actionResult = new ActionResult();
  6260. try
  6261. {
  6262. // 验证请求头信息
  6263. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6264. // 验证失败
  6265. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6266. {
  6267. return actionResult;
  6268. }
  6269. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6270. () => SystemModuleLogic.GetAllDefectFine(sUserInfo));
  6271. if (ds != null && ds.Tables[0].Rows.Count > 0)
  6272. {
  6273. DataView dv = ds.Tables[0].DefaultView;
  6274. dv.RowFilter = "valueflag=1";
  6275. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  6276. actionResult.Status = (int)Constant.PDAResult.Success;
  6277. }
  6278. else
  6279. {
  6280. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  6281. actionResult.Status = (int)Constant.PDAResult.Success;
  6282. }
  6283. }
  6284. catch (Exception ex)
  6285. {
  6286. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6287. OutputLog.TraceLog(LogPriority.Error,
  6288. this.ToString(),
  6289. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6290. ex.ToString(),
  6291. LocalPath.LogExePath);
  6292. actionResult.Status = (int)Constant.PDAResult.Exception;
  6293. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6294. }
  6295. return actionResult;
  6296. }
  6297. /// <summary>
  6298. /// 获取缺陷扣除数管理的全部数据
  6299. /// </summary>
  6300. /// <param name="accountCode"></param>
  6301. /// <param name="userCode"></param>
  6302. /// <param name="userPassword"></param>
  6303. /// <param name="sessionKey"></param>
  6304. /// <returns></returns>
  6305. public ActionResult GetAllDefectDeduction(string accountCode, string userCode, string userPassword, string sessionKey)
  6306. {
  6307. ActionResult actionResult = new ActionResult();
  6308. try
  6309. {
  6310. // 验证请求头信息
  6311. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6312. // 验证失败
  6313. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6314. {
  6315. return actionResult;
  6316. }
  6317. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6318. () => SystemModuleLogic.GetAllDefectDeduction(sUserInfo));
  6319. if (ds != null && ds.Tables[0].Rows.Count > 0)
  6320. {
  6321. DataView dv = ds.Tables[0].DefaultView;
  6322. dv.RowFilter = "valueflag=1";
  6323. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  6324. actionResult.Status = (int)Constant.PDAResult.Success;
  6325. }
  6326. else
  6327. {
  6328. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  6329. actionResult.Status = (int)Constant.PDAResult.Success;
  6330. }
  6331. }
  6332. catch (Exception ex)
  6333. {
  6334. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6335. OutputLog.TraceLog(LogPriority.Error,
  6336. this.ToString(),
  6337. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6338. ex.ToString(),
  6339. LocalPath.LogExePath);
  6340. actionResult.Status = (int)Constant.PDAResult.Exception;
  6341. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6342. }
  6343. return actionResult;
  6344. }
  6345. /// <summary>
  6346. /// 获取缺陷扣罚关系管理的全部数据
  6347. /// </summary>
  6348. /// <param name="accountCode"></param>
  6349. /// <param name="userCode"></param>
  6350. /// <param name="userPassword"></param>
  6351. /// <param name="sessionKey"></param>
  6352. /// <returns></returns>
  6353. public ActionResult GetAllDefectFineRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  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 ds = ServiceInvoker.Invoke<DataSet>(this,
  6366. () => SystemModuleLogic.GetAllDefectFineRelation(sUserInfo));
  6367. DataTable dt = new DataTable();
  6368. dt.Columns.Add("DefectID");
  6369. dt.Columns.Add("DefectFineID");
  6370. DataView dv = ds.Tables[0].DefaultView;
  6371. DataTable dtFor = dv.ToTable("defectid", true);
  6372. for (int i = 0; i < dtFor.Rows.Count; i++)
  6373. {
  6374. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6375. string substring = "";
  6376. foreach (DataRow r1 in r)
  6377. {
  6378. substring += r1["DefectFineID"].ToString() + "-" + r1["DEFECTFINECODE"].ToString() + ",";
  6379. }
  6380. if (substring != "")
  6381. {
  6382. DataRow drnew = dt.NewRow();
  6383. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6384. drnew["DefectFineID"] = substring.TrimEnd(',');
  6385. dt.Rows.Add(drnew);
  6386. }
  6387. }
  6388. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6389. actionResult.Status = (int)Constant.PDAResult.Success;
  6390. }
  6391. catch (Exception ex)
  6392. {
  6393. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6394. OutputLog.TraceLog(LogPriority.Error,
  6395. this.ToString(),
  6396. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6397. ex.ToString(),
  6398. LocalPath.LogExePath);
  6399. actionResult.Status = (int)Constant.PDAResult.Exception;
  6400. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6401. }
  6402. return actionResult;
  6403. }
  6404. /// <summary>
  6405. /// 获取缺陷扣除数关系管理的全部数据
  6406. /// </summary>
  6407. /// <param name="accountCode"></param>
  6408. /// <param name="userCode"></param>
  6409. /// <param name="userPassword"></param>
  6410. /// <param name="sessionKey"></param>
  6411. /// <returns></returns>
  6412. public ActionResult GetAllDefectDeductionRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6413. {
  6414. ActionResult actionResult = new ActionResult();
  6415. try
  6416. {
  6417. // 验证请求头信息
  6418. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6419. // 验证失败
  6420. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6421. {
  6422. return actionResult;
  6423. }
  6424. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6425. () => SystemModuleLogic.GetAllDefectDeductionRelation(sUserInfo));
  6426. DataTable dt = new DataTable();
  6427. dt.Columns.Add("DefectID");
  6428. dt.Columns.Add("DefectDeductionNum");
  6429. DataView dv = ds.Tables[0].DefaultView;
  6430. DataTable dtFor = dv.ToTable("defectid", true);
  6431. for (int i = 0; i < dtFor.Rows.Count; i++)
  6432. {
  6433. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6434. string substring = "";
  6435. foreach (DataRow r1 in r)
  6436. {
  6437. substring += r1["DefectDeductionID"].ToString() + "-" + r1["DefectDeductionNum"].ToString() + ",";
  6438. }
  6439. if (substring != "")
  6440. {
  6441. DataRow drnew = dt.NewRow();
  6442. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6443. drnew["DefectDeductionNum"] = substring.TrimEnd(',');
  6444. dt.Rows.Add(drnew);
  6445. }
  6446. }
  6447. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6448. actionResult.Status = (int)Constant.PDAResult.Success;
  6449. }
  6450. catch (Exception ex)
  6451. {
  6452. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6453. OutputLog.TraceLog(LogPriority.Error,
  6454. this.ToString(),
  6455. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6456. ex.ToString(),
  6457. LocalPath.LogExePath);
  6458. actionResult.Status = (int)Constant.PDAResult.Exception;
  6459. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6460. }
  6461. return actionResult;
  6462. }
  6463. /// <summary>
  6464. /// 获取盘点单明细
  6465. /// </summary>
  6466. /// <param name="sUserInfo"></param>
  6467. /// <returns></returns>
  6468. public ActionResult GetUpdateInCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, string incheckedno)
  6469. {
  6470. ActionResult actionResult = new ActionResult();
  6471. try
  6472. {
  6473. // 验证请求头信息
  6474. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6475. // 验证失败
  6476. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6477. {
  6478. return actionResult;
  6479. }
  6480. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6481. () => PMModuleLogic.GetUpdateInCheckedInfo(incheckedno, sUserInfo));
  6482. actionResult.Result = JsonHelper.ToJson(ds);
  6483. actionResult.Status = (int)Constant.PDAResult.Success;
  6484. }
  6485. catch (Exception ex)
  6486. {
  6487. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6488. OutputLog.TraceLog(LogPriority.Error,
  6489. this.ToString(),
  6490. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6491. ex.ToString(),
  6492. LocalPath.LogExePath);
  6493. actionResult.Status = (int)Constant.PDAResult.Exception;
  6494. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6495. }
  6496. return actionResult;
  6497. }
  6498. /// <summary>
  6499. /// 半检检验条码
  6500. /// </summary>
  6501. /// <param name="sUserInfo"></param>
  6502. /// <returns></returns>
  6503. public ActionResult SemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6504. {
  6505. ActionResult actionResult = new ActionResult();
  6506. try
  6507. {
  6508. // 验证请求头信息
  6509. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6510. // 验证失败
  6511. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6512. {
  6513. return actionResult;
  6514. }
  6515. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6516. () => PMModuleLogic.SemiCheckBarcode(barcode, sUserInfo));
  6517. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6518. if (Convert.ToInt32(resultEntity.Result) < 0)
  6519. {
  6520. actionResult.Status = (int)Constant.PDAResult.Fail;
  6521. }
  6522. else
  6523. {
  6524. actionResult.Status = (int)Constant.PDAResult.Success;
  6525. }
  6526. actionResult.Message = resultEntity.Message;
  6527. }
  6528. catch (Exception ex)
  6529. {
  6530. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6531. OutputLog.TraceLog(LogPriority.Error,
  6532. this.ToString(),
  6533. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6534. ex.ToString(),
  6535. LocalPath.LogExePath);
  6536. actionResult.Status = (int)Constant.PDAResult.Exception;
  6537. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6538. }
  6539. return actionResult;
  6540. }
  6541. /// <summary>
  6542. /// 根据条码获取经过的工序,用于绑定返工工序
  6543. /// </summary>
  6544. /// <param name="sUserInfo"></param>
  6545. /// <returns></returns>
  6546. public ActionResult GetSemiCheckPassProcedure(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6547. {
  6548. ActionResult actionResult = new ActionResult();
  6549. try
  6550. {
  6551. // 验证请求头信息
  6552. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6553. // 验证失败
  6554. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6555. {
  6556. return actionResult;
  6557. }
  6558. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6559. () => PMModuleLogic.GetSemiCheckPassProcedure(barcode));
  6560. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6561. actionResult.Status = (int)Constant.PDAResult.Success;
  6562. }
  6563. catch (Exception ex)
  6564. {
  6565. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6566. OutputLog.TraceLog(LogPriority.Error,
  6567. this.ToString(),
  6568. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6569. ex.ToString(),
  6570. LocalPath.LogExePath);
  6571. actionResult.Status = (int)Constant.PDAResult.Exception;
  6572. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6573. }
  6574. return actionResult;
  6575. }
  6576. /// <summary>
  6577. /// 获取登陆帐户有无半检状态权限
  6578. /// </summary>
  6579. /// <param name="sUserInfo"></param>
  6580. /// <returns></returns>
  6581. public ActionResult GetSemiCheckStatusFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6582. {
  6583. ActionResult actionResult = new ActionResult();
  6584. try
  6585. {
  6586. // 验证请求头信息
  6587. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6588. // 验证失败
  6589. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6590. {
  6591. return actionResult;
  6592. }
  6593. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6594. () => PMModuleLogic.GetSemiCheckStatusFuntion(sUserInfo));
  6595. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6596. actionResult.Status = (int)Constant.PDAResult.Success;
  6597. }
  6598. catch (Exception ex)
  6599. {
  6600. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6601. OutputLog.TraceLog(LogPriority.Error,
  6602. this.ToString(),
  6603. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6604. ex.ToString(),
  6605. LocalPath.LogExePath);
  6606. actionResult.Status = (int)Constant.PDAResult.Exception;
  6607. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6608. }
  6609. return actionResult;
  6610. }
  6611. /// <summary>
  6612. /// 复检状态数据源
  6613. /// </summary>
  6614. /// <param name="sUserInfo"></param>
  6615. /// <returns></returns>
  6616. public ActionResult GetSemiCheckType(string accountCode, string userCode, string userPassword, string sessionKey)
  6617. {
  6618. ActionResult actionResult = new ActionResult();
  6619. try
  6620. {
  6621. // 验证请求头信息
  6622. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6623. // 验证失败
  6624. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6625. {
  6626. return actionResult;
  6627. }
  6628. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6629. () => SystemModuleLogic.GetSemiCheckType());
  6630. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6631. actionResult.Status = (int)Constant.PDAResult.Success;
  6632. }
  6633. catch (Exception ex)
  6634. {
  6635. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6636. OutputLog.TraceLog(LogPriority.Error,
  6637. this.ToString(),
  6638. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6639. ex.ToString(),
  6640. LocalPath.LogExePath);
  6641. actionResult.Status = (int)Constant.PDAResult.Exception;
  6642. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6643. }
  6644. return actionResult;
  6645. }
  6646. /// <summary>
  6647. /// 根据半成品检验数据ID,显示半成品数据信息
  6648. /// </summary>
  6649. /// <param name="sUserInfo"></param>
  6650. /// <returns></returns>
  6651. public ActionResult GetSemiCheckByID(string accountCode, string userCode, string userPassword, string sessionKey, int semiCheckID)
  6652. {
  6653. ActionResult actionResult = new ActionResult();
  6654. try
  6655. {
  6656. // 验证请求头信息
  6657. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6658. // 验证失败
  6659. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6660. {
  6661. return actionResult;
  6662. }
  6663. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  6664. () => PMModuleLogic.GetSemiCheckByID(semiCheckID));
  6665. SemiCheckEntity[] productionDatas = new SemiCheckEntity[1];
  6666. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  6667. {
  6668. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  6669. {
  6670. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  6671. {
  6672. SemiCheckEntity productionData = new SemiCheckEntity();
  6673. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  6674. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  6675. {
  6676. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  6677. }
  6678. productionData.SemiCheckID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString());
  6679. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  6680. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  6681. productionData.SemiCheckType = reworkDs.Tables[0].Rows[i]["SemiCheckType"].ToString();
  6682. productionData.ReFine = 0;
  6683. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  6684. {
  6685. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  6686. }
  6687. productionData.ReSemiCheckType = reworkDs.Tables[0].Rows[i]["ReSemiCheckType"].ToString();
  6688. productionData.ReworkProcedureCode = reworkDs.Tables[0].Rows[i]["ReworkProcedureCode"].ToString();
  6689. productionData.ReworkProcedureName = reworkDs.Tables[0].Rows[i]["ReworkProcedureName"].ToString();
  6690. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  6691. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  6692. {
  6693. productionData.SemiCheckUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  6694. productionData.SemiCheckUserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6695. }
  6696. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  6697. {
  6698. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  6699. }
  6700. //productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6701. //productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  6702. productionData.SpecialRepairFlag = reworkDs.Tables[0].Rows[i]["SpecialRepairFlag"].ToString();
  6703. productionData.GroutingUserCode = reworkDs.Tables[0].Rows[i]["GroutingUserCode"].ToString();
  6704. productionData.GroutingNum = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GroutingNum"]);
  6705. productionData.IsPublicBody = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsPublicBody"]);
  6706. productionData.MouldCode = reworkDs.Tables[0].Rows[i]["MouldCode"].ToString();
  6707. productionData.GroutingDate = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["GroutingDate"]);
  6708. if (reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString() != "")
  6709. {
  6710. productionData.ReworkUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString());
  6711. productionData.ReworkUserCode = reworkDs.Tables[0].Rows[i]["ReworkUserCode"].ToString();
  6712. }
  6713. productionData.ReSemiCheckUserCode = reworkDs.Tables[0].Rows[i]["ReSemiCheckUserCode"].ToString();
  6714. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  6715. {
  6716. productionData.Logoid = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["Logoid"]);
  6717. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  6718. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  6719. }
  6720. productionData.SemiCheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["SemiCheckTime"]);
  6721. if (reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"] != DBNull.Value)
  6722. {
  6723. productionData.ReSemiCheckDateTimeStart = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"]);
  6724. }
  6725. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  6726. dvDefect.RowFilter = "SemiCheckID=" + reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString();
  6727. DataTable dtDefect = dvDefect.ToTable();
  6728. for (int row = 0; row < dtDefect.Rows.Count; row++)
  6729. {
  6730. // 产品缺陷
  6731. SemiCheckDefectEntity defect = new SemiCheckDefectEntity();
  6732. //defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  6733. //defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  6734. //if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  6735. //{
  6736. // defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  6737. //}
  6738. //defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  6739. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  6740. {
  6741. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  6742. }
  6743. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  6744. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  6745. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  6746. {
  6747. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  6748. }
  6749. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  6750. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  6751. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  6752. {
  6753. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  6754. }
  6755. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  6756. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  6757. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  6758. {
  6759. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  6760. }
  6761. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  6762. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  6763. //if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  6764. //{
  6765. // defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  6766. //}
  6767. //if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  6768. //{
  6769. // defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  6770. //}
  6771. //defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  6772. //defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  6773. //defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  6774. defect.Remarks = dtDefect.Rows[row]["remarks"].ToString();
  6775. if (dtDefect.Rows[row]["semicheckid"].ToString() != "")
  6776. {
  6777. defect.SemiCheckID = Convert.ToInt32(dtDefect.Rows[row]["semicheckid"].ToString());
  6778. }
  6779. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  6780. {
  6781. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  6782. }
  6783. //if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  6784. //{
  6785. // defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  6786. //}
  6787. //defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  6788. //--------责任员工-------------------
  6789. DataRow[] drRow = reworkDs.Tables[2].Select("SemiCheckDefectID=" + reworkDs.Tables[1].Rows[row]["SemiCheckDefectID"]);
  6790. if (drRow.Length > Constant.INT_IS_ZERO)
  6791. {
  6792. if (defect.DefectResponsibles == null)
  6793. {
  6794. defect.DefectResponsibles = new List<SemiCheckResponsibleEntity>();
  6795. }
  6796. foreach (DataRow r in drRow)
  6797. {
  6798. SemiCheckResponsibleEntity defectResponsible = new SemiCheckResponsibleEntity();
  6799. if (r["SemiCheckDefectID"].ToString() != "")
  6800. {
  6801. defectResponsible.SemiCheckDefectID = Convert.ToInt32(r["SemiCheckDefectID"]);
  6802. }
  6803. if (r["StaffID"].ToString() != "")
  6804. {
  6805. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  6806. }
  6807. defectResponsible.StaffCode = r["StaffCode"].ToString();
  6808. defectResponsible.StaffName = r["StaffName"].ToString();
  6809. if (r["StaffStatus"].ToString() != "")
  6810. {
  6811. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  6812. }
  6813. if (r["UJobsID"].ToString() != "")
  6814. {
  6815. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  6816. }
  6817. if (r["SJobsID"].ToString() != "")
  6818. {
  6819. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  6820. }
  6821. defect.DefectResponsibles.Add(defectResponsible);
  6822. }
  6823. }
  6824. //------------------------------
  6825. if (productionData.SemiCheckDefects == null)
  6826. {
  6827. productionData.SemiCheckDefects = new List<SemiCheckDefectEntity>();
  6828. }
  6829. productionData.SemiCheckDefects.Add(defect);
  6830. }
  6831. //if (productionDatas.PDAProductionData == null)
  6832. //{
  6833. // productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  6834. //}
  6835. productionDatas[0] = productionData;
  6836. //---------------------------------------------------------------------------------
  6837. }
  6838. }
  6839. }
  6840. actionResult.Result = JsonHelper.ToJson(productionDatas);
  6841. actionResult.Status = (int)Constant.PDAResult.Success;
  6842. }
  6843. catch (Exception ex)
  6844. {
  6845. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6846. OutputLog.TraceLog(LogPriority.Error,
  6847. this.ToString(),
  6848. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6849. ex.ToString(),
  6850. LocalPath.LogExePath);
  6851. actionResult.Status = (int)Constant.PDAResult.Exception;
  6852. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6853. }
  6854. return actionResult;
  6855. }
  6856. /// <summary>
  6857. /// 保存半检登记
  6858. /// </summary>
  6859. /// <param name="accountCode">帐套code</param>
  6860. /// <param name="userCode">用户code</param>
  6861. /// <param name="userPassword">用户密码</param>
  6862. /// <param name="sessionKey">本次登陆密钥</param>
  6863. /// <param name="entity">半检实体类</param>
  6864. /// <param name="sUserInfo">用户基本信息</param>
  6865. /// <returns></returns>
  6866. public ActionResult AddSemiCheck(string accountCode, string userCode, string userPassword, string sessionKey, SemiCheckEntity[] entityobj)
  6867. {
  6868. ActionResult actionResult = new ActionResult();
  6869. try
  6870. {
  6871. // 验证请求头信息
  6872. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6873. // 验证失败
  6874. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6875. {
  6876. return actionResult;
  6877. }
  6878. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6879. () => PMModuleLogicDAL.AddSemiCheck(entityobj, sUserInfo));
  6880. string err = string.Empty;
  6881. err = resultEntity.Message;
  6882. if (err == null)
  6883. {
  6884. err = "";
  6885. }
  6886. SemiCheckEntity entity = entityobj[0];
  6887. if (entity.SemiCheckCategory == 1) // 半检登记
  6888. {
  6889. }
  6890. else if (entity.SemiCheckCategory == 2)// 复检登记
  6891. {
  6892. err = JsonHelper.ToJson(err);
  6893. }
  6894. else if (entity.SemiCheckCategory == 3)// 撤销复检
  6895. {
  6896. err = JsonHelper.ToJson(err);
  6897. }
  6898. //actionResult.Result = JsonHelper.ToJson(err);
  6899. actionResult.Result = err;//JsonHelper.ToJson(err);
  6900. actionResult.Status = (int)Constant.PDAResult.Success;
  6901. }
  6902. catch (Exception ex)
  6903. {
  6904. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6905. OutputLog.TraceLog(LogPriority.Error,
  6906. this.ToString(),
  6907. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6908. ex.ToString(),
  6909. LocalPath.LogExePath);
  6910. actionResult.Status = (int)Constant.PDAResult.Exception;
  6911. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6912. }
  6913. return actionResult;
  6914. }
  6915. /// <summary>
  6916. /// 根据所选工号,查出缺陷责任员工
  6917. /// </summary>
  6918. /// <param name="sUserInfo"></param>
  6919. /// <returns></returns>
  6920. public ActionResult GetSemiCheckDefectStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  6921. {
  6922. ActionResult actionResult = new ActionResult();
  6923. try
  6924. {
  6925. // 验证请求头信息
  6926. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6927. // 验证失败
  6928. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6929. {
  6930. return actionResult;
  6931. }
  6932. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6933. () => PMModuleLogic.GetSemiCheckDefectStaffByUserID(sUserInfo, userid));
  6934. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6935. actionResult.Status = (int)Constant.PDAResult.Success;
  6936. }
  6937. catch (Exception ex)
  6938. {
  6939. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6940. OutputLog.TraceLog(LogPriority.Error,
  6941. this.ToString(),
  6942. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6943. ex.ToString(),
  6944. LocalPath.LogExePath);
  6945. actionResult.Status = (int)Constant.PDAResult.Exception;
  6946. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6947. }
  6948. return actionResult;
  6949. }
  6950. /// <summary>
  6951. /// 获取半成品缺陷管理的全部数据
  6952. /// </summary>
  6953. /// <param name="sUserInfo"></param>
  6954. /// <returns></returns>
  6955. public ActionResult GetAllSemicheckDefect(string accountCode, string userCode, string userPassword, string sessionKey)
  6956. {
  6957. ActionResult actionResult = new ActionResult();
  6958. try
  6959. {
  6960. // 验证请求头信息
  6961. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6962. // 验证失败
  6963. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6964. {
  6965. return actionResult;
  6966. }
  6967. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6968. () => SystemModuleLogic.GetAllSemicheckDefect(sUserInfo));
  6969. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6970. actionResult.Status = (int)Constant.PDAResult.Success;
  6971. }
  6972. catch (Exception ex)
  6973. {
  6974. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6975. OutputLog.TraceLog(LogPriority.Error,
  6976. this.ToString(),
  6977. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6978. ex.ToString(),
  6979. LocalPath.LogExePath);
  6980. actionResult.Status = (int)Constant.PDAResult.Exception;
  6981. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6982. }
  6983. return actionResult;
  6984. }
  6985. /// <summary>
  6986. /// 获取PLC参数
  6987. /// </summary>
  6988. /// <param name="sUserInfo"></param>
  6989. /// <returns></returns>
  6990. public ActionResult GetPLCParameter(string accountCode, string userCode, string userPassword, string sessionKey,string PlcName)
  6991. {
  6992. ActionResult actionResult = new ActionResult();
  6993. try
  6994. {
  6995. // 验证请求头信息
  6996. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6997. // 验证失败
  6998. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6999. {
  7000. return actionResult;
  7001. }
  7002. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7003. () => SystemModuleLogic.GetPLCParameter(PlcName));
  7004. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7005. actionResult.Status = (int)Constant.PDAResult.Success;
  7006. }
  7007. catch (Exception ex)
  7008. {
  7009. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7010. OutputLog.TraceLog(LogPriority.Error,
  7011. this.ToString(),
  7012. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7013. ex.ToString(),
  7014. LocalPath.LogExePath);
  7015. actionResult.Status = (int)Constant.PDAResult.Exception;
  7016. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7017. }
  7018. return actionResult;
  7019. }
  7020. /// <summary>
  7021. /// 获取产品信息
  7022. /// </summary>
  7023. /// <param name="sUserInfo"></param>
  7024. /// <returns></returns>
  7025. public ActionResult GetGodsParameter(string accountCode, string userCode, string userPassword, string sessionKey, string BarCode)
  7026. {
  7027. ActionResult actionResult = new ActionResult();
  7028. try
  7029. {
  7030. // 验证请求头信息
  7031. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7032. // 验证失败
  7033. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7034. {
  7035. return actionResult;
  7036. }
  7037. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7038. () => SystemModuleLogic.GetGodsParameter(BarCode));
  7039. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7040. actionResult.Status = (int)Constant.PDAResult.Success;
  7041. }
  7042. catch (Exception ex)
  7043. {
  7044. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7045. OutputLog.TraceLog(LogPriority.Error,
  7046. this.ToString(),
  7047. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7048. ex.ToString(),
  7049. LocalPath.LogExePath);
  7050. actionResult.Status = (int)Constant.PDAResult.Exception;
  7051. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7052. }
  7053. return actionResult;
  7054. }
  7055. /// <summary>
  7056. /// 传输PLC产品信息
  7057. /// </summary>
  7058. /// <param name="sUserInfo"></param>
  7059. /// <returns></returns>
  7060. public ActionResult AddPlcGood(string accountCode, string userCode, string userPassword, string sessionKey,string Plcid, string BarCode,string GROUTINGLINECODE, string GOODSMODEL, string GOODSTYPENAME, string GOODSSPECIFICATION)
  7061. {
  7062. ActionResult actionResult = new ActionResult();
  7063. try
  7064. {
  7065. // 验证请求头信息
  7066. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7067. // 验证失败
  7068. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7069. {
  7070. return actionResult;
  7071. }
  7072. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7073. () => SystemModuleLogic.AddPlcGood(Plcid, BarCode, GROUTINGLINECODE, GOODSMODEL, GOODSTYPENAME, GOODSSPECIFICATION));
  7074. actionResult.Result = JsonHelper.ToJson(resultEntity);
  7075. actionResult.Status = (int)Constant.PDAResult.Success;
  7076. }
  7077. catch (Exception ex)
  7078. {
  7079. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7080. OutputLog.TraceLog(LogPriority.Error,
  7081. this.ToString(),
  7082. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7083. ex.ToString(),
  7084. LocalPath.LogExePath);
  7085. actionResult.Status = (int)Constant.PDAResult.Exception;
  7086. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7087. }
  7088. return actionResult;
  7089. }
  7090. /// <summary>
  7091. /// 获取半成品缺陷位置管理的全部数据
  7092. /// </summary>
  7093. /// <param name="sUserInfo"></param>
  7094. /// <returns></returns>
  7095. public ActionResult GetAllScdefectPosition(string accountCode, string userCode, string userPassword, string sessionKey)
  7096. {
  7097. ActionResult actionResult = new ActionResult();
  7098. try
  7099. {
  7100. // 验证请求头信息
  7101. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7102. // 验证失败
  7103. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7104. {
  7105. return actionResult;
  7106. }
  7107. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7108. () => SystemModuleLogic.GetAllScdefectPosition(sUserInfo));
  7109. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7110. actionResult.Status = (int)Constant.PDAResult.Success;
  7111. }
  7112. catch (Exception ex)
  7113. {
  7114. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7115. OutputLog.TraceLog(LogPriority.Error,
  7116. this.ToString(),
  7117. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7118. ex.ToString(),
  7119. LocalPath.LogExePath);
  7120. actionResult.Status = (int)Constant.PDAResult.Exception;
  7121. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7122. }
  7123. return actionResult;
  7124. }
  7125. /// <summary>
  7126. /// 复检验条码
  7127. /// </summary>
  7128. /// <param name="sUserInfo"></param>
  7129. /// <returns></returns>
  7130. public ActionResult ReSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7131. {
  7132. ActionResult actionResult = new ActionResult();
  7133. try
  7134. {
  7135. // 验证请求头信息
  7136. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7137. // 验证失败
  7138. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7139. {
  7140. return actionResult;
  7141. }
  7142. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7143. () => PMModuleLogic.ReSemiCheckBarcode(barcode, sUserInfo));
  7144. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7145. if (Convert.ToInt32(resultEntity.Result) < 0)
  7146. {
  7147. actionResult.Status = (int)Constant.PDAResult.Fail;
  7148. }
  7149. else
  7150. {
  7151. actionResult.Status = (int)Constant.PDAResult.Success;
  7152. }
  7153. actionResult.Message = resultEntity.Message;
  7154. }
  7155. catch (Exception ex)
  7156. {
  7157. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7158. OutputLog.TraceLog(LogPriority.Error,
  7159. this.ToString(),
  7160. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7161. ex.ToString(),
  7162. LocalPath.LogExePath);
  7163. actionResult.Status = (int)Constant.PDAResult.Exception;
  7164. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7165. }
  7166. return actionResult;
  7167. }
  7168. /// <summary>
  7169. /// 撤销复检验条码
  7170. /// </summary>
  7171. /// <param name="sUserInfo"></param>
  7172. /// <returns></returns>
  7173. public ActionResult CancelSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7174. {
  7175. ActionResult actionResult = new ActionResult();
  7176. try
  7177. {
  7178. // 验证请求头信息
  7179. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7180. // 验证失败
  7181. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7182. {
  7183. return actionResult;
  7184. }
  7185. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7186. () => PMModuleLogic.CancelSemiCheckBarcode(barcode, sUserInfo));
  7187. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7188. if (Convert.ToInt32(resultEntity.Result) < 0)
  7189. {
  7190. actionResult.Status = (int)Constant.PDAResult.Fail;
  7191. }
  7192. else
  7193. {
  7194. actionResult.Status = (int)Constant.PDAResult.Success;
  7195. }
  7196. actionResult.Message = resultEntity.Message;
  7197. }
  7198. catch (Exception ex)
  7199. {
  7200. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7201. OutputLog.TraceLog(LogPriority.Error,
  7202. this.ToString(),
  7203. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7204. ex.ToString(),
  7205. LocalPath.LogExePath);
  7206. actionResult.Status = (int)Constant.PDAResult.Exception;
  7207. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7208. }
  7209. return actionResult;
  7210. }
  7211. /// <summary>
  7212. /// 恢复数据
  7213. /// </summary>
  7214. /// <param name="sUserInfo"></param>
  7215. /// <returns></returns>
  7216. public ActionResult ResetBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7217. {
  7218. ActionResult actionResult = new ActionResult();
  7219. try
  7220. {
  7221. // 验证请求头信息
  7222. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7223. // 验证失败
  7224. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7225. {
  7226. return actionResult;
  7227. }
  7228. int resultEntity = ServiceInvoker.Invoke<int>(this,
  7229. () => PMModuleLogicDAL.ResetBarCode(barcode));
  7230. if (resultEntity > 0)
  7231. {
  7232. actionResult.Status = (int)Constant.PDAResult.Success;
  7233. actionResult.Message = "恢复数据成功";
  7234. }
  7235. else
  7236. {
  7237. actionResult.Status = (int)Constant.PDAResult.Fail;
  7238. if (resultEntity == -1)
  7239. {
  7240. actionResult.Message = "此条码没有清除,不能恢复";
  7241. }
  7242. else if (resultEntity == 0)
  7243. {
  7244. actionResult.Message = "没有可恢复的数据";
  7245. }
  7246. }
  7247. }
  7248. catch (Exception ex)
  7249. {
  7250. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7251. OutputLog.TraceLog(LogPriority.Error,
  7252. this.ToString(),
  7253. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7254. ex.ToString(),
  7255. LocalPath.LogExePath);
  7256. actionResult.Status = (int)Constant.PDAResult.Exception;
  7257. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7258. }
  7259. return actionResult;
  7260. }
  7261. /// <summary>
  7262. /// 通过SettingCode获取系统参数管理的数据
  7263. /// </summary>
  7264. /// <param name="accountCode"></param>
  7265. /// <param name="userCode"></param>
  7266. /// <param name="userPassword"></param>
  7267. /// <param name="sessionKey"></param>
  7268. /// <param name="settingcode">设置编码</param>
  7269. /// <returns></returns>
  7270. public ActionResult GetSystemSettingDataByCode(string accountCode, string userCode, string userPassword, string sessionKey, string settingcode)
  7271. {
  7272. ActionResult actionResult = new ActionResult();
  7273. try
  7274. {
  7275. // 验证请求头信息
  7276. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7277. // 验证失败
  7278. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7279. {
  7280. return actionResult;
  7281. }
  7282. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7283. () => SystemModuleLogic.GetSystemSettingDataByCode(settingcode, sUserInfo));
  7284. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7285. actionResult.Status = (int)Constant.PDAResult.Success;
  7286. }
  7287. catch (Exception ex)
  7288. {
  7289. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7290. OutputLog.TraceLog(LogPriority.Error,
  7291. this.ToString(),
  7292. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7293. ex.ToString(),
  7294. LocalPath.LogExePath);
  7295. actionResult.Status = (int)Constant.PDAResult.Exception;
  7296. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7297. }
  7298. return actionResult;
  7299. }
  7300. /// <summary>
  7301. /// 校验条码是否允许撤销,如果不允许提示错误消息
  7302. /// </summary>
  7303. /// <param name="accountCode"></param>
  7304. /// <param name="userCode"></param>
  7305. /// <param name="userPassword"></param>
  7306. /// <param name="sessionKey"></param>
  7307. /// <param name="orgTime">原时间</param>
  7308. /// <param name="days">允许撤销天数</param>
  7309. /// <param name="settingCode">设置code,用于返回不同错误消息</param>
  7310. /// <returns></returns>
  7311. public ActionResult BarcodeAllowCancel(string accountCode, string userCode, string userPassword, string sessionKey, string orgTime, int days, string settingCode)
  7312. {
  7313. ActionResult actionResult = new ActionResult();
  7314. try
  7315. {
  7316. // 验证请求头信息
  7317. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7318. // 验证失败
  7319. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7320. {
  7321. return actionResult;
  7322. }
  7323. string[] subOrgTime = orgTime.Split('-');
  7324. DateTime newOrgTime = new DateTime(Convert.ToInt32(subOrgTime[0]), Convert.ToInt32(subOrgTime[1]), Convert.ToInt32(subOrgTime[2]));
  7325. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7326. () => PMModuleLogic.BarcodeAllowCancel(newOrgTime, days, settingCode, sUserInfo));
  7327. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7328. if (Convert.ToInt32(resultEntity.Result) < 0)
  7329. {
  7330. actionResult.Status = (int)Constant.PDAResult.Fail;
  7331. }
  7332. else
  7333. {
  7334. actionResult.Status = (int)Constant.PDAResult.Success;
  7335. }
  7336. actionResult.Message = resultEntity.Message;
  7337. }
  7338. catch (Exception ex)
  7339. {
  7340. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7341. OutputLog.TraceLog(LogPriority.Error,
  7342. this.ToString(),
  7343. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7344. ex.ToString(),
  7345. LocalPath.LogExePath);
  7346. actionResult.Status = (int)Constant.PDAResult.Exception;
  7347. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7348. }
  7349. return actionResult;
  7350. }
  7351. /// <summary>
  7352. /// 获取生产订单管理的全部数据
  7353. /// </summary>
  7354. /// <param name="sUserInfo"></param>
  7355. /// <returns></returns>
  7356. public ActionResult GetOrderList(string accountCode, string userCode, string userPassword, string sessionKey, OrderEntity order)
  7357. {
  7358. ActionResult actionResult = new ActionResult();
  7359. try
  7360. {
  7361. // 验证请求头信息
  7362. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7363. // 验证失败
  7364. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7365. {
  7366. return actionResult;
  7367. }
  7368. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7369. () => PMModuleLogic.GetOrderList(order, sUserInfo));
  7370. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7371. actionResult.Status = (int)Constant.PDAResult.Success;
  7372. }
  7373. catch (Exception ex)
  7374. {
  7375. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7376. OutputLog.TraceLog(LogPriority.Error,
  7377. this.ToString(),
  7378. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7379. ex.ToString(),
  7380. LocalPath.LogExePath);
  7381. actionResult.Status = (int)Constant.PDAResult.Exception;
  7382. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7383. }
  7384. return actionResult;
  7385. }
  7386. public ActionResult FinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7387. {
  7388. ActionResult actionResult = new ActionResult();
  7389. try
  7390. {
  7391. // 验证请求头信息
  7392. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7393. // 验证失败
  7394. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7395. {
  7396. return actionResult;
  7397. }
  7398. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7399. () => PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo));
  7400. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7401. if (Convert.ToInt32(resultEntity.Result) < 0)
  7402. {
  7403. actionResult.Status = (int)Constant.PDAResult.Fail;
  7404. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  7405. }
  7406. else
  7407. {
  7408. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  7409. actionResult.Status = (int)Constant.PDAResult.Success;
  7410. }
  7411. actionResult.Message = resultEntity.Message;
  7412. }
  7413. catch (Exception ex)
  7414. {
  7415. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7416. OutputLog.TraceLog(LogPriority.Error,
  7417. this.ToString(),
  7418. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7419. ex.ToString(),
  7420. LocalPath.LogExePath);
  7421. actionResult.Status = (int)Constant.PDAResult.Exception;
  7422. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7423. }
  7424. return actionResult;
  7425. }
  7426. public ActionResult GetSystemData(string accountCode, string userCode, string userPassword, string sessionKey)
  7427. {
  7428. ActionResult actionResult = new ActionResult();
  7429. try
  7430. {
  7431. // 验证请求头信息
  7432. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7433. // 验证失败
  7434. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7435. {
  7436. return actionResult;
  7437. }
  7438. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7439. () => SystemModuleLogic.GetSystemData(sUserInfo));
  7440. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7441. actionResult.Status = (int)Constant.PDAResult.Success;
  7442. }
  7443. catch (Exception ex)
  7444. {
  7445. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7446. OutputLog.TraceLog(LogPriority.Error,
  7447. this.ToString(),
  7448. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7449. ex.ToString(),
  7450. LocalPath.LogExePath);
  7451. actionResult.Status = (int)Constant.PDAResult.Exception;
  7452. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7453. }
  7454. return actionResult;
  7455. }
  7456. public ActionResult SaveFinishedHandover(string accountCode, string userCode, string userPassword, string sessionKey, int orderid, OrderEntity[] orderEntity)
  7457. {
  7458. ActionResult actionResult = new ActionResult();
  7459. try
  7460. {
  7461. // 验证请求头信息
  7462. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7463. // 验证失败
  7464. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7465. {
  7466. return actionResult;
  7467. }
  7468. DataTable dtOrderData = DataConvert.ObjectConvertToTable<OrderEntity>(orderEntity);
  7469. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7470. () => PMModuleLogicDAL.SaveFinishedHandover(orderid, dtOrderData, sUserInfo));
  7471. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7472. if (Convert.ToInt32(resultEntity.Result) < 0)
  7473. {
  7474. actionResult.Status = (int)Constant.PDAResult.Fail;
  7475. }
  7476. else
  7477. {
  7478. actionResult.Status = (int)Constant.PDAResult.Success;
  7479. }
  7480. actionResult.Message = resultEntity.Message;
  7481. }
  7482. catch (Exception ex)
  7483. {
  7484. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7485. OutputLog.TraceLog(LogPriority.Error,
  7486. this.ToString(),
  7487. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7488. ex.ToString(),
  7489. LocalPath.LogExePath);
  7490. actionResult.Status = (int)Constant.PDAResult.Exception;
  7491. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7492. }
  7493. return actionResult;
  7494. }
  7495. public ActionResult CancelFinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7496. {
  7497. ActionResult actionResult = new ActionResult();
  7498. try
  7499. {
  7500. // 验证请求头信息
  7501. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7502. // 验证失败
  7503. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7504. {
  7505. return actionResult;
  7506. }
  7507. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7508. () => PMModuleLogic.CancelFinishedHandoverBarcode(barcode, sUserInfo));
  7509. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7510. if (Convert.ToInt32(resultEntity.Result) < 0)
  7511. {
  7512. actionResult.Status = (int)Constant.PDAResult.Fail;
  7513. }
  7514. else
  7515. {
  7516. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables[0]);
  7517. actionResult.Status = (int)Constant.PDAResult.Success;
  7518. }
  7519. actionResult.Message = resultEntity.Message;
  7520. }
  7521. catch (Exception ex)
  7522. {
  7523. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7524. OutputLog.TraceLog(LogPriority.Error,
  7525. this.ToString(),
  7526. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7527. ex.ToString(),
  7528. LocalPath.LogExePath);
  7529. actionResult.Status = (int)Constant.PDAResult.Exception;
  7530. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7531. }
  7532. return actionResult;
  7533. }
  7534. public ActionResult SaveCancelFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7535. {
  7536. ActionResult actionResult = new ActionResult();
  7537. try
  7538. {
  7539. // 验证请求头信息
  7540. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7541. // 验证失败
  7542. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7543. {
  7544. return actionResult;
  7545. }
  7546. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7547. () => PMModuleLogicDAL.SaveCancelFinishedHandoverByBarcode(barcode, sUserInfo));
  7548. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7549. if (Convert.ToInt32(resultEntity.Result) < 0)
  7550. {
  7551. actionResult.Status = (int)Constant.PDAResult.Fail;
  7552. }
  7553. else
  7554. {
  7555. actionResult.Status = (int)Constant.PDAResult.Success;
  7556. }
  7557. actionResult.Message = resultEntity.Message;
  7558. }
  7559. catch (Exception ex)
  7560. {
  7561. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7562. OutputLog.TraceLog(LogPriority.Error,
  7563. this.ToString(),
  7564. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7565. ex.ToString(),
  7566. LocalPath.LogExePath);
  7567. actionResult.Status = (int)Constant.PDAResult.Exception;
  7568. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7569. }
  7570. return actionResult;
  7571. }
  7572. public ActionResult SaveChangeFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int orderid)
  7573. {
  7574. ActionResult actionResult = new ActionResult();
  7575. try
  7576. {
  7577. // 验证请求头信息
  7578. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7579. // 验证失败
  7580. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7581. {
  7582. return actionResult;
  7583. }
  7584. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7585. () => PMModuleLogicDAL.SaveChangeFinishedHandoverByBarcode(barcode, orderid, sUserInfo));
  7586. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7587. if (Convert.ToInt32(resultEntity.Result) < 0)
  7588. {
  7589. actionResult.Status = (int)Constant.PDAResult.Fail;
  7590. }
  7591. else
  7592. {
  7593. actionResult.Status = (int)Constant.PDAResult.Success;
  7594. }
  7595. actionResult.Message = resultEntity.Message;
  7596. }
  7597. catch (Exception ex)
  7598. {
  7599. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7600. OutputLog.TraceLog(LogPriority.Error,
  7601. this.ToString(),
  7602. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7603. ex.ToString(),
  7604. LocalPath.LogExePath);
  7605. actionResult.Status = (int)Constant.PDAResult.Exception;
  7606. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7607. }
  7608. return actionResult;
  7609. }
  7610. #region PDA条码打印
  7611. /// <summary>
  7612. /// 获取条码打印机
  7613. /// </summary>
  7614. /// <param name="accountCode"></param>
  7615. /// <param name="userCode"></param>
  7616. /// <param name="userPassword"></param>
  7617. /// <param name="sessionKey"></param>
  7618. /// <returns></returns>
  7619. public ActionResult GetBarcodePrinter(string accountCode, string userCode, string userPassword, string sessionKey, int printType = 0)
  7620. {
  7621. ActionResult actionResult = new ActionResult();
  7622. try
  7623. {
  7624. // 验证请求头信息
  7625. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7626. // 验证失败
  7627. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7628. {
  7629. return actionResult;
  7630. }
  7631. DataSet resultEntity = BarcodePrintLogic.GetBarcodePrinter(sUserInfo, printType);
  7632. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7633. actionResult.Status = (int)Constant.PDAResult.Success;
  7634. }
  7635. catch (Exception ex)
  7636. {
  7637. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7638. OutputLog.TraceLog(LogPriority.Error,
  7639. this.ToString(),
  7640. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7641. ex.ToString(),
  7642. LocalPath.LogExePath);
  7643. actionResult.Status = (int)Constant.PDAResult.Exception;
  7644. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7645. }
  7646. return actionResult;
  7647. }
  7648. /// <summary>
  7649. /// 打印条码样式(补打)
  7650. /// </summary>
  7651. /// <param name="accountCode"></param>
  7652. /// <param name="userCode"></param>
  7653. /// <param name="userPassword"></param>
  7654. /// <param name="sessionKey"></param>
  7655. /// <returns></returns>
  7656. public ActionResult PrintBarcodeLayout(string accountCode, string userCode, string userPassword, string sessionKey,
  7657. string barcode, int copies, int printerID, int printWay = 2)
  7658. {
  7659. ActionResult actionResult = new ActionResult();
  7660. try
  7661. {
  7662. // 验证请求头信息
  7663. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7664. // 验证失败
  7665. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7666. {
  7667. return actionResult;
  7668. }
  7669. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(barcode,
  7670. // copies, printerID, sUserInfo);
  7671. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(barcode,
  7672. copies, printerID, sUserInfo, printWay);
  7673. if (sre.Status != Constant.ServiceResultStatus.Success)
  7674. {
  7675. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  7676. actionResult.Message = sre.Message;
  7677. return actionResult;
  7678. }
  7679. actionResult.Result = JsonHelper.ToJson(sre.Result as DataTable);
  7680. actionResult.Status = (int)Constant.PDAResult.Success;
  7681. }
  7682. catch (Exception ex)
  7683. {
  7684. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7685. OutputLog.TraceLog(LogPriority.Error,
  7686. this.ToString(),
  7687. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7688. ex.ToString(),
  7689. LocalPath.LogExePath);
  7690. actionResult.Status = (int)Constant.PDAResult.Exception;
  7691. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7692. }
  7693. return actionResult;
  7694. }
  7695. #endregion PDA条码打印
  7696. #region 统计报表
  7697. /// <summary>
  7698. /// 成型结算报表
  7699. /// </summary>
  7700. /// <param name="accountCode"></param>
  7701. /// <param name="userCode"></param>
  7702. /// <param name="userPassword"></param>
  7703. /// <param name="sessionKey"></param>
  7704. /// <returns></returns>
  7705. public ActionResult GetGroutingSettlementInfo(string accountCode, string userCode, string userPassword, string sessionKey,
  7706. int currentMonth)
  7707. {
  7708. ActionResult actionResult = new ActionResult();
  7709. try
  7710. {
  7711. // 验证请求头信息
  7712. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7713. // 验证失败
  7714. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7715. {
  7716. return actionResult;
  7717. }
  7718. DateTime date = DateTime.Now;
  7719. if (currentMonth != 1)
  7720. {
  7721. date = date.AddMonths(-1);
  7722. }
  7723. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7724. () => PublicModuleLogic.GetFP00002Data(sUserInfo.AccountID, userCode, date));
  7725. if (resultEntity == null || resultEntity.Data == null)
  7726. {
  7727. actionResult.Status = (int)Constant.PDAResult.Fail;
  7728. actionResult.Message = "查询失败";
  7729. return actionResult;
  7730. }
  7731. if (resultEntity.Status == Constant.ServiceResultStatus.Other)
  7732. {
  7733. actionResult.Status = (int)Constant.PDAResult.Fail;
  7734. actionResult.Message = resultEntity.Message;
  7735. return actionResult;
  7736. }
  7737. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables["DataM"]);
  7738. actionResult.Status = (int)Constant.PDAResult.Success;
  7739. }
  7740. catch (Exception ex)
  7741. {
  7742. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7743. OutputLog.TraceLog(LogPriority.Error,
  7744. this.ToString(),
  7745. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7746. ex.ToString(),
  7747. LocalPath.LogExePath);
  7748. actionResult.Status = (int)Constant.PDAResult.Exception;
  7749. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7750. }
  7751. return actionResult;
  7752. }
  7753. #endregion
  7754. #region 设置当期用户默认打印机配置
  7755. /// <summary>
  7756. /// 设置当期用户默认打印机配置
  7757. /// </summary>
  7758. /// <param name="accountCode"></param>
  7759. /// <param name="userCode"></param>
  7760. /// <param name="userPassword"></param>
  7761. /// <param name="sessionKey"></param>
  7762. /// <param name="printerID"></param>
  7763. /// <returns></returns>
  7764. public ActionResult SetCurrentUserPrinter(string accountCode, string userCode, string userPassword, string sessionKey,
  7765. int printerID)
  7766. {
  7767. ActionResult actionResult = new ActionResult();
  7768. try
  7769. {
  7770. // 验证请求头信息
  7771. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7772. // 验证失败
  7773. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7774. {
  7775. return actionResult;
  7776. }
  7777. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7778. () => BarcodePrintLogic.SetCurrentUserPrinter(printerID, sUserInfo));
  7779. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7780. if (resultEntity.Status == Constant.ServiceResultStatus.Other || Convert.ToInt32(resultEntity.Result) < 0)
  7781. {
  7782. actionResult.Status = (int)Constant.PDAResult.Fail;
  7783. }
  7784. else
  7785. {
  7786. actionResult.Status = (int)Constant.PDAResult.Success;
  7787. }
  7788. actionResult.Message = resultEntity.Message;
  7789. }
  7790. catch (Exception ex)
  7791. {
  7792. OutputLog.TraceLog(LogPriority.Error,
  7793. this.ToString(),
  7794. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7795. ex.ToString(),
  7796. LocalPath.LogExePath);
  7797. actionResult.Status = (int)Constant.PDAResult.Exception;
  7798. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7799. }
  7800. return actionResult;
  7801. }
  7802. /// <summary>
  7803. /// 校验产品条码是否可以进行回收
  7804. /// </summary>
  7805. /// <param name="accountCode">帐套code</param>
  7806. /// <param name="userCode">用户code</param>
  7807. /// <param name="userPassword">用户密码</param>
  7808. /// <param name="sessionKey">本次登陆密钥</param>
  7809. /// <param name="procedureID">工序ID</param>
  7810. /// <param name="barcode">条码</param>
  7811. /// <returns></returns>
  7812. /// <remarks>
  7813. /// 王鑫 2017.7.21 新建
  7814. /// </remarks>
  7815. public ActionResult CheckRecydingFlagBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  7816. {
  7817. ActionResult actionResult = new ActionResult();
  7818. try
  7819. {
  7820. // 验证请求头信息
  7821. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7822. // 验证失败
  7823. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7824. {
  7825. return actionResult;
  7826. }
  7827. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  7828. () => PMModuleLogic.CheckRecydingFlagBarcode(procedureID, barcode, sUserInfo));
  7829. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  7830. {
  7831. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  7832. actionResult.Status = (int)Constant.PDAResult.Success;
  7833. }
  7834. else
  7835. {
  7836. actionResult.Status = (int)Constant.PDAResult.Fail;
  7837. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  7838. }
  7839. }
  7840. catch (Exception ex)
  7841. {
  7842. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7843. OutputLog.TraceLog(LogPriority.Error,
  7844. this.ToString(),
  7845. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7846. ex.ToString(),
  7847. LocalPath.LogExePath);
  7848. actionResult.Status = (int)Constant.PDAResult.Exception;
  7849. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7850. }
  7851. return actionResult;
  7852. }
  7853. /// <summary>
  7854. /// 获取回收标识
  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="usercode">工号编码</param>
  7861. /// <returns></returns>
  7862. public ActionResult GetRecyclingflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7863. {
  7864. ActionResult actionResult = new ActionResult();
  7865. try
  7866. {
  7867. // 验证请求头信息
  7868. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7869. // 验证失败
  7870. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7871. {
  7872. return actionResult;
  7873. }
  7874. int returnValue = ServiceInvoker.Invoke<int>(this,
  7875. () => PMModuleLogic.GetRecyclingflagByBarcode(barcode, sUserInfo));
  7876. actionResult.Result = JsonHelper.ToJson(returnValue);
  7877. actionResult.Status = (int)Constant.PDAResult.Success;
  7878. }
  7879. catch (Exception ex)
  7880. {
  7881. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7882. OutputLog.TraceLog(LogPriority.Error,
  7883. this.ToString(),
  7884. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7885. ex.ToString(),
  7886. LocalPath.LogExePath);
  7887. actionResult.Status = (int)Constant.PDAResult.Exception;
  7888. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7889. }
  7890. return actionResult;
  7891. }
  7892. #endregion
  7893. #region 注浆盘点
  7894. /// <summary>
  7895. /// 获取注浆盘点单列表
  7896. /// </summary>
  7897. /// <param name="sUserInfo"></param>
  7898. /// <returns></returns>
  7899. public ActionResult GetAllGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7900. {
  7901. ActionResult actionResult = new ActionResult();
  7902. try
  7903. {
  7904. // 验证请求头信息
  7905. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7906. // 验证失败
  7907. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7908. {
  7909. return actionResult;
  7910. }
  7911. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7912. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7913. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7914. () => PDAModuleLogic.GetAllGBChecked(entity, sUserInfo));
  7915. actionResult.Result = JsonHelper.ToJson(ds);
  7916. actionResult.Status = (int)Constant.PDAResult.Success;
  7917. }
  7918. catch (Exception ex)
  7919. {
  7920. string json = JsonHelper.ToJson(entity);
  7921. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7922. OutputLog.TraceLog(LogPriority.Error,
  7923. this.ToString(),
  7924. System.Reflection.MethodBase.GetCurrentMethod().Name + "\r\n" + json,
  7925. ex.ToString(),
  7926. LocalPath.LogExePath);
  7927. actionResult.Status = (int)Constant.PDAResult.Exception;
  7928. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7929. }
  7930. return actionResult;
  7931. }
  7932. /// <summary>
  7933. /// 进行盘点操作
  7934. /// </summary>
  7935. /// <param name="accountCode"></param>
  7936. /// <param name="userCode"></param>
  7937. /// <param name="userPassword"></param>
  7938. /// <param name="sessionKey"></param>
  7939. /// <param name="InCheckedID">盘点单ID</param>
  7940. /// <param name="BarCode">产品条码</param>
  7941. /// <returns></returns>
  7942. public ActionResult UpdateGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7943. {
  7944. ActionResult actionResult = new ActionResult();
  7945. try
  7946. {
  7947. // 验证请求头信息
  7948. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7949. // 验证失败
  7950. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7951. {
  7952. return actionResult;
  7953. }
  7954. ClientRequestEntity cre = new ClientRequestEntity();
  7955. cre.Properties["CheckedID"] = CheckedID;
  7956. cre.Properties["Barcode"] = BarCode;
  7957. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7958. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.UpdateGBChecked(sUserInfo, cre));
  7959. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7960. {
  7961. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7962. actionResult.Status = (int)Constant.PDAResult.Success;
  7963. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7964. }
  7965. else
  7966. {
  7967. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7968. actionResult.Status = (int)Constant.PDAResult.Fail;
  7969. actionResult.Message = returnValue.Message;
  7970. }
  7971. }
  7972. catch (Exception ex)
  7973. {
  7974. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7975. OutputLog.TraceLog(LogPriority.Error,
  7976. this.ToString(),
  7977. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7978. ex.ToString(),
  7979. LocalPath.LogExePath);
  7980. actionResult.Status = (int)Constant.PDAResult.Exception;
  7981. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7982. }
  7983. return actionResult;
  7984. }
  7985. /// <summary>
  7986. /// 获取盘点单明细
  7987. /// </summary>
  7988. /// <param name="sUserInfo"></param>
  7989. /// <returns></returns>
  7990. public ActionResult GetUpdateGBCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7991. {
  7992. ActionResult actionResult = new ActionResult();
  7993. try
  7994. {
  7995. // 验证请求头信息
  7996. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7997. // 验证失败
  7998. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7999. {
  8000. return actionResult;
  8001. }
  8002. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  8003. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.
  8004. GetUpdateGBCheckedInfo(checkedID, sUserInfo));
  8005. actionResult.Result = JsonHelper.ToJson(ds);
  8006. actionResult.Status = (int)Constant.PDAResult.Success;
  8007. }
  8008. catch (Exception ex)
  8009. {
  8010. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8011. OutputLog.TraceLog(LogPriority.Error,
  8012. this.ToString(),
  8013. System.Reflection.MethodBase.GetCurrentMethod().Name,
  8014. ex.ToString(),
  8015. LocalPath.LogExePath);
  8016. actionResult.Status = (int)Constant.PDAResult.Exception;
  8017. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8018. }
  8019. return actionResult;
  8020. }
  8021. #endregion
  8022. #region 模具盘点
  8023. /// <summary>
  8024. /// 获取模具盘点单列表
  8025. /// </summary>
  8026. /// <param name="sUserInfo"></param>
  8027. /// <returns></returns>
  8028. public ActionResult GetAllMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  8029. {
  8030. ActionResult actionResult = new ActionResult();
  8031. try
  8032. {
  8033. // 验证请求头信息
  8034. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8035. // 验证失败
  8036. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8037. {
  8038. return actionResult;
  8039. }
  8040. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  8041. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  8042. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  8043. () => PDAModuleLogic.GetAllMouldChecked(entity, sUserInfo));
  8044. actionResult.Result = JsonHelper.ToJson(ds);
  8045. actionResult.Status = (int)Constant.PDAResult.Success;
  8046. }
  8047. catch (Exception ex)
  8048. {
  8049. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8050. OutputLog.TraceLog(LogPriority.Error,
  8051. this.ToString(),
  8052. System.Reflection.MethodBase.GetCurrentMethod().Name,
  8053. ex.ToString(),
  8054. LocalPath.LogExePath);
  8055. actionResult.Status = (int)Constant.PDAResult.Exception;
  8056. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8057. }
  8058. return actionResult;
  8059. }
  8060. /// <summary>
  8061. /// 进行盘点操作
  8062. /// </summary>
  8063. /// <param name="accountCode"></param>
  8064. /// <param name="userCode"></param>
  8065. /// <param name="userPassword"></param>
  8066. /// <param name="sessionKey"></param>
  8067. /// <param name="InCheckedID">盘点单ID</param>
  8068. /// <param name="BarCode">产品条码</param>
  8069. /// <returns></returns>
  8070. public ActionResult UpdateMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  8071. {
  8072. ActionResult actionResult = new ActionResult();
  8073. try
  8074. {
  8075. // 验证请求头信息
  8076. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8077. // 验证失败
  8078. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8079. {
  8080. return actionResult;
  8081. }
  8082. ClientRequestEntity cre = new ClientRequestEntity();
  8083. cre.Properties["CheckedID"] = CheckedID;
  8084. cre.Properties["Barcode"] = BarCode;
  8085. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  8086. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.UpdateMouldChecked(sUserInfo, cre));
  8087. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  8088. {
  8089. //actionResult.Result = JsonHelper.ToJson(returnValue);
  8090. actionResult.Status = (int)Constant.PDAResult.Success;
  8091. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  8092. }
  8093. else
  8094. {
  8095. //actionResult.Result = JsonHelper.ToJson(returnValue);
  8096. actionResult.Status = (int)Constant.PDAResult.Fail;
  8097. actionResult.Message = returnValue.Message;
  8098. }
  8099. }
  8100. catch (Exception ex)
  8101. {
  8102. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8103. OutputLog.TraceLog(LogPriority.Error,
  8104. this.ToString(),
  8105. System.Reflection.MethodBase.GetCurrentMethod().Name,
  8106. ex.ToString(),
  8107. LocalPath.LogExePath);
  8108. actionResult.Status = (int)Constant.PDAResult.Exception;
  8109. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8110. }
  8111. return actionResult;
  8112. }
  8113. /// <summary>
  8114. /// 获取盘点单明细
  8115. /// </summary>
  8116. /// <param name="sUserInfo"></param>
  8117. /// <returns></returns>
  8118. public ActionResult GetUpdateMouldCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  8119. {
  8120. ActionResult actionResult = new ActionResult();
  8121. try
  8122. {
  8123. // 验证请求头信息
  8124. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8125. // 验证失败
  8126. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8127. {
  8128. return actionResult;
  8129. }
  8130. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  8131. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.
  8132. GetUpdateMouldCheckedInfo(checkedID, sUserInfo));
  8133. actionResult.Result = JsonHelper.ToJson(ds);
  8134. actionResult.Status = (int)Constant.PDAResult.Success;
  8135. }
  8136. catch (Exception ex)
  8137. {
  8138. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  8139. OutputLog.TraceLog(LogPriority.Error,
  8140. this.ToString(),
  8141. System.Reflection.MethodBase.GetCurrentMethod().Name,
  8142. ex.ToString(),
  8143. LocalPath.LogExePath);
  8144. actionResult.Status = (int)Constant.PDAResult.Exception;
  8145. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  8146. }
  8147. return actionResult;
  8148. }
  8149. #endregion
  8150. #region 通用接口
  8151. /// <summary>
  8152. /// PDA调用通用接口
  8153. /// </summary>
  8154. /// <param name="accountCode"></param>
  8155. /// <param name="userCode"></param>
  8156. /// <param name="userPassword"></param>
  8157. /// <param name="sessionKey"></param>
  8158. /// <param name="module"></param>
  8159. /// <param name="action"></param>
  8160. /// <param name="data"></param>
  8161. /// <returns></returns>
  8162. public ActionResult DoAction(string accountCode, string userCode, string userPassword, string sessionKey,
  8163. string module, string action, string jsonData)
  8164. {
  8165. ActionResult actionResult = null;
  8166. try
  8167. {
  8168. // 验证请求头信息
  8169. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  8170. // 验证失败
  8171. if (actionResult.Status != (int)Constant.PDAResult.Success)
  8172. {
  8173. return actionResult;
  8174. }
  8175. actionResult.Status = (int)Constant.PDAResult.Fail;
  8176. Dictionary<string, object> data = null;
  8177. if (!string.IsNullOrEmpty(jsonData) && jsonData[0] == '{')
  8178. {
  8179. data = JsonHelper.FromJson<Dictionary<string, object>>(jsonData);
  8180. }
  8181. #region PDA报表
  8182. if (module == "Report")
  8183. {
  8184. // 成型月度结算
  8185. if (action == "GetGroutingSettlementInfo")
  8186. {
  8187. DateTime month = DateTime.Now;
  8188. month = new DateTime(month.Year, month.Month, 1);
  8189. //month = new DateTime(2017, 6, 1);
  8190. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  8191. if (currentMonth != 1)
  8192. {
  8193. month = month.AddMonths(-1);
  8194. }
  8195. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementInfo(sUserInfo, month);
  8196. if (sre.Status == Constant.ServiceResultStatus.Success)
  8197. {
  8198. actionResult.Status = (int)Constant.PDAResult.Success;
  8199. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8200. }
  8201. else
  8202. {
  8203. actionResult.Status = (int)Constant.PDAResult.Fail;
  8204. actionResult.Message = sre.Message;
  8205. }
  8206. return actionResult;
  8207. }
  8208. // 成型月度结算-明细
  8209. if (action == "GetGroutingSettlementDetail")
  8210. {
  8211. DateTime month = DateTime.Now;
  8212. month = new DateTime(month.Year, month.Month, 1);
  8213. //month = new DateTime(2017, 6, 1);
  8214. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  8215. if (currentMonth != 1)
  8216. {
  8217. month = month.AddMonths(-1);
  8218. }
  8219. string goodsCode = data["GoodsCode"].ToString();
  8220. string detailDate = data["DetailDate"].ToString();
  8221. DateTime? date = null;
  8222. if (detailDate != "合计")
  8223. {
  8224. date = DateTime.Parse(detailDate);
  8225. }
  8226. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementDetail(sUserInfo, month, goodsCode, date);
  8227. if (sre.Status == Constant.ServiceResultStatus.Success)
  8228. {
  8229. actionResult.Status = (int)Constant.PDAResult.Success;
  8230. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8231. }
  8232. else
  8233. {
  8234. actionResult.Status = (int)Constant.PDAResult.Fail;
  8235. actionResult.Message = sre.Message;
  8236. }
  8237. return actionResult;
  8238. }
  8239. // 产成品交接汇总
  8240. if (action == "GetFinishedProductHandoverSum")
  8241. {
  8242. DateTime date = DateTime.Parse(data["date"].ToString());
  8243. ServiceResultEntity sre = ReportModuleLogic.GetRPT0030112NPDAData(date,
  8244. data["goodscode"] as string, sUserInfo);
  8245. if (sre.Status == Constant.ServiceResultStatus.Success)
  8246. {
  8247. actionResult.Status = (int)Constant.PDAResult.Success;
  8248. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8249. }
  8250. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  8251. {
  8252. actionResult.Status = (int)Constant.PDAResult.Success;
  8253. }
  8254. else
  8255. {
  8256. actionResult.Status = (int)Constant.PDAResult.Fail;
  8257. actionResult.Message = sre.Message;
  8258. }
  8259. return actionResult;
  8260. }
  8261. //xuwei add 2019-10-21
  8262. //统计当前工号,当日,按产品编码分组统计半检返修数据数量
  8263. if (action == "GetSemiReworkDayCount")
  8264. {
  8265. //不指定参数查询当天
  8266. string dateStr = DateTime.Now.ToString("yyyy-MM-dd");
  8267. //dateStr = "2019-10-17";
  8268. //指定参数查询特定日期
  8269. if (data.ContainsKey("SemiReworkDate")) dateStr = data["SemiReworkDate"].ToString();
  8270. ServiceResultEntity sre = ReportModuleLogic.GetSemiReworkDayCount(sUserInfo, dateStr);
  8271. if (sre.Status == Constant.ServiceResultStatus.Success)
  8272. {
  8273. actionResult.Status = (int)Constant.PDAResult.Success;
  8274. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8275. }
  8276. else
  8277. {
  8278. actionResult.Status = (int)Constant.PDAResult.Fail;
  8279. actionResult.Message = sre.Message;
  8280. }
  8281. return actionResult;
  8282. }
  8283. //xuwe end
  8284. return actionResult;
  8285. }
  8286. #endregion
  8287. #region 模具管理
  8288. if (module == "PC_Mould")
  8289. {
  8290. #region 模具新建画面数据初始化
  8291. if (action == "GetMouldAddInit")
  8292. {
  8293. ClientRequestEntity cre = new ClientRequestEntity();
  8294. cre.Properties["MouldID"] = 0;
  8295. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002LoadData(sUserInfo, cre);
  8296. if (sre.Status == Constant.ServiceResultStatus.Success)
  8297. {
  8298. actionResult.Status = (int)Constant.PDAResult.Success;
  8299. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8300. }
  8301. else
  8302. {
  8303. actionResult.Status = (int)Constant.PDAResult.Fail;
  8304. actionResult.Message = sre.Message;
  8305. }
  8306. return actionResult;
  8307. }
  8308. #endregion
  8309. #region 验证模具产品型号
  8310. if (action == "CheckGoodsCodeOnMould")
  8311. {
  8312. ClientRequestEntity cre = new ClientRequestEntity();
  8313. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8314. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002GoodsData(sUserInfo, cre);
  8315. if (sre.Status == Constant.ServiceResultStatus.Success &&
  8316. sre.Data.Tables[0].Rows.Count > 0)
  8317. {
  8318. actionResult.Status = (int)Constant.PDAResult.Success;
  8319. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8320. }
  8321. else
  8322. {
  8323. actionResult.Status = (int)Constant.PDAResult.Fail;
  8324. actionResult.Message = "无效产品型号";
  8325. }
  8326. return actionResult;
  8327. }
  8328. #endregion
  8329. #region 验证模具生产工号
  8330. if (action == "CheckUserCodeOnMould")
  8331. {
  8332. DataTable sre = PDAModuleLogic.GetUserCodeOnMould(sUserInfo, data["UserCode"].ToString());
  8333. if (sre != null && sre.Rows.Count > 0)
  8334. {
  8335. actionResult.Status = (int)Constant.PDAResult.Success;
  8336. actionResult.Result = JsonHelper.ToJson(sre);
  8337. }
  8338. else
  8339. {
  8340. actionResult.Status = (int)Constant.PDAResult.Fail;
  8341. actionResult.Message = "无效生产工号";
  8342. }
  8343. return actionResult;
  8344. }
  8345. #endregion
  8346. #region 新建保存
  8347. if (action == "SetMouldAdd" || action == "SetMouldEdit")
  8348. {
  8349. ClientRequestEntity cre = new ClientRequestEntity();
  8350. foreach (string item in data.Keys)
  8351. {
  8352. if (item == "ProductionDate")
  8353. {
  8354. cre.Properties.Add(item, Convert.ToDateTime(data[item]));
  8355. }
  8356. else
  8357. {
  8358. cre.Properties.Add(item, data[item]);
  8359. }
  8360. }
  8361. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1002Data(sUserInfo, cre);
  8362. if (sre.Status == Constant.ServiceResultStatus.Success)
  8363. {
  8364. actionResult.Status = (int)Constant.PDAResult.Success;
  8365. }
  8366. else
  8367. {
  8368. actionResult.Status = (int)Constant.PDAResult.Fail;
  8369. actionResult.Result = sre.OtherStatus;
  8370. actionResult.Message = sre.Message;
  8371. }
  8372. return actionResult;
  8373. }
  8374. #endregion
  8375. #region 模具编辑画面数据初始化
  8376. if (action == "GetMouldEditInfo")
  8377. {
  8378. DataTable sre = PDAModuleLogic.GetMouldEditInfo(sUserInfo, data["MouldBarcode"].ToString());
  8379. if (sre != null && sre.Rows.Count > 0)
  8380. {
  8381. actionResult.Status = (int)Constant.PDAResult.Success;
  8382. actionResult.Result = JsonHelper.ToJson(sre);
  8383. }
  8384. else
  8385. {
  8386. actionResult.Status = (int)Constant.PDAResult.Fail;
  8387. actionResult.Message = "无效模具条码";
  8388. }
  8389. return actionResult;
  8390. }
  8391. #endregion
  8392. #region 模具操作-画面初始化
  8393. if (action == "GetMouldOperationInit")
  8394. {
  8395. ClientRequestEntity cre = new ClientRequestEntity();
  8396. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8397. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8398. if (sre.Status == Constant.ServiceResultStatus.Success)
  8399. {
  8400. actionResult.Status = (int)Constant.PDAResult.Success;
  8401. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8402. }
  8403. else
  8404. {
  8405. actionResult.Status = (int)Constant.PDAResult.Fail;
  8406. actionResult.Result = sre.OtherStatus;
  8407. actionResult.Message = sre.Message;
  8408. }
  8409. return actionResult;
  8410. }
  8411. #endregion
  8412. #region 模具操作-验证模具条码
  8413. if (action == "CheckMouldBarcode")
  8414. {
  8415. ClientRequestEntity cre = new ClientRequestEntity();
  8416. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8417. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8418. if (sre.Status == Constant.ServiceResultStatus.Success)
  8419. {
  8420. if (sre.Data.Tables[0].Rows.Count == 0)
  8421. {
  8422. actionResult.Status = (int)Constant.PDAResult.Fail;
  8423. actionResult.Result = -1;
  8424. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8425. return actionResult;
  8426. }
  8427. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8428. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8429. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8430. #region 报损
  8431. if (mouldOperationType == 2)
  8432. {
  8433. if (mouldStatusID == 1 || mouldStatusID == 3)
  8434. {
  8435. actionResult.Status = (int)Constant.PDAResult.Success;
  8436. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8437. }
  8438. else
  8439. {
  8440. actionResult.Status = (int)Constant.PDAResult.Fail;
  8441. actionResult.Result = -2;
  8442. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8443. }
  8444. return actionResult;
  8445. }
  8446. #endregion
  8447. #region 撤销
  8448. if (mouldOperationType == 3)
  8449. {
  8450. if (mouldStatusID == 4)
  8451. {
  8452. actionResult.Status = (int)Constant.PDAResult.Success;
  8453. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8454. }
  8455. else
  8456. {
  8457. actionResult.Status = (int)Constant.PDAResult.Fail;
  8458. actionResult.Result = -2;
  8459. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行撤销报损操作";
  8460. }
  8461. return actionResult;
  8462. }
  8463. #endregion
  8464. #region 领用
  8465. if (mouldOperationType == 4)
  8466. {
  8467. if (mouldStatusID == 1)
  8468. {
  8469. actionResult.Status = (int)Constant.PDAResult.Success;
  8470. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8471. }
  8472. else
  8473. {
  8474. actionResult.Status = (int)Constant.PDAResult.Fail;
  8475. actionResult.Result = -2;
  8476. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行领用操作";
  8477. }
  8478. return actionResult;
  8479. }
  8480. #endregion
  8481. #region 回收
  8482. if (mouldOperationType == 5)
  8483. {
  8484. if (mouldStatusID == 3)
  8485. {
  8486. actionResult.Status = (int)Constant.PDAResult.Success;
  8487. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8488. }
  8489. else
  8490. {
  8491. actionResult.Status = (int)Constant.PDAResult.Fail;
  8492. actionResult.Result = -2;
  8493. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行回收操作";
  8494. }
  8495. return actionResult;
  8496. }
  8497. #endregion
  8498. #region 变更型号
  8499. if (mouldOperationType == -1)
  8500. {
  8501. if (mouldStatusID != 4)
  8502. {
  8503. actionResult.Status = (int)Constant.PDAResult.Success;
  8504. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8505. }
  8506. else
  8507. {
  8508. actionResult.Status = (int)Constant.PDAResult.Fail;
  8509. actionResult.Result = -2;
  8510. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行变更型号操作";
  8511. }
  8512. return actionResult;
  8513. }
  8514. #endregion
  8515. #region 替换条码
  8516. if (mouldOperationType == -2)
  8517. {
  8518. actionResult.Status = (int)Constant.PDAResult.Success;
  8519. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8520. return actionResult;
  8521. }
  8522. #endregion
  8523. return actionResult;
  8524. }
  8525. }
  8526. #endregion
  8527. #region 模具操作-保存
  8528. if (action == "SetMouldOperation")
  8529. {
  8530. ClientRequestEntity cre = new ClientRequestEntity();
  8531. cre.Properties["MouldIDs"] = string.Join(",", JsonHelper.FromJson<int[]>(data["MouldIDs"].ToString()));
  8532. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8533. cre.Properties["Remarks"] = data["Remarks"];
  8534. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8535. if (mouldOperationType == (int)Constant.MouldOperationType.ChangeGoodsCode)
  8536. {
  8537. cre.Properties["GoodsID"] = data["GoodsID"];
  8538. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8539. }
  8540. else if (mouldOperationType == (int)Constant.MouldOperationType.InvToScrap)
  8541. {
  8542. cre.Properties["ScrapReason"] = data["ScrapReason"];
  8543. cre.Properties["ScrapResponsibility"] = data["ScrapRemarks"];
  8544. }
  8545. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1004Data(sUserInfo, cre);
  8546. if (sre.Status == Constant.ServiceResultStatus.Success)
  8547. {
  8548. actionResult.Status = (int)Constant.PDAResult.Success;
  8549. }
  8550. else
  8551. {
  8552. actionResult.Status = (int)Constant.PDAResult.Fail;
  8553. }
  8554. return actionResult;
  8555. }
  8556. #endregion
  8557. #region 模具操作-替换条码
  8558. if (action == "ChangedMouldBarcode")
  8559. {
  8560. ClientRequestEntity cre = new ClientRequestEntity();
  8561. cre.Properties["MouldID"] = data["MouldID"];
  8562. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8563. cre.Properties["NewMouldBarcode"] = data["NewMouldBarcode"];
  8564. cre.Properties["Remarks"] = data["Remarks"];
  8565. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1003Data(sUserInfo, cre);
  8566. if (sre.Status == Constant.ServiceResultStatus.Success)
  8567. {
  8568. actionResult.Status = (int)Constant.PDAResult.Success;
  8569. }
  8570. else
  8571. {
  8572. actionResult.Status = (int)Constant.PDAResult.Fail;
  8573. actionResult.Result = sre.OtherStatus;
  8574. actionResult.Message = sre.Message;
  8575. }
  8576. return actionResult;
  8577. }
  8578. #endregion
  8579. #region 模具跟踪表
  8580. if (action == "GetMoldTracking")
  8581. {
  8582. ClientRequestEntity cre = new ClientRequestEntity();
  8583. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8584. ServiceResultEntity sre = ReportModuleLogic.GetRPT020105Data(cre, sUserInfo);
  8585. if (sre.Status == Constant.ServiceResultStatus.Success)
  8586. {
  8587. actionResult.Status = (int)Constant.PDAResult.Success;
  8588. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8589. }
  8590. else
  8591. {
  8592. actionResult.Status = (int)Constant.PDAResult.Fail;
  8593. actionResult.Message = "此模具条码不存在";
  8594. }
  8595. return actionResult;
  8596. }
  8597. #endregion
  8598. return actionResult;
  8599. }
  8600. #endregion
  8601. #region 成型线模具管理
  8602. if (module == "PC_GroutingLineMould")
  8603. {
  8604. #region 获取当前用户成型线模具管理权限
  8605. if (action == "GetGMouldStatusRight")
  8606. {
  8607. DataTable right = PDAModuleLogic.GetGMouldStatusRight(sUserInfo);
  8608. actionResult.Status = (int)Constant.PDAResult.Success;
  8609. if (right != null && right.Rows.Count > 0)
  8610. {
  8611. actionResult.Result = JsonHelper.ToJson(right);
  8612. }
  8613. return actionResult;
  8614. }
  8615. #endregion
  8616. #region 获取成型线状态等信息,和成型模具信息
  8617. if (action == "GetGroutingLineMould")
  8618. {
  8619. int? groutingLineID = null;
  8620. string groutingLineCode = null;
  8621. if (data.ContainsKey("GroutingLineID"))
  8622. {
  8623. groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8624. }
  8625. else
  8626. {
  8627. groutingLineCode = data["GroutingLineCode"] + "";
  8628. }
  8629. DataSet lineInfo = PDAModuleLogic.GetGroutingLineMould(sUserInfo, groutingLineCode, groutingLineID);
  8630. if (lineInfo == null)
  8631. {
  8632. actionResult.Status = (int)Constant.PDAResult.Fail;
  8633. actionResult.Message = "成型线【" + groutingLineCode + "】不存在或是停用状态";
  8634. }
  8635. else
  8636. {
  8637. actionResult.Status = (int)Constant.PDAResult.Success;
  8638. actionResult.Result = JsonHelper.ToJson(lineInfo);
  8639. }
  8640. return actionResult;
  8641. }
  8642. #endregion
  8643. #region 模具操作-画面初始化
  8644. if (action == "GetMouldOperationInit")
  8645. {
  8646. ClientRequestEntity cre = new ClientRequestEntity();
  8647. cre.Properties["MouldOperationType"] = 2;
  8648. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8649. if (sre.Status == Constant.ServiceResultStatus.Success)
  8650. {
  8651. actionResult.Status = (int)Constant.PDAResult.Success;
  8652. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8653. }
  8654. else
  8655. {
  8656. actionResult.Status = (int)Constant.PDAResult.Fail;
  8657. actionResult.Result = sre.OtherStatus;
  8658. actionResult.Message = sre.Message;
  8659. }
  8660. return actionResult;
  8661. }
  8662. #endregion
  8663. #region 成型模具操作-画面初始化
  8664. if (action == "GetGroutingMouldOperationInit")
  8665. {
  8666. DataTable initData = PDAModuleLogic.GetGroutingMouldOperationInit(sUserInfo, 6);
  8667. if (initData != null && initData.Rows.Count > 0)
  8668. {
  8669. actionResult.Status = (int)Constant.PDAResult.Success;
  8670. Dictionary<string, string> syssetting = new Dictionary<string, string>();
  8671. foreach (DataRow item in initData.Rows)
  8672. {
  8673. syssetting.Add(item["settingcode"].ToString(), item["settingvalue"].ToString());
  8674. }
  8675. actionResult.Result = JsonHelper.ToJson(syssetting);
  8676. }
  8677. else
  8678. {
  8679. actionResult.Status = (int)Constant.PDAResult.Fail;
  8680. }
  8681. return actionResult;
  8682. }
  8683. #endregion
  8684. #region 模具操作-验证模具条码
  8685. if (action == "CheckMouldBarcode")
  8686. {
  8687. ClientRequestEntity cre = new ClientRequestEntity();
  8688. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8689. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8690. if (sre.Status == Constant.ServiceResultStatus.Success)
  8691. {
  8692. if (sre.Data.Tables[0].Rows.Count == 0)
  8693. {
  8694. actionResult.Status = (int)Constant.PDAResult.Fail;
  8695. actionResult.Result = -1;
  8696. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8697. return actionResult;
  8698. }
  8699. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8700. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8701. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8702. #region 上线
  8703. if (mouldOperationType == 6)
  8704. {
  8705. if (mouldStatusID == 1 || mouldStatusID == 3)
  8706. {
  8707. if (data.ContainsKey("GoodsID"))
  8708. {
  8709. if (sre.Data.Tables[0].Rows[0]["GoodsID"] + "" != data["GoodsID"] + "")
  8710. {
  8711. actionResult.Status = (int)Constant.PDAResult.Fail;
  8712. actionResult.Result = -3;
  8713. actionResult.Message =
  8714. "模具【" + data["MouldBarcode"] + "】的产品型号为【" +
  8715. sre.Data.Tables[0].Rows[0]["GoodsCode"] +
  8716. "】与当前不一致";
  8717. return actionResult;
  8718. }
  8719. }
  8720. actionResult.Status = (int)Constant.PDAResult.Success;
  8721. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8722. }
  8723. else
  8724. {
  8725. actionResult.Status = (int)Constant.PDAResult.Fail;
  8726. actionResult.Result = -2;
  8727. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8728. }
  8729. return actionResult;
  8730. }
  8731. #endregion
  8732. return actionResult;
  8733. }
  8734. }
  8735. #endregion
  8736. #region 停用
  8737. if (action == "StopGroutingLineDetail")
  8738. {
  8739. if (data == null || !data.ContainsKey("Details"))
  8740. {
  8741. actionResult.Status = (int)Constant.PDAResult.Fail;
  8742. actionResult.Message = "参数错误";
  8743. return actionResult;
  8744. }
  8745. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8746. DataTable gTable = new DataTable();
  8747. gTable.Columns.Add("GroutingLineID", typeof(int));
  8748. gTable.Columns.Add("GroutingLineCode");
  8749. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8750. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8751. gTable.Columns.Add("GroutingMouldCode");
  8752. gTable.Columns.Add("RecordRemarks");
  8753. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8754. gTable.Columns.Add("MouldID", typeof(int));
  8755. gTable.Columns.Add("MouldCode");
  8756. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8757. string groutingLineCode = data["GroutingLineCode"] + "";
  8758. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8759. foreach (Dictionary<string, object> item in details)
  8760. {
  8761. int? mouldID = null;
  8762. if (item.ContainsKey("MouldID"))
  8763. {
  8764. mouldID = Convert.ToInt32(item["MouldID"]);
  8765. if (mouldID == 0)
  8766. {
  8767. mouldID = null;
  8768. }
  8769. }
  8770. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8771. item["GLineDetailID"], item["GLineDetailCode"],
  8772. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8773. mouldID, item["MouldCode"]);
  8774. }
  8775. int result = PCModuleLogicDAL.StopGroutingLineDetail(gTable, sUserInfo);
  8776. if (result > 0)
  8777. {
  8778. actionResult.Status = (int)Constant.PDAResult.Success;
  8779. }
  8780. else
  8781. {
  8782. actionResult.Status = (int)Constant.PDAResult.Fail;
  8783. actionResult.Result = result;
  8784. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8785. return actionResult;
  8786. }
  8787. return actionResult;
  8788. }
  8789. #endregion
  8790. #region 启用
  8791. if (action == "StartGroutingLineDetail")
  8792. {
  8793. if (data == null || !data.ContainsKey("Details"))
  8794. {
  8795. actionResult.Status = (int)Constant.PDAResult.Fail;
  8796. actionResult.Message = "参数错误";
  8797. return actionResult;
  8798. }
  8799. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8800. DataTable gTable = new DataTable();
  8801. gTable.Columns.Add("GroutingLineID", typeof(int));
  8802. gTable.Columns.Add("GroutingLineCode");
  8803. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8804. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8805. gTable.Columns.Add("GroutingMouldCode");
  8806. gTable.Columns.Add("RecordRemarks");
  8807. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8808. gTable.Columns.Add("MouldID", typeof(int));
  8809. gTable.Columns.Add("MouldCode");
  8810. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8811. string groutingLineCode = data["GroutingLineCode"] + "";
  8812. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8813. foreach (Dictionary<string, object> item in details)
  8814. {
  8815. int? mouldID = null;
  8816. if (item.ContainsKey("MouldID"))
  8817. {
  8818. mouldID = Convert.ToInt32(item["MouldID"]);
  8819. if (mouldID == 0)
  8820. {
  8821. mouldID = null;
  8822. }
  8823. }
  8824. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8825. item["GLineDetailID"], item["GLineDetailCode"],
  8826. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8827. mouldID, item["MouldCode"]);
  8828. }
  8829. int result = PCModuleLogicDAL.StartGroutingLineDetail(gTable, sUserInfo);
  8830. if (result > 0)
  8831. {
  8832. actionResult.Status = (int)Constant.PDAResult.Success;
  8833. }
  8834. else
  8835. {
  8836. actionResult.Status = (int)Constant.PDAResult.Fail;
  8837. actionResult.Result = result;
  8838. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8839. return actionResult;
  8840. }
  8841. return actionResult;
  8842. }
  8843. #endregion
  8844. #region 维修
  8845. if (action == "RepairStartGroutingLineDetail")
  8846. {
  8847. if (data == null || !data.ContainsKey("Details"))
  8848. {
  8849. actionResult.Status = (int)Constant.PDAResult.Fail;
  8850. actionResult.Message = "参数错误";
  8851. return actionResult;
  8852. }
  8853. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8854. DataTable gTable = new DataTable();
  8855. gTable.Columns.Add("GroutingLineID", typeof(int));
  8856. gTable.Columns.Add("GroutingLineCode");
  8857. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8858. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8859. gTable.Columns.Add("GroutingMouldCode");
  8860. gTable.Columns.Add("RecordRemarks");
  8861. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8862. gTable.Columns.Add("MouldID", typeof(int));
  8863. gTable.Columns.Add("MouldCode");
  8864. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8865. string groutingLineCode = data["GroutingLineCode"] + "";
  8866. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8867. foreach (Dictionary<string, object> item in details)
  8868. {
  8869. int? mouldID = null;
  8870. if (item.ContainsKey("MouldID"))
  8871. {
  8872. mouldID = Convert.ToInt32(item["MouldID"]);
  8873. if (mouldID == 0)
  8874. {
  8875. mouldID = null;
  8876. }
  8877. }
  8878. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8879. item["GLineDetailID"], item["GLineDetailCode"],
  8880. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8881. mouldID, item["MouldCode"]);
  8882. }
  8883. int result = PCModuleLogicDAL.RepairStartGroutingLineDetail(gTable, sUserInfo);
  8884. if (result > 0)
  8885. {
  8886. actionResult.Status = (int)Constant.PDAResult.Success;
  8887. }
  8888. else
  8889. {
  8890. actionResult.Status = (int)Constant.PDAResult.Fail;
  8891. actionResult.Result = result;
  8892. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8893. return actionResult;
  8894. }
  8895. return actionResult;
  8896. }
  8897. #endregion
  8898. #region 结束维修
  8899. if (action == "RepairEndGroutingLineDetail")
  8900. {
  8901. if (data == null || !data.ContainsKey("Details"))
  8902. {
  8903. actionResult.Status = (int)Constant.PDAResult.Fail;
  8904. actionResult.Message = "参数错误";
  8905. return actionResult;
  8906. }
  8907. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8908. DataTable gTable = new DataTable();
  8909. gTable.Columns.Add("GroutingLineID", typeof(int));
  8910. gTable.Columns.Add("GroutingLineCode");
  8911. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8912. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8913. gTable.Columns.Add("GroutingMouldCode");
  8914. gTable.Columns.Add("RecordRemarks");
  8915. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8916. gTable.Columns.Add("MouldID", typeof(int));
  8917. gTable.Columns.Add("MouldCode");
  8918. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8919. string groutingLineCode = data["GroutingLineCode"] + "";
  8920. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8921. foreach (Dictionary<string, object> item in details)
  8922. {
  8923. int? mouldID = null;
  8924. if (item.ContainsKey("MouldID"))
  8925. {
  8926. mouldID = Convert.ToInt32(item["MouldID"]);
  8927. if (mouldID == 0)
  8928. {
  8929. mouldID = null;
  8930. }
  8931. }
  8932. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8933. item["GLineDetailID"], item["GLineDetailCode"],
  8934. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8935. mouldID, item["MouldCode"]);
  8936. }
  8937. int result = PCModuleLogicDAL.RepairEndGroutingLineDetail(gTable, sUserInfo);
  8938. if (result > 0)
  8939. {
  8940. actionResult.Status = (int)Constant.PDAResult.Success;
  8941. }
  8942. else
  8943. {
  8944. actionResult.Status = (int)Constant.PDAResult.Fail;
  8945. actionResult.Result = result;
  8946. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8947. return actionResult;
  8948. }
  8949. return actionResult;
  8950. }
  8951. #endregion
  8952. #region 换模
  8953. if (action == "ChangeGMouldStartGroutingLineDetail")
  8954. {
  8955. if (data == null || !data.ContainsKey("Details"))
  8956. {
  8957. actionResult.Status = (int)Constant.PDAResult.Fail;
  8958. actionResult.Message = "参数错误";
  8959. return actionResult;
  8960. }
  8961. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8962. DataTable gTable = new DataTable();
  8963. gTable.Columns.Add("GroutingLineID", typeof(int));
  8964. gTable.Columns.Add("GroutingLineCode");
  8965. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8966. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8967. gTable.Columns.Add("GroutingMouldCode");
  8968. gTable.Columns.Add("RecordRemarks");
  8969. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8970. gTable.Columns.Add("MouldID", typeof(int));
  8971. gTable.Columns.Add("MouldCode");
  8972. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8973. gTable.Columns.Add("MouldStatus", typeof(int));
  8974. gTable.Columns.Add("ScrapReason", typeof(int));
  8975. gTable.Columns.Add("ScrapResponsibility");
  8976. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8977. string groutingLineCode = data["GroutingLineCode"] + "";
  8978. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8979. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8980. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8981. string scrapResponsibility = data["ScrapRemarks"] + "";
  8982. foreach (Dictionary<string, object> item in details)
  8983. {
  8984. int? mouldID = null;
  8985. if (item.ContainsKey("MouldID"))
  8986. {
  8987. mouldID = Convert.ToInt32(item["MouldID"]);
  8988. if (mouldID == 0)
  8989. {
  8990. mouldID = null;
  8991. }
  8992. }
  8993. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8994. item["GLineDetailID"], item["GLineDetailCode"],
  8995. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8996. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8997. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8998. }
  8999. int result = PCModuleLogicDAL.ChangeGMouldStartGroutingLineDetail(gTable, sUserInfo);
  9000. if (result > 0)
  9001. {
  9002. actionResult.Status = (int)Constant.PDAResult.Success;
  9003. }
  9004. else
  9005. {
  9006. actionResult.Status = (int)Constant.PDAResult.Fail;
  9007. actionResult.Result = result;
  9008. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9009. return actionResult;
  9010. }
  9011. return actionResult;
  9012. }
  9013. #endregion
  9014. #region 变产
  9015. if (action == "UpdateLineStartGroutingLineDetail")
  9016. {
  9017. if (data == null || !data.ContainsKey("Details"))
  9018. {
  9019. actionResult.Status = (int)Constant.PDAResult.Fail;
  9020. actionResult.Message = "参数错误";
  9021. return actionResult;
  9022. }
  9023. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9024. DataTable gTable = new DataTable();
  9025. gTable.Columns.Add("GroutingLineID", typeof(int));
  9026. gTable.Columns.Add("GroutingLineCode");
  9027. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9028. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9029. gTable.Columns.Add("GroutingMouldCode");
  9030. gTable.Columns.Add("RecordRemarks");
  9031. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9032. gTable.Columns.Add("MouldID", typeof(int));
  9033. gTable.Columns.Add("MouldCode");
  9034. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9035. gTable.Columns.Add("MouldStatus", typeof(int));
  9036. gTable.Columns.Add("ScrapReason", typeof(int));
  9037. gTable.Columns.Add("ScrapResponsibility");
  9038. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9039. string groutingLineCode = data["GroutingLineCode"] + "";
  9040. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9041. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  9042. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  9043. string scrapResponsibility = data["ScrapRemarks"] + "";
  9044. foreach (Dictionary<string, object> item in details)
  9045. {
  9046. int? mouldID = null;
  9047. if (item.ContainsKey("MouldID"))
  9048. {
  9049. mouldID = Convert.ToInt32(item["MouldID"]);
  9050. if (mouldID == 0)
  9051. {
  9052. mouldID = null;
  9053. }
  9054. }
  9055. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9056. item["GLineDetailID"], item["GLineDetailCode"],
  9057. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9058. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  9059. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  9060. }
  9061. int result = PCModuleLogicDAL.UpdateLineStartGroutingLineDetail(gTable, sUserInfo);
  9062. if (result > 0)
  9063. {
  9064. actionResult.Status = (int)Constant.PDAResult.Success;
  9065. }
  9066. else
  9067. {
  9068. actionResult.Status = (int)Constant.PDAResult.Fail;
  9069. actionResult.Result = result;
  9070. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9071. return actionResult;
  9072. }
  9073. return actionResult;
  9074. }
  9075. #endregion
  9076. #region 整线变产
  9077. if (action == "UpdateAllLineStartGroutingLineDetail")
  9078. {
  9079. if (data == null || !data.ContainsKey("Details"))
  9080. {
  9081. actionResult.Status = (int)Constant.PDAResult.Fail;
  9082. actionResult.Message = "参数错误";
  9083. return actionResult;
  9084. }
  9085. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9086. DataTable gTable = new DataTable();
  9087. gTable.Columns.Add("GroutingLineID", typeof(int));
  9088. gTable.Columns.Add("GroutingLineCode");
  9089. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9090. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9091. gTable.Columns.Add("GroutingMouldCode");
  9092. gTable.Columns.Add("RecordRemarks");
  9093. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9094. gTable.Columns.Add("MouldID", typeof(int));
  9095. gTable.Columns.Add("MouldCode");
  9096. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9097. gTable.Columns.Add("MouldStatus", typeof(int));
  9098. gTable.Columns.Add("ScrapReason", typeof(int));
  9099. gTable.Columns.Add("ScrapResponsibility");
  9100. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9101. string groutingLineCode = data["GroutingLineCode"] + "";
  9102. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9103. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  9104. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  9105. string scrapResponsibility = data["ScrapRemarks"] + "";
  9106. foreach (Dictionary<string, object> item in details)
  9107. {
  9108. int? mouldID = null;
  9109. if (item.ContainsKey("MouldID"))
  9110. {
  9111. mouldID = Convert.ToInt32(item["MouldID"]);
  9112. if (mouldID == 0)
  9113. {
  9114. mouldID = null;
  9115. }
  9116. }
  9117. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9118. item["GLineDetailID"], item["GLineDetailCode"],
  9119. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9120. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  9121. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  9122. }
  9123. int result = PCModuleLogicDAL.UpdateAllLineStartGroutingLineDetail(gTable, groutingLineID, lineOPTimeStamp, sUserInfo);
  9124. if (result > 0)
  9125. {
  9126. actionResult.Status = (int)Constant.PDAResult.Success;
  9127. }
  9128. else
  9129. {
  9130. actionResult.Status = (int)Constant.PDAResult.Fail;
  9131. actionResult.Result = result;
  9132. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9133. return actionResult;
  9134. }
  9135. return actionResult;
  9136. }
  9137. #endregion
  9138. #region 卸模
  9139. if (action == "UnloadGroutingLineDetail")
  9140. {
  9141. if (data == null || !data.ContainsKey("Details"))
  9142. {
  9143. actionResult.Status = (int)Constant.PDAResult.Fail;
  9144. actionResult.Message = "参数错误";
  9145. return actionResult;
  9146. }
  9147. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9148. DataTable gTable = new DataTable();
  9149. gTable.Columns.Add("GroutingLineID", typeof(int));
  9150. gTable.Columns.Add("GroutingLineCode");
  9151. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9152. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9153. gTable.Columns.Add("GroutingMouldCode");
  9154. gTable.Columns.Add("RecordRemarks");
  9155. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9156. gTable.Columns.Add("MouldID", typeof(int));
  9157. gTable.Columns.Add("MouldCode");
  9158. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9159. gTable.Columns.Add("MouldStatus", typeof(int));
  9160. gTable.Columns.Add("ScrapReason", typeof(int));
  9161. gTable.Columns.Add("ScrapResponsibility");
  9162. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9163. string groutingLineCode = data["GroutingLineCode"] + "";
  9164. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9165. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  9166. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  9167. string scrapResponsibility = data["ScrapRemarks"] + "";
  9168. foreach (Dictionary<string, object> item in details)
  9169. {
  9170. int? mouldID = null;
  9171. if (item.ContainsKey("MouldID"))
  9172. {
  9173. mouldID = Convert.ToInt32(item["MouldID"]);
  9174. if (mouldID == 0)
  9175. {
  9176. mouldID = null;
  9177. }
  9178. }
  9179. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9180. item["GLineDetailID"], item["GLineDetailCode"],
  9181. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9182. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  9183. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  9184. }
  9185. int result = PCModuleLogicDAL.UnloadGroutingLineDetail(gTable, sUserInfo);
  9186. if (result > 0)
  9187. {
  9188. actionResult.Status = (int)Constant.PDAResult.Success;
  9189. }
  9190. else
  9191. {
  9192. actionResult.Status = (int)Constant.PDAResult.Fail;
  9193. actionResult.Result = result;
  9194. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9195. return actionResult;
  9196. }
  9197. return actionResult;
  9198. }
  9199. #endregion
  9200. #region 结束换模
  9201. if (action == "ChangeGMouldEndGroutingLineDetail")
  9202. {
  9203. if (data == null || !data.ContainsKey("Details"))
  9204. {
  9205. actionResult.Status = (int)Constant.PDAResult.Fail;
  9206. actionResult.Message = "参数错误";
  9207. return actionResult;
  9208. }
  9209. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9210. DataTable gTable = new DataTable();
  9211. gTable.Columns.Add("GroutingLineID", typeof(int));
  9212. gTable.Columns.Add("GroutingLineCode");
  9213. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9214. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9215. gTable.Columns.Add("GroutingMouldCode");
  9216. gTable.Columns.Add("RreasonRemarks");
  9217. gTable.Columns.Add("RecordRemarks");
  9218. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9219. gTable.Columns.Add("MouldID", typeof(int));
  9220. gTable.Columns.Add("MouldCode");
  9221. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9222. gTable.Columns.Add("GoodsID", typeof(int));
  9223. gTable.Columns.Add("GoodsCode");
  9224. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9225. gTable.Columns.Add("GroutingCount", typeof(int));
  9226. gTable.Columns.Add("MouldSource");
  9227. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9228. string groutingLineCode = data["GroutingLineCode"] + "";
  9229. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9230. foreach (Dictionary<string, object> item in details)
  9231. {
  9232. int? mouldID = null;
  9233. if (item.ContainsKey("MouldID"))
  9234. {
  9235. mouldID = Convert.ToInt32(item["MouldID"]);
  9236. if (mouldID == 0)
  9237. {
  9238. mouldID = null;
  9239. }
  9240. }
  9241. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9242. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9243. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9244. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9245. item["GoodsID"], item["GoodsCode"],
  9246. item["StandardGroutingCount"], item["GroutingCount"],
  9247. (mouldID == null ? "0" : "1"));
  9248. }
  9249. ServiceResultEntity result = PCModuleLogicDAL.ChangeGMouldEndGroutingLineDetail(gTable, sUserInfo);
  9250. if (result.Status == Constant.ServiceResultStatus.Success)
  9251. {
  9252. actionResult.Status = (int)Constant.PDAResult.Success;
  9253. }
  9254. else if (result.OtherStatus == -100)
  9255. {
  9256. actionResult.Status = (int)Constant.PDAResult.Fail;
  9257. actionResult.Result = -100;
  9258. actionResult.Message = result.Message;
  9259. return actionResult;
  9260. }
  9261. else
  9262. {
  9263. actionResult.Status = (int)Constant.PDAResult.Fail;
  9264. actionResult.Result = -500;
  9265. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9266. return actionResult;
  9267. }
  9268. return actionResult;
  9269. }
  9270. #endregion
  9271. #region 结束变产
  9272. if (action == "UpdateLineEndGroutingLineDetail")
  9273. {
  9274. if (data == null || !data.ContainsKey("Details"))
  9275. {
  9276. actionResult.Status = (int)Constant.PDAResult.Fail;
  9277. actionResult.Message = "参数错误";
  9278. return actionResult;
  9279. }
  9280. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9281. DataTable gTable = new DataTable();
  9282. gTable.Columns.Add("GroutingLineID", typeof(int));
  9283. gTable.Columns.Add("GroutingLineCode");
  9284. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9285. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9286. gTable.Columns.Add("GroutingMouldCode");
  9287. gTable.Columns.Add("RreasonRemarks");
  9288. gTable.Columns.Add("RecordRemarks");
  9289. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9290. gTable.Columns.Add("MouldID", typeof(int));
  9291. gTable.Columns.Add("MouldCode");
  9292. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9293. gTable.Columns.Add("GoodsID", typeof(int));
  9294. gTable.Columns.Add("GoodsCode");
  9295. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9296. gTable.Columns.Add("GroutingCount", typeof(int));
  9297. gTable.Columns.Add("MouldSource");
  9298. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9299. string groutingLineCode = data["GroutingLineCode"] + "";
  9300. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9301. foreach (Dictionary<string, object> item in details)
  9302. {
  9303. int? mouldID = null;
  9304. if (item.ContainsKey("MouldID"))
  9305. {
  9306. mouldID = Convert.ToInt32(item["MouldID"]);
  9307. if (mouldID == 0)
  9308. {
  9309. mouldID = null;
  9310. }
  9311. }
  9312. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9313. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9314. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9315. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9316. item["GoodsID"], item["GoodsCode"],
  9317. item["StandardGroutingCount"], item["GroutingCount"],
  9318. (mouldID == null ? "0" : "1"));
  9319. }
  9320. ServiceResultEntity result = PCModuleLogicDAL.UpdateLineEndGroutingLineDetail(gTable, 0, sUserInfo);
  9321. if (result.Status == Constant.ServiceResultStatus.Success)
  9322. {
  9323. actionResult.Status = (int)Constant.PDAResult.Success;
  9324. }
  9325. else if (result.OtherStatus == -100)
  9326. {
  9327. actionResult.Status = (int)Constant.PDAResult.Fail;
  9328. actionResult.Result = -100;
  9329. actionResult.Message = result.Message;
  9330. return actionResult;
  9331. }
  9332. else
  9333. {
  9334. actionResult.Status = (int)Constant.PDAResult.Fail;
  9335. actionResult.Result = -500;
  9336. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9337. return actionResult;
  9338. }
  9339. return actionResult;
  9340. }
  9341. #endregion
  9342. #region 结束整线变产
  9343. if (action == "UpdateAllLineEndGroutingLineDetail")
  9344. {
  9345. if (data == null || !data.ContainsKey("Details"))
  9346. {
  9347. actionResult.Status = (int)Constant.PDAResult.Fail;
  9348. actionResult.Message = "参数错误";
  9349. return actionResult;
  9350. }
  9351. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9352. DataTable gTable = new DataTable();
  9353. gTable.Columns.Add("GroutingLineID", typeof(int));
  9354. gTable.Columns.Add("GroutingLineCode");
  9355. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9356. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9357. gTable.Columns.Add("GroutingMouldCode");
  9358. gTable.Columns.Add("Remarks");
  9359. gTable.Columns.Add("RecordRemarks");
  9360. //gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9361. gTable.Columns.Add("MouldID", typeof(int));
  9362. gTable.Columns.Add("MouldCode");
  9363. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9364. gTable.Columns.Add("GoodsID", typeof(int));
  9365. gTable.Columns.Add("GoodsCode");
  9366. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9367. gTable.Columns.Add("GroutingCount", typeof(int));
  9368. gTable.Columns.Add("MouldSource");
  9369. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9370. string groutingLineCode = data["GroutingLineCode"] + "";
  9371. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9372. foreach (Dictionary<string, object> item in details)
  9373. {
  9374. int? mouldID = null;
  9375. if (item.ContainsKey("MouldID"))
  9376. {
  9377. mouldID = Convert.ToInt32(item["MouldID"]);
  9378. if (mouldID == 0)
  9379. {
  9380. mouldID = null;
  9381. }
  9382. }
  9383. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9384. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9385. item["RecordRemarks"], //Convert.ToDateTime(item["OPTimeStamp"]),
  9386. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9387. item["GoodsID"], item["GoodsCode"],
  9388. item["StandardGroutingCount"], item["GroutingCount"],
  9389. (mouldID == null ? "0" : "1"));
  9390. }
  9391. ServiceResultEntity result = PCModuleLogicDAL.UpdateAllLineEndGroutingLineDetail(gTable, null, groutingLineID, lineOPTimeStamp, sUserInfo);
  9392. if (result.Status == Constant.ServiceResultStatus.Success)
  9393. {
  9394. actionResult.Status = (int)Constant.PDAResult.Success;
  9395. }
  9396. else if (result.OtherStatus == -100)
  9397. {
  9398. actionResult.Status = (int)Constant.PDAResult.Fail;
  9399. actionResult.Result = -100;
  9400. actionResult.Message = result.Message;
  9401. return actionResult;
  9402. }
  9403. else
  9404. {
  9405. actionResult.Status = (int)Constant.PDAResult.Fail;
  9406. actionResult.Result = -500;
  9407. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9408. return actionResult;
  9409. }
  9410. return actionResult;
  9411. }
  9412. #endregion
  9413. #region 上模
  9414. if (action == "UpdateGroutingLine_AddMould")
  9415. {
  9416. if (data == null || !data.ContainsKey("Details"))
  9417. {
  9418. actionResult.Status = (int)Constant.PDAResult.Fail;
  9419. actionResult.Message = "参数错误";
  9420. return actionResult;
  9421. }
  9422. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9423. DataTable gTable = new DataTable();
  9424. gTable.Columns.Add("GroutingLineID", typeof(int));
  9425. gTable.Columns.Add("GroutingLineCode");
  9426. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9427. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9428. gTable.Columns.Add("GroutingMouldCode");
  9429. gTable.Columns.Add("Remarks");
  9430. gTable.Columns.Add("RecordRemarks");
  9431. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9432. gTable.Columns.Add("MouldID", typeof(int));
  9433. gTable.Columns.Add("MouldCode");
  9434. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9435. gTable.Columns.Add("GoodsID", typeof(int));
  9436. gTable.Columns.Add("GoodsCode");
  9437. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9438. gTable.Columns.Add("GroutingCount", typeof(int));
  9439. gTable.Columns.Add("MouldSource");
  9440. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9441. string groutingLineCode = data["GroutingLineCode"] + "";
  9442. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9443. foreach (Dictionary<string, object> item in details)
  9444. {
  9445. int? mouldID = null;
  9446. if (item.ContainsKey("MouldID"))
  9447. {
  9448. mouldID = Convert.ToInt32(item["MouldID"]);
  9449. if (mouldID == 0)
  9450. {
  9451. mouldID = null;
  9452. }
  9453. }
  9454. int gldID = Convert.ToInt32(item["GLineDetailID"]);
  9455. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9456. gldID, item["GLineDetailCode"],
  9457. item["DetailRemarks"], item["RecordRemarks"],
  9458. (gldID > 0 ? (object)Convert.ToDateTime(item["OPTimeStamp"]) : null),
  9459. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9460. item["GoodsID"], item["GoodsCode"],
  9461. item["StandardGroutingCount"], item["GroutingCount"],
  9462. (mouldID == null ? "0" : "1"));
  9463. }
  9464. ServiceResultEntity result = PCModuleLogicDAL.UpdateGroutingLine_AddMould(groutingLineID, groutingLineCode, lineOPTimeStamp, gTable, sUserInfo);
  9465. if (result.Status == Constant.ServiceResultStatus.Success)
  9466. {
  9467. actionResult.Status = (int)Constant.PDAResult.Success;
  9468. }
  9469. else if (result.OtherStatus == -2 || result.OtherStatus == -100)
  9470. {
  9471. actionResult.Status = (int)Constant.PDAResult.Fail;
  9472. actionResult.Result = result.OtherStatus;
  9473. actionResult.Message = result.Message;
  9474. return actionResult;
  9475. }
  9476. else if (result.OtherStatus == -10001 || result.OtherStatus == -10002)
  9477. {
  9478. actionResult.Status = -99;
  9479. actionResult.Result = result.OtherStatus;
  9480. actionResult.Message = result.Message;
  9481. return actionResult;
  9482. }
  9483. else
  9484. {
  9485. actionResult.Status = (int)Constant.PDAResult.Fail;
  9486. actionResult.Result = -500;
  9487. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9488. return actionResult;
  9489. }
  9490. return actionResult;
  9491. }
  9492. #endregion
  9493. return actionResult;
  9494. }
  9495. #endregion
  9496. #region 包装装板限制
  9497. if (module == "FinishedLoadingCar")
  9498. {
  9499. if (action == "GetSetting")
  9500. {
  9501. ClientRequestEntity cre = new ClientRequestEntity();
  9502. cre.Properties["GoodsID"] = data["GoodsID"];
  9503. if (data.ContainsKey("logoID"))
  9504. {
  9505. cre.Properties["logoID"] = data["logoID"] + "";
  9506. }
  9507. else
  9508. {
  9509. cre.Properties["logoID"] = "";
  9510. }
  9511. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFinishedLoadingCarSetting(sUserInfo, cre);
  9512. if (sre.Status == Constant.ServiceResultStatus.Success)
  9513. {
  9514. actionResult.Status = (int)Constant.PDAResult.Success;
  9515. foreach (DataRow item in sre.Data.Tables[0].Rows)
  9516. {
  9517. if (item["settingcode"].ToString() == "S_PM_011")
  9518. {
  9519. cre.Properties["S_PM_011"] = item["settingvalue"];
  9520. }
  9521. else if (item["settingcode"].ToString() == "S_PM_012")
  9522. {
  9523. cre.Properties["S_PM_012"] = item["settingvalue"];
  9524. }
  9525. else if (item["settingcode"].ToString() == "S_PM_013")
  9526. {
  9527. cre.Properties["S_PM_013"] = item["settingvalue"];
  9528. }
  9529. }
  9530. DataTable dt = sre.Result as DataTable;
  9531. cre.Properties["PlatelitNum"] = dt.Rows[0]["PLATELIMITNUM"];
  9532. cre.Properties["PlatelitNumNew"] = dt.Rows[0]["PLATELIMITNUMNEW"];
  9533. actionResult.Result = JsonHelper.ToJson(cre.Properties);
  9534. }
  9535. else
  9536. {
  9537. actionResult.Status = (int)Constant.PDAResult.Fail;
  9538. actionResult.Message = "";
  9539. }
  9540. return actionResult;
  9541. }
  9542. }
  9543. #endregion
  9544. #region 成型报损
  9545. if (module == "GroutingScrapProduct")
  9546. {
  9547. // 查询注浆日报明细表
  9548. if ("GetGroutingDailyDetail" == action)
  9549. {
  9550. ClientRequestEntity cre = new ClientRequestEntity();
  9551. cre.NameSpace = module;
  9552. cre.Name = action;
  9553. if (!string.IsNullOrEmpty(jsonData))
  9554. {
  9555. cre.Properties["BarCode"] = data["BarCode"];
  9556. }
  9557. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingDailyDetail(cre, sUserInfo);
  9558. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9559. actionResult.Status = (int)Constant.PDAResult.Success;
  9560. if (sre == null || sre.Data == null || sre.Data.Tables.Count == 0
  9561. || sre.Data.Tables[0].Rows.Count == 0)
  9562. {
  9563. actionResult.Message = "未查询到该产品信息,请确认该产品是否已经进行注浆!";
  9564. actionResult.Status = (int)Constant.PDAResult.Fail;
  9565. }
  9566. else
  9567. {
  9568. DataRow _barCodeRow = sre.Data.Tables[0].Rows[0];
  9569. // 判断是否进行了注浆
  9570. if ("0".Equals(_barCodeRow["GroutingFlag"]))
  9571. {
  9572. actionResult.Message = "该产品还未进行注浆!";
  9573. actionResult.Status = (int)Constant.PDAResult.Fail;
  9574. }
  9575. // 判断是否进行了交坯
  9576. if ("1".Equals(_barCodeRow["DeliverFlag"]))
  9577. {
  9578. actionResult.Message = "该产品已经交坯!";
  9579. actionResult.Status = (int)Constant.PDAResult.Fail;
  9580. }
  9581. // 判断是否已经报损
  9582. if ("1".Equals(_barCodeRow["ScrapFlag"]))
  9583. {
  9584. actionResult.Message = "该产品已经报损!";
  9585. actionResult.Status = (int)Constant.PDAResult.Fail;
  9586. }
  9587. // 该产品已进入生产工序
  9588. if ("1".Equals(_barCodeRow["beginningflag"]))
  9589. {
  9590. actionResult.Message = "该产品已进入生产工序!";
  9591. actionResult.Status = (int)Constant.PDAResult.Fail;
  9592. }
  9593. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9594. }
  9595. }
  9596. // 获取成型报损原因
  9597. else if ("GetScrapReasonData" == action)
  9598. {
  9599. ClientRequestEntity cre = new ClientRequestEntity();
  9600. cre.NameSpace = module;
  9601. cre.Name = action;
  9602. ServiceResultEntity sre = SystemModuleLogic.GetScrapReasonData(cre, sUserInfo, "1");
  9603. actionResult.Status = (int)Constant.PDAResult.Success;
  9604. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9605. }
  9606. // 保存成型报损
  9607. else if ("SaveGroutingScrapProduct" == action)
  9608. {
  9609. ClientRequestEntity cre = new ClientRequestEntity();
  9610. cre.NameSpace = module;
  9611. cre.Name = action;
  9612. if (!string.IsNullOrEmpty(jsonData))
  9613. {
  9614. // DataSet returnData = JsonHelper.FromJson<DataSet>(jsonData);
  9615. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9616. DataTable dtResponsible = JsonHelper.FromJson<DataTable>(data["Table1"] + "");
  9617. if (dt != null && dt.Rows.Count > 0)
  9618. {
  9619. // 总单信息
  9620. DataRow properties = dt.Rows[0];
  9621. cre.Properties["BarCode"] = properties["BarCode"]; // 产品条码
  9622. cre.Properties["GoodsID"] = properties["GoodsID"]; // 产品ID
  9623. cre.Properties["GoodsCode"] = properties["GoodsCode"]; // 产品编码
  9624. cre.Properties["GoodsName"] = properties["GoodsName"]; // 产品名称
  9625. cre.Properties["GroutingDailyID"] = properties["GroutingDailyID"]; // 注浆日报ID
  9626. cre.Properties["GroutingDailyDetailID"] = properties["GroutingDailyDetailID"]; // 注浆日报明细ID
  9627. cre.Properties["GroutingDate"] = properties["GroutingDate"]; // 注浆日期
  9628. cre.Properties["GroutingLineID"] = properties["GroutingLineID"]; // 成型生产线ID
  9629. cre.Properties["GroutingLineCode"] = properties["GroutingLineCode"]; // 成型生产线编码
  9630. cre.Properties["GroutingLineName"] = properties["GroutingLineName"]; // 成型生产线名称
  9631. cre.Properties["GMouldTypeID"] = properties["GMouldTypeID"]; // 成型线类型ID
  9632. cre.Properties["GroutingLineDetailID"] = properties["GroutingLineDetailID"]; // 成型生产线明细ID
  9633. cre.Properties["GroutingMouldCode"] = properties["GroutingMouldCode"]; // 注浆模具编号
  9634. cre.Properties["MouldCode"] = properties["MouldCode"]; // 模具编号
  9635. cre.Properties["GroutingUserID"] = properties["GroutingUserID"]; // 注浆工号ID
  9636. cre.Properties["GroutingUserCode"] = properties["GroutingUserCode"]; // 注浆工号编码
  9637. cre.Properties["GroutingNum"] = properties["GroutingNum"]; // 注浆次数
  9638. cre.Properties["ScrapType"] = properties["ScrapType"]; // 损坯类型
  9639. cre.Properties["ScrapDate"] = properties["ScrapDate"]; // 报损日期
  9640. cre.Properties["ScrapRreasonID"] = properties["ScrapRreasonID"]; // 报损日期
  9641. cre.Properties["ResponUserID"] = properties["ResponUserID"]; // 损坯工号
  9642. cre.Properties["ResponUserCode"] = properties["ResponUserCode"];
  9643. cre.Properties["Remarks"] = properties["Remarks"]; // 备注
  9644. cre.Properties["AuditStatus"] = properties["AuditStatus"]; // 审批状态
  9645. // 责任员工
  9646. cre.Data = new DataSet();
  9647. //DataTable returnTable = returnData.Tables[1].Copy();
  9648. cre.Data.Tables.Add(dtResponsible);
  9649. }
  9650. }
  9651. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveGroutingScrapProduct(cre, sUserInfo);
  9652. if (sre.Status == Constant.ServiceResultStatus.Success)
  9653. {
  9654. actionResult.Status = (int)Constant.PDAResult.Success;
  9655. actionResult.Result = sre.Result;
  9656. }
  9657. else
  9658. {
  9659. actionResult.Status = (int)Constant.PDAResult.Fail;
  9660. actionResult.Result = sre.OtherStatus;
  9661. actionResult.Message = sre.Message;
  9662. }
  9663. }
  9664. // 获取成型报损信息 用于撤销使用
  9665. else if ("GetGroutingScrapProduct" == action)
  9666. {
  9667. ClientRequestEntity cre = new ClientRequestEntity();
  9668. cre.NameSpace = module;
  9669. cre.Name = action;
  9670. if (!string.IsNullOrEmpty(jsonData))
  9671. {
  9672. cre.Properties["BarCode"] = data["BarCode"];
  9673. }
  9674. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrapProduct(cre, sUserInfo);
  9675. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9676. actionResult.Status = (int)Constant.PDAResult.Success;
  9677. }
  9678. //xuwei add 2020-03-23
  9679. //获取成型报损信息 用于撤销使用 支持 浆日报直接报损
  9680. else if ("GetGroutingScrap" == action)
  9681. {
  9682. ClientRequestEntity cre = new ClientRequestEntity();
  9683. cre.NameSpace = module;
  9684. cre.Name = action;
  9685. if (!string.IsNullOrEmpty(jsonData))
  9686. {
  9687. cre.Properties["BarCode"] = data["BarCode"];
  9688. }
  9689. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrap(cre, sUserInfo);
  9690. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9691. actionResult.Status = (int)Constant.PDAResult.Success;
  9692. }
  9693. // 撤销成型报损
  9694. else if ("ReverseGroutingScrapProduct" == action)
  9695. {
  9696. ClientRequestEntity cre = new ClientRequestEntity();
  9697. cre.NameSpace = module;
  9698. cre.Name = action;
  9699. if (!string.IsNullOrEmpty(jsonData))
  9700. {
  9701. cre.Properties["BarCode"] = data["BarCode"];
  9702. }
  9703. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.ReverseGroutingScrapProduct(cre, sUserInfo);
  9704. if (sre.Status == Constant.ServiceResultStatus.Success)
  9705. {
  9706. actionResult.Status = (int)Constant.PDAResult.Success;
  9707. actionResult.Result = sre.Result;
  9708. }
  9709. else
  9710. {
  9711. actionResult.Status = (int)Constant.PDAResult.Fail;
  9712. actionResult.Result = sre.OtherStatus;
  9713. actionResult.Message = sre.Message;
  9714. }
  9715. }
  9716. }
  9717. #endregion
  9718. #region 产品挂起
  9719. if (module == "ProductSuspend")
  9720. {
  9721. // 获取可以挂起的工序(干补、装车、入窑、出窑)工序不能挂起
  9722. if (action == "GetSuspendProcedure")
  9723. {
  9724. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProcedure(sUserInfo);
  9725. if (sre.Status == Constant.ServiceResultStatus.Success)
  9726. {
  9727. actionResult.Status = (int)Constant.PDAResult.Success;
  9728. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9729. }
  9730. else
  9731. {
  9732. actionResult.Status = (int)Constant.PDAResult.Fail;
  9733. actionResult.Message = sre.Message;
  9734. }
  9735. return actionResult;
  9736. }
  9737. // 验证挂起条码
  9738. if (action == "CheckSuspendBarcode")
  9739. {
  9740. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckSuspendBarcode(sUserInfo, data["barcode"] + "");
  9741. if (sre.Status == Constant.ServiceResultStatus.Success)
  9742. {
  9743. actionResult.Status = (int)Constant.PDAResult.Success;
  9744. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9745. }
  9746. else
  9747. {
  9748. actionResult.Status = (int)Constant.PDAResult.Fail;
  9749. actionResult.Message = sre.Message;
  9750. }
  9751. return actionResult;
  9752. }
  9753. // 挂起条码
  9754. if (action == "SaveSuspendProduct")
  9755. {
  9756. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9757. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9758. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveSuspendProduct(sUserInfo, pids, gids, data["remarks"] + "");
  9759. if (sre.Status == Constant.ServiceResultStatus.Success)
  9760. {
  9761. actionResult.Status = (int)Constant.PDAResult.Success;
  9762. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9763. }
  9764. else
  9765. {
  9766. actionResult.Status = (int)Constant.PDAResult.Fail;
  9767. actionResult.Message = sre.Message;
  9768. }
  9769. return actionResult;
  9770. }
  9771. // 撤销挂起条码
  9772. if (action == "DeleteSuspendProduct")
  9773. {
  9774. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9775. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9776. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.DeleteSuspendProduct(sUserInfo, pids, gids);
  9777. if (sre.Status == Constant.ServiceResultStatus.Success)
  9778. {
  9779. actionResult.Status = (int)Constant.PDAResult.Success;
  9780. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9781. }
  9782. else
  9783. {
  9784. actionResult.Status = (int)Constant.PDAResult.Fail;
  9785. actionResult.Message = sre.Message;
  9786. }
  9787. return actionResult;
  9788. }
  9789. // 查询挂起条码
  9790. if (action == "GetSuspendProduct")
  9791. {
  9792. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProduct(sUserInfo, data["barcode"] + "");
  9793. if (sre.Status == Constant.ServiceResultStatus.Success)
  9794. {
  9795. if (sre.Data.Tables[0].Rows.Count == 0)
  9796. {
  9797. actionResult.Status = (int)Constant.PDAResult.Fail;
  9798. actionResult.Message = "此条码没有可撤销的挂起信息";
  9799. }
  9800. else
  9801. {
  9802. actionResult.Status = (int)Constant.PDAResult.Success;
  9803. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9804. }
  9805. }
  9806. else
  9807. {
  9808. actionResult.Status = (int)Constant.PDAResult.Fail;
  9809. actionResult.Message = sre.Message;
  9810. }
  9811. return actionResult;
  9812. }
  9813. }
  9814. #endregion
  9815. #region 品保抽查
  9816. if (module == "QASpotCheck")
  9817. {
  9818. if (action == "GetAllQASpotCheck")
  9819. {
  9820. ClientRequestEntity cre = new ClientRequestEntity();
  9821. cre.NameSpace = module;
  9822. cre.Name = action;
  9823. if (data != null && data.Count > 0)
  9824. {
  9825. foreach (string item in data.Keys)
  9826. {
  9827. if (item.StartsWith("checktime"))
  9828. {
  9829. cre.Properties.Add(item, DateTime.ParseExact(data[item] + "", "yyyy-MM-dd", null));
  9830. }
  9831. else
  9832. {
  9833. cre.Properties.Add(item, data[item]);
  9834. }
  9835. }
  9836. }
  9837. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetAllQASpotCheck(sUserInfo, cre));
  9838. if (sre.Status == Constant.ServiceResultStatus.Success)
  9839. {
  9840. actionResult.Status = (int)Constant.PDAResult.Success;
  9841. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9842. }
  9843. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  9844. {
  9845. actionResult.Status = (int)Constant.PDAResult.Success;
  9846. }
  9847. else
  9848. {
  9849. actionResult.Status = (int)Constant.PDAResult.Fail;
  9850. actionResult.Message = sre.Message;
  9851. }
  9852. return actionResult;
  9853. }
  9854. if (action == "AutoSaveQASpotCheck")
  9855. {
  9856. string barcode = data["barcode"] + "";
  9857. string remarks = data["remarks"] + "";
  9858. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.AutoSaveQASpotCheck(sUserInfo, barcode, remarks));
  9859. if (sre.Status == Constant.ServiceResultStatus.Success)
  9860. {
  9861. actionResult.Status = (int)Constant.PDAResult.Success;
  9862. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9863. }
  9864. else
  9865. {
  9866. actionResult.Status = (int)Constant.PDAResult.Fail;
  9867. actionResult.Message = sre.Message;
  9868. }
  9869. return actionResult;
  9870. }
  9871. if (action == "CheckQASpotCheck")
  9872. {
  9873. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckQASpotCheck(sUserInfo, jsonData));
  9874. if (sre.Status == Constant.ServiceResultStatus.Success)
  9875. {
  9876. actionResult.Status = (int)Constant.PDAResult.Success;
  9877. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9878. }
  9879. else
  9880. {
  9881. actionResult.Status = (int)Constant.PDAResult.Fail;
  9882. actionResult.Message = sre.Message;
  9883. }
  9884. return actionResult;
  9885. }
  9886. if (action == "SaveQASpotCheck")
  9887. {
  9888. data["CheckTime"] = DateTime.ParseExact(data["CheckTime"] + "", "yyyy-MM-dd HH:mm:ss", null);
  9889. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveQASpotCheck(sUserInfo, data));
  9890. if (sre.Status == Constant.ServiceResultStatus.Success)
  9891. {
  9892. actionResult.Status = (int)Constant.PDAResult.Success;
  9893. }
  9894. else
  9895. {
  9896. actionResult.Status = (int)Constant.PDAResult.Fail;
  9897. actionResult.Message = sre.Message;
  9898. }
  9899. return actionResult;
  9900. }
  9901. return null;
  9902. }
  9903. #endregion
  9904. #region 产成品交接
  9905. if (module == "FinishedProduct")
  9906. {
  9907. #region 产成品交接、整板撤销 by fubin 20200824
  9908. // 交接验证
  9909. if (action == "FinishedHandoverBarcode")
  9910. {
  9911. string barcode = data["Barcode"] + "";
  9912. ServiceResultEntity sre = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo);
  9913. if (sre.Data != null && sre.Data.Tables.Count > 0)
  9914. {
  9915. actionResult.Status = (int)Constant.PDAResult.Success;
  9916. actionResult.Result = JsonHelper.ToJson(sre.Data);
  9917. actionResult.Message = sre.Message;
  9918. }
  9919. else
  9920. {
  9921. actionResult.Status = (int)Constant.PDAResult.Fail;
  9922. actionResult.Message = sre.Message;
  9923. }
  9924. return actionResult;
  9925. }
  9926. // 交接操作
  9927. if (action == "SaveFinishedHandover")
  9928. {
  9929. int orderID = Convert.ToInt32(data["OrderID"]);
  9930. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9931. //切换sap地址 by fy 2022年7月5日09:15:23 开始
  9932. //ServiceResultEntity sre = PMModuleLogicDAL.SaveFinishedHandover(orderID, dt, sUserInfo);
  9933. string sapName = "";
  9934. if (data.ContainsKey("SPANAME") && data["SPANAME"] is object &&
  9935. (data["SPANAME"].Equals("APP1") || data["SPANAME"].Equals("APP2") || data["SPANAME"].Equals("APP3")))
  9936. {
  9937. sapName = "_" + data["SPANAME"].ToString();
  9938. }
  9939. else
  9940. {
  9941. sapName = "";
  9942. }
  9943. ServiceResultEntity sre = PMModuleLogicDAL.SaveFinishedHandover(orderID, dt, sUserInfo, sapName);
  9944. //结束
  9945. if (Convert.ToInt32(sre.Result) > 0)
  9946. {
  9947. actionResult.Status = (int)Constant.PDAResult.Success;
  9948. actionResult.Message = "产成品交接成功";
  9949. }
  9950. else
  9951. {
  9952. actionResult.Status = (int)Constant.PDAResult.Fail;
  9953. actionResult.Message = sre.Message;
  9954. }
  9955. return actionResult;
  9956. }
  9957. // 撤销交接验证
  9958. if (action == "BackFinishedHandoverCheck")
  9959. {
  9960. string barcode = data["Barcode"] + "";
  9961. ServiceResultEntity sre = PMModuleLogic.BackFinishedHandoverCheck(barcode, sUserInfo);
  9962. if (sre.Data != null && sre.Data.Tables.Count > 0)
  9963. {
  9964. actionResult.Status = (int)Constant.PDAResult.Success;
  9965. actionResult.Result = JsonHelper.ToJson(sre.Data);
  9966. actionResult.Message = sre.Message;
  9967. }
  9968. else
  9969. {
  9970. actionResult.Status = (int)Constant.PDAResult.Fail;
  9971. actionResult.Message = sre.Message;
  9972. }
  9973. return actionResult;
  9974. }
  9975. // 撤销交接操作
  9976. if (action == "BackFinishedHandover")
  9977. {
  9978. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9979. ServiceResultEntity sre = PMModuleLogicDAL.BackFinishedHandover(dt, sUserInfo);
  9980. if (Convert.ToInt32(sre.Result) > 0)
  9981. {
  9982. actionResult.Status = (int)Constant.PDAResult.Success;
  9983. actionResult.Message = "产成品撤销交接成功";
  9984. }
  9985. else
  9986. {
  9987. actionResult.Status = (int)Constant.PDAResult.Fail;
  9988. actionResult.Message = sre.Message;
  9989. }
  9990. return actionResult;
  9991. }
  9992. #endregion
  9993. // 设定商标
  9994. if (action == "GetFinishedBarcode")
  9995. {
  9996. string barcode = data["barcode"].ToString();
  9997. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 2);
  9998. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9999. if (Convert.ToInt32(resultEntity.Result) < 0)
  10000. {
  10001. actionResult.Status = (int)Constant.PDAResult.Fail;
  10002. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  10003. actionResult.Message = resultEntity.Message;
  10004. }
  10005. else
  10006. {
  10007. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10008. actionResult.Status = (int)Constant.PDAResult.Success;
  10009. actionResult.Message = resultEntity.Message;
  10010. }
  10011. return actionResult;
  10012. }
  10013. if (action == "GetHandoveredBarcode")
  10014. {
  10015. string barcode = data["barcode"].ToString();
  10016. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 1);
  10017. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10018. if (Convert.ToInt32(resultEntity.Result) < 0)
  10019. {
  10020. actionResult.Status = (int)Constant.PDAResult.Fail;
  10021. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  10022. actionResult.Message = resultEntity.Message;
  10023. }
  10024. else
  10025. {
  10026. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10027. actionResult.Status = (int)Constant.PDAResult.Success;
  10028. actionResult.Message = resultEntity.Message;
  10029. }
  10030. return actionResult;
  10031. }
  10032. if (action == "SetFinishedLogo")
  10033. {
  10034. int logoid = Convert.ToInt32(data["logoid"]);
  10035. string[] barcodes = data["barcodes"].ToString().Split(',');
  10036. string returnMessage = "";
  10037. int result = PMModuleLogicDAL.SetFinishedLogo(barcodes, logoid, sUserInfo, out returnMessage);
  10038. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10039. if (result < 0)
  10040. {
  10041. actionResult.Status = (int)Constant.PDAResult.Fail;
  10042. actionResult.Message = returnMessage;
  10043. }
  10044. else
  10045. {
  10046. actionResult.Status = (int)Constant.PDAResult.Success;
  10047. }
  10048. return actionResult;
  10049. }
  10050. if (action == "SetHandoveredOrder")
  10051. {
  10052. int orderID = Convert.ToInt32(data["orderID"]);
  10053. string[] barcodes = data["barcodes"].ToString().Split(',');
  10054. int result = PMModuleLogicDAL.SetHandoveredOrder(barcodes, orderID, sUserInfo);
  10055. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10056. if (result < 0)
  10057. {
  10058. actionResult.Status = (int)Constant.PDAResult.Fail;
  10059. }
  10060. else
  10061. {
  10062. actionResult.Status = (int)Constant.PDAResult.Success;
  10063. }
  10064. return actionResult;
  10065. }
  10066. }
  10067. #endregion
  10068. #region 产成品装车
  10069. /*
  10070. if (module == "FinishedLoading")
  10071. {
  10072. // 设定商标
  10073. if (action == "GetMaxLoadingNo")
  10074. {
  10075. int no = Service.PMModuleService.PMModuleLogic.GetMaxLoadingNo(sUserInfo);
  10076. actionResult.Status = (int)Constant.PDAResult.Success;
  10077. actionResult.Result = no;
  10078. return actionResult;
  10079. }
  10080. if (action == "CheckFinishedLaodingBarcode")
  10081. {
  10082. string barcode = data["barcode"].ToString();
  10083. ServiceResultEntity resultEntity = Service.PMModuleService.PMModuleLogic.CheckFinishedLaodingBarcode(sUserInfo, barcode);
  10084. if (resultEntity.Status == Constant.ServiceResultStatus.Success)
  10085. {
  10086. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10087. actionResult.Status = (int)Constant.PDAResult.Success;
  10088. actionResult.Message = resultEntity.Message;
  10089. }
  10090. else
  10091. {
  10092. actionResult.Status = (int)Constant.PDAResult.Fail;
  10093. actionResult.Result = resultEntity.OtherStatus;
  10094. actionResult.Message = resultEntity.Message;
  10095. }
  10096. return actionResult;
  10097. }
  10098. if (action == "SaveFinishedLoading")
  10099. {
  10100. int loadingNo = Convert.ToInt32(data["loadingNo"]);
  10101. string carLicense = data["carLicense"] + "";
  10102. int palletNum = Convert.ToInt32(data["palletNum"]);
  10103. int goodsNum = Convert.ToInt32(data["goodsNum"]);
  10104. string remarks = data["remarks"] + "";
  10105. Dictionary<string, object>[] details =
  10106. JsonHelper.FromJson<Dictionary<string, object>[]>(data["details"] + "");
  10107. //"[{\"A\":1,\"B\":\"V\"},{\"A\":2,\"B\":\"V1\"}]"
  10108. ServiceResultEntity result = Service.PMModuleService.PMModuleLogic.SaveFinishedLoading(sUserInfo,
  10109. loadingNo, carLicense, palletNum, goodsNum, remarks, details);
  10110. if (result.Status == Constant.ServiceResultStatus.Success)
  10111. {
  10112. actionResult.Status = (int)Constant.PDAResult.Success;
  10113. actionResult.Message = result.Message;
  10114. }
  10115. else
  10116. {
  10117. actionResult.Status = (int)Constant.PDAResult.Fail;
  10118. actionResult.Result = result.OtherStatus;
  10119. actionResult.Message = result.Message;
  10120. }
  10121. return actionResult;
  10122. }
  10123. }
  10124. */
  10125. #endregion
  10126. #region 产成品质量改判
  10127. if (module == "FinishedProductTamper")
  10128. {
  10129. // 获取产成品信息及缺陷数据
  10130. if (action == "GetDefectData")
  10131. {
  10132. string barcode = data["barcode"].ToString();
  10133. ServiceResultEntity sre = PDAModuleLogic.GetDefectData(barcode, sUserInfo);
  10134. if (sre.Status == Constant.ServiceResultStatus.Success)
  10135. {
  10136. actionResult.Status = (int)Constant.PDAResult.Success;
  10137. actionResult.Result = JsonHelper.ToJson(sre.Result);
  10138. actionResult.Message = sre.Message;
  10139. }
  10140. else
  10141. {
  10142. actionResult.Status = (int)Constant.PDAResult.Fail;
  10143. actionResult.Result = sre.OtherStatus;
  10144. actionResult.Message = sre.Message;
  10145. }
  10146. return actionResult;
  10147. }
  10148. // 获取产成品信息及缺陷数据
  10149. if (action == "SaveDefectData")
  10150. {
  10151. ProductionDataEntity productionDataEntity = JsonHelper.FromJson<ProductionDataEntity>(data["ProductionDataEntity"] + "");
  10152. ServiceResultEntity sre = PDAModuleLogic.SaveDefectData(productionDataEntity, sUserInfo);
  10153. if (sre.Status == Constant.ServiceResultStatus.Success)
  10154. {
  10155. actionResult.Status = (int)Constant.PDAResult.Success;
  10156. actionResult.Message = sre.Message;
  10157. }
  10158. else
  10159. {
  10160. actionResult.Status = (int)Constant.PDAResult.Fail;
  10161. actionResult.Message = sre.Message;
  10162. }
  10163. return actionResult;
  10164. }
  10165. // 通过条码查出责任工序(成品改判用)
  10166. if (action == "GetDutyProcedureByBarCodeForTamper")
  10167. {
  10168. string barcode = data["barcode"] + "";
  10169. int defectid = int.Parse(data["defectid"] + "");
  10170. ServiceResultEntity sre = PDAModuleLogic.GetDutyProcedureByBarCodeForTamper(barcode, defectid, sUserInfo.AccountID);
  10171. if (sre.Status == Constant.ServiceResultStatus.Success)
  10172. {
  10173. actionResult.Status = (int)Constant.PDAResult.Success;
  10174. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10175. actionResult.Message = sre.Message;
  10176. }
  10177. else
  10178. {
  10179. actionResult.Status = (int)Constant.PDAResult.Fail;
  10180. actionResult.Result = sre.OtherStatus;
  10181. actionResult.Message = sre.Message;
  10182. }
  10183. return actionResult;
  10184. }
  10185. }
  10186. #endregion
  10187. #region PDA独立功能
  10188. #region 水效标识
  10189. if (module == "WaterEffect")
  10190. {
  10191. // 获取产成品信息及水效标识
  10192. if (action == "GetGoodsByBarCode")
  10193. {
  10194. string barcode = data["barcode"].ToString();
  10195. ServiceResultEntity sre = PDAModuleLogic.GetGoodsByBarCode(barcode, sUserInfo);
  10196. if (sre.Status == Constant.ServiceResultStatus.Success)
  10197. {
  10198. actionResult.Status = (int)Constant.PDAResult.Success;
  10199. actionResult.Result = JsonHelper.ToJson(sre.Result);
  10200. actionResult.Message = sre.Message;
  10201. }
  10202. else
  10203. {
  10204. actionResult.Status = (int)Constant.PDAResult.Fail;
  10205. actionResult.Result = sre.OtherStatus;
  10206. actionResult.Message = sre.Message;
  10207. }
  10208. return actionResult;
  10209. }
  10210. }
  10211. #endregion
  10212. #region 盖板型号
  10213. if (module == "SeatCoverType")
  10214. {
  10215. // 获取产成品信息及水效标识
  10216. if (action == "SendGoodsCodeToPLC")
  10217. {
  10218. string barcode = data["barcode"].ToString();
  10219. int sre = PLCModuleLogic.SendGoodsCodeToPLCBySeatCover(barcode, sUserInfo);
  10220. if (sre == 0)
  10221. {
  10222. actionResult.Status = (int)Constant.PDAResult.Success;
  10223. }
  10224. else
  10225. {
  10226. actionResult.Status = (int)Constant.PDAResult.Fail;
  10227. actionResult.Result = sre;
  10228. switch (sre)
  10229. {
  10230. case 1:
  10231. case 2:
  10232. actionResult.Message = "无效条码";
  10233. break;
  10234. case 3:
  10235. actionResult.Message = "此产品型号没有设置盖板标识码";
  10236. break;
  10237. case 4:
  10238. actionResult.Message = "当前用户没有设置PLC参数";
  10239. break;
  10240. case 5:
  10241. actionResult.Message = "PLC参数设置不全";
  10242. break;
  10243. default:
  10244. actionResult.Message = "PLC通信异常";
  10245. break;
  10246. }
  10247. }
  10248. return actionResult;
  10249. }
  10250. }
  10251. #endregion
  10252. #region PDA PLC 相关功能
  10253. if (module == "PDA_FUN_PLC")
  10254. {
  10255. // PDA扫码发送到PLCServer
  10256. if (action == "SendBarcodeToPLCServer")
  10257. {
  10258. string barcode = data["barcode"].ToString();
  10259. int sre = PLCModuleLogic.SendBarcodeToPLCServer(barcode, sUserInfo);
  10260. if (sre == 0)
  10261. {
  10262. actionResult.Status = (int)Constant.PDAResult.Success;
  10263. }
  10264. else
  10265. {
  10266. actionResult.Status = (int)Constant.PDAResult.Fail;
  10267. actionResult.Result = sre;
  10268. switch (sre)
  10269. {
  10270. case 1:
  10271. case 2:
  10272. actionResult.Message = "无效条码";
  10273. break;
  10274. case 3:
  10275. actionResult.Message = "PLC通信异常";
  10276. break;
  10277. case 4:
  10278. actionResult.Message = "当前用户没有设置PLC参数";
  10279. break;
  10280. case 5:
  10281. actionResult.Message = "PLC参数设置不全";
  10282. break;
  10283. default:
  10284. actionResult.Message = "PLC通信异常";
  10285. break;
  10286. }
  10287. }
  10288. return actionResult;
  10289. }
  10290. }
  10291. #endregion
  10292. #endregion
  10293. #region 半检返修
  10294. if (module == "SemiRework")
  10295. {
  10296. // 验证半检返修条码
  10297. if (action == "CheckSemiReworkBarcode")
  10298. {
  10299. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10300. PMModuleLogic.CheckSemiReworkBarcode(jsonData);
  10301. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10302. if (Convert.ToInt32(resultEntity.Result) < 0)
  10303. {
  10304. actionResult.Status = (int)Constant.PDAResult.Fail;
  10305. }
  10306. else
  10307. {
  10308. actionResult.Status = (int)Constant.PDAResult.Success;
  10309. }
  10310. actionResult.Message = resultEntity.Message;
  10311. return actionResult;
  10312. }
  10313. // 可以返修的工序
  10314. if (action == "GetSemiReworkProcedure")
  10315. {
  10316. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10317. PMModuleLogic.GetSemiReworkProcedure(jsonData, sUserInfo);
  10318. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10319. actionResult.Status = (int)Constant.PDAResult.Success;
  10320. return actionResult;
  10321. }
  10322. // 根据条码获取经过的工序,用于责任工序
  10323. if (action == "GetSemiReworkPassProcedure")
  10324. {
  10325. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10326. PMModuleLogic.GetSemiReworkPassProcedure(jsonData);
  10327. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10328. actionResult.Status = (int)Constant.PDAResult.Success;
  10329. return actionResult;
  10330. }
  10331. // 根据所选生产工序(生产数据ID)查询责任员工
  10332. if (action == "GetSemiReworkDefectStaffByProductionDataID")
  10333. {
  10334. int productionDataID = Convert.ToInt32(jsonData);
  10335. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10336. PMModuleLogic.GetSemiReworkDefectStaffByProductionDataID(productionDataID);
  10337. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10338. actionResult.Status = (int)Constant.PDAResult.Success;
  10339. return actionResult;
  10340. }
  10341. // 根据所选工号,查出缺陷责任员工
  10342. if (action == "GetSemiReworkDefectStaffByUserID")
  10343. {
  10344. int userID = Convert.ToInt32(jsonData);
  10345. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10346. PMModuleLogic.GetSemiReworkDefectStaffByUserID(userID);
  10347. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  10348. actionResult.Status = (int)Constant.PDAResult.Success;
  10349. return actionResult;
  10350. }
  10351. // 新建半检返修
  10352. if (action == "AddSemiRework")
  10353. {
  10354. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  10355. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10356. PMModuleLogic.AddSemiRework(entity, sUserInfo);
  10357. actionResult.Result = resultEntity.Result;
  10358. actionResult.Message = resultEntity.Message;
  10359. if (Convert.ToInt32(resultEntity.Result) > 0)
  10360. {
  10361. actionResult.Status = (int)Constant.PDAResult.Success;
  10362. }
  10363. else
  10364. {
  10365. actionResult.Status = (int)Constant.PDAResult.Fail;
  10366. }
  10367. return actionResult;
  10368. }
  10369. // 编辑半检返修
  10370. if (action == "EditSemiRework")
  10371. {
  10372. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  10373. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10374. PMModuleLogic.EditSemiRework(entity, sUserInfo);
  10375. actionResult.Result = resultEntity.Result;
  10376. actionResult.Message = resultEntity.Message;
  10377. if (Convert.ToInt32(resultEntity.Result) > 0)
  10378. {
  10379. actionResult.Status = (int)Constant.PDAResult.Success;
  10380. }
  10381. else
  10382. {
  10383. actionResult.Status = (int)Constant.PDAResult.Fail;
  10384. }
  10385. return actionResult;
  10386. }
  10387. // 撤销半检返修
  10388. if (action == "CancelSemiRework")
  10389. {
  10390. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  10391. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10392. PMModuleLogic.CancelSemiRework(entity, sUserInfo);
  10393. actionResult.Result = resultEntity.Result;
  10394. actionResult.Message = resultEntity.Message;
  10395. if (Convert.ToInt32(resultEntity.Result) > 0)
  10396. {
  10397. actionResult.Status = (int)Constant.PDAResult.Success;
  10398. }
  10399. else
  10400. {
  10401. actionResult.Status = (int)Constant.PDAResult.Fail;
  10402. }
  10403. return actionResult;
  10404. }
  10405. // 获取半检返修数据(PDA编辑用)
  10406. if (action == "GetSemiReworkByID")
  10407. {
  10408. int id = Convert.ToInt32(jsonData);
  10409. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10410. PMModuleLogic.GetSemiReworkByID(id, sUserInfo.UserCode);
  10411. DataTable data1 = resultEntity.Data.Tables[0];
  10412. DataTable data2 = resultEntity.Data.Tables[1];
  10413. DataTable data3 = resultEntity.Data.Tables[2];
  10414. if (data1.Rows.Count == 0)
  10415. {
  10416. actionResult.Status = (int)Constant.PDAResult.Fail;
  10417. actionResult.Message = "半检返修信息不存在";
  10418. return actionResult;
  10419. }
  10420. SemiReworkEntity srEntity = new SemiReworkEntity();
  10421. srEntity.SemiReworkID = id;
  10422. srEntity.BarCode = data1.Rows[0]["BarCode"] + "";
  10423. srEntity.ReworkProcedureID = Convert.ToInt32(data1.Rows[0]["ReworkProcedureID"]);
  10424. srEntity.Remarks = data1.Rows[0]["Remarks"] + "";
  10425. srEntity.SemiReworkDefects = new List<SemiReworkDefectEntity>();
  10426. foreach (DataRow row2 in data2.Rows)
  10427. {
  10428. SemiReworkDefectEntity defectEntity = new SemiReworkDefectEntity();
  10429. srEntity.SemiReworkDefects.Add(defectEntity);
  10430. defectEntity.SemiReworkDefectID = Convert.ToInt32(row2["SemiReworkDefectID"]);
  10431. defectEntity.SemiReworkID = id;
  10432. defectEntity.DefectID = Convert.ToInt32(row2["DefectID"]);
  10433. defectEntity.DefectCode = row2["DefectCode"] + "";
  10434. defectEntity.DefectName = row2["DefectName"] + "";
  10435. defectEntity.DefectPositionID = Convert.ToInt32(row2["DefectPositionID"]);
  10436. defectEntity.DefectPositionCode = row2["DefectPositionCode"] + "";
  10437. defectEntity.DefectPositionName = row2["DefectPositionName"] + "";
  10438. defectEntity.ScrapResponFlag = row2["ScrapResponFlag"] + "";
  10439. defectEntity.DefectProductionDataID = row2["DefectProductionDataID"].ToNullableInt32();
  10440. defectEntity.DefectProcedureID = row2["DefectProcedureID"].ToNullableInt32();
  10441. defectEntity.DefectProcedureCode = row2["DefectProcedureCode"] + "";
  10442. defectEntity.DefectProcedureName = row2["DefectProcedureName"] + "";
  10443. defectEntity.Remarks = row2["Remarks"] + "";
  10444. defectEntity.DefectUserID = Convert.ToInt32(row2["DefectUserID"]);
  10445. defectEntity.DefectUserCode = row2["DefectUserCode"] + "";
  10446. defectEntity.DefectUserName = row2["DefectUserName"] + "";
  10447. defectEntity.DefectResponsibles = new List<SemiReworkRPSEntity>();
  10448. defectEntity.ValueFlag = Convert.ToInt32(row2["ValueFlag"]);
  10449. DataRow[] row3s = data3.Select("SemiReworkDefectID=" + defectEntity.SemiReworkDefectID);
  10450. if (row3s.Length == 0)
  10451. {
  10452. continue;
  10453. }
  10454. foreach (DataRow row3 in row3s)
  10455. {
  10456. SemiReworkRPSEntity semiReworkRPS = new SemiReworkRPSEntity();
  10457. defectEntity.DefectResponsibles.Add(semiReworkRPS);
  10458. semiReworkRPS.SemiReworkDefectID = Convert.ToInt32(row3["SemiReworkDefectID"]);
  10459. semiReworkRPS.StaffID = Convert.ToInt32(row3["StaffID"]);
  10460. semiReworkRPS.StaffName = row3["StaffName"] + "";
  10461. semiReworkRPS.StaffCode = row3["StaffCode"] + "";
  10462. semiReworkRPS.SemiReworkID = Convert.ToInt32(row3["SemiReworkID"]);
  10463. semiReworkRPS.UserID = Convert.ToInt32(row3["UserID"]);
  10464. semiReworkRPS.UserCode = row3["UserCode"] + "";
  10465. semiReworkRPS.UJobsID = Convert.ToInt32(row3["UJobsID"]);
  10466. semiReworkRPS.SJobsID = Convert.ToInt32(row3["SJobsID"]);
  10467. }
  10468. }
  10469. //xuwei note 总单用于显示,信息较全
  10470. actionResult.Message = JsonHelper.ToJson(data1);
  10471. //xuwei note 总单信息不全,但有明细,用于回传保存
  10472. actionResult.Result = JsonHelper.ToJson(srEntity);
  10473. actionResult.Status = (int)Constant.PDAResult.Success;
  10474. }
  10475. }
  10476. #endregion
  10477. #region 窑车漏扫补件
  10478. if (module == "F_PM_0504")
  10479. {
  10480. // 验证窑车编码是否存在
  10481. if (action == "CheckKilnCar")
  10482. {
  10483. ClientRequestEntity cre = new ClientRequestEntity();
  10484. cre.Properties["kilncarcode"] = data["KilnCarCode"];
  10485. cre.Properties["procedureID"] = data["ProcedureID"];
  10486. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCar(cre, sUserInfo);
  10487. if (sre.Status == Constant.ServiceResultStatus.Success)
  10488. {
  10489. actionResult.Status = (int)Constant.PDAResult.Success;
  10490. actionResult.Result = sre.Result;
  10491. }
  10492. else
  10493. {
  10494. actionResult.Status = (int)Constant.PDAResult.Fail;
  10495. actionResult.Message = sre.Message;
  10496. }
  10497. return actionResult;
  10498. }
  10499. // 验证窑车烧成批次号是否存在 和 是否能补漏扫
  10500. if (action == "CheckKilnCarBatchNo")
  10501. {
  10502. ClientRequestEntity cre = new ClientRequestEntity();
  10503. cre.Properties["KilnID"] = data["KilnID"];
  10504. cre.Properties["KilnCarID"] = data["KilnCarID"];
  10505. cre.Properties["ProcedureID"] = data["ProcedureID"];
  10506. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  10507. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCarBatchNo(cre, sUserInfo);
  10508. if (sre.Status == Constant.ServiceResultStatus.Success)
  10509. {
  10510. actionResult.Status = (int)Constant.PDAResult.Success;
  10511. }
  10512. else
  10513. {
  10514. actionResult.Status = (int)Constant.PDAResult.Fail;
  10515. actionResult.Message = sre.Message;
  10516. }
  10517. return actionResult;
  10518. }
  10519. // 窑车漏扫补件
  10520. if (action == "SetKilnCarMissing")
  10521. {
  10522. ClientRequestEntity cre = new ClientRequestEntity();
  10523. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  10524. string carData = data["CarData"] + "";
  10525. DataTable dataTable = JsonHelper.FromJson<DataTable>(carData);
  10526. cre.Data = new DataSet();
  10527. cre.Data.Tables.Add(dataTable);
  10528. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.SetKilnCarMissing(cre, sUserInfo);
  10529. if (sre.Status == Constant.ServiceResultStatus.Success)
  10530. {
  10531. actionResult.Status = (int)Constant.PDAResult.Success;
  10532. }
  10533. else
  10534. {
  10535. actionResult.Status = (int)Constant.PDAResult.Fail;
  10536. actionResult.Message = sre.Message;
  10537. }
  10538. return actionResult;
  10539. }
  10540. }
  10541. #endregion
  10542. #region 梭式窑入窑
  10543. else if (module == "F_PM_0505")
  10544. {
  10545. // 验证窑车编码是否存在
  10546. if (action == "GetAllKilntInfo")
  10547. {
  10548. DataSet dsKilntInfo = SystemModuleLogic.GetAllKilntInfo(sUserInfo);
  10549. if (dsKilntInfo != null && dsKilntInfo.Tables.Count > 0)
  10550. {
  10551. actionResult.Status = (int)Constant.PDAResult.Success;
  10552. actionResult.Result = JsonHelper.ToJson(dsKilntInfo.Tables[0]);
  10553. }
  10554. else
  10555. {
  10556. actionResult.Status = (int)Constant.PDAResult.Fail;
  10557. }
  10558. return actionResult;
  10559. }
  10560. // 保存梭式窑入窑计数
  10561. if (action == "SaveSKBatchNo")
  10562. {
  10563. ClientRequestEntity cre = new ClientRequestEntity();
  10564. cre.Properties["KilnCode"] = data["KilnCode"];
  10565. cre.Properties["Remarks"] = data["Remarks"];
  10566. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.SaveSKBatchNo(cre, sUserInfo);
  10567. if (sre.Status == Constant.ServiceResultStatus.Success)
  10568. {
  10569. if (sre.OtherStatus > 0)
  10570. {
  10571. actionResult.Status = (int)Constant.PDAResult.Success;
  10572. }
  10573. else
  10574. {
  10575. actionResult.Status = (int)Constant.PDAResult.Fail;
  10576. actionResult.Message = sre.Message;
  10577. }
  10578. }
  10579. else
  10580. {
  10581. actionResult.Status = (int)Constant.PDAResult.Fail;
  10582. actionResult.Message = sre.Message;
  10583. }
  10584. return actionResult;
  10585. }
  10586. }
  10587. #endregion
  10588. #region 重启3#高压注浆
  10589. else if (module == "F_PM_0107")
  10590. {
  10591. // 查询3#高压注浆线
  10592. if (action == "GetGroutingLine3")
  10593. {
  10594. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.GetGroutingLine3(sUserInfo);
  10595. if (sre.Data != null && sre.Data.Tables.Count > 0)
  10596. {
  10597. actionResult.Status = (int)Constant.PDAResult.Success;
  10598. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  10599. }
  10600. else
  10601. {
  10602. actionResult.Status = (int)Constant.PDAResult.Fail;
  10603. }
  10604. return actionResult;
  10605. }
  10606. // 重置注浆批次
  10607. if (action == "SaveGroutingLine3")
  10608. {
  10609. ClientRequestEntity cre = new ClientRequestEntity();
  10610. cre.Properties["GroutingLineID"] = data["GroutingLineID"];
  10611. cre.Properties["H_BatchNo"] = data["H_BatchNo"];
  10612. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.SaveGroutingLine3(cre, sUserInfo);
  10613. if (sre.Status == Constant.ServiceResultStatus.Success)
  10614. {
  10615. if (sre.OtherStatus > 0)
  10616. {
  10617. actionResult.Status = (int)Constant.PDAResult.Success;
  10618. }
  10619. else
  10620. {
  10621. actionResult.Status = (int)Constant.PDAResult.Fail;
  10622. actionResult.Message = sre.Message;
  10623. }
  10624. }
  10625. else
  10626. {
  10627. actionResult.Status = (int)Constant.PDAResult.Fail;
  10628. actionResult.Message = sre.Message;
  10629. }
  10630. return actionResult;
  10631. }
  10632. }
  10633. #endregion
  10634. #region 3#条码打印机(PDA用)
  10635. // 3#配置工位打印机
  10636. else if (module == "01070804")
  10637. {
  10638. // 获取3#条码打印机配置(PDA用)
  10639. if (action == "GetWorkStationPrinter3")
  10640. {
  10641. ServiceResultEntity sre = SystemModuleLogic.GetWorkStationPrinter3(sUserInfo);
  10642. if (sre.Data != null && sre.Data.Tables.Count > 0)
  10643. {
  10644. actionResult.Status = (int)Constant.PDAResult.Success;
  10645. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10646. }
  10647. else
  10648. {
  10649. actionResult.Status = (int)Constant.PDAResult.Fail;
  10650. }
  10651. return actionResult;
  10652. }
  10653. // 保存3#条码打印机配置(PDA用)
  10654. else if (action == "SaveWorkStationPrinter3")
  10655. {
  10656. ClientRequestEntity cre = new ClientRequestEntity();
  10657. cre.Properties["WorkStationID"] = data["WorkStationID"];
  10658. cre.Properties["PrinterID1"] = data["PrinterID1"];
  10659. cre.Properties["PrinterID2"] = data["PrinterID2"];
  10660. cre.Properties["PrinterID3"] = data["PrinterID3"];
  10661. ServiceResultEntity sre = SystemModuleLogic.SaveWorkStationPrinter3(cre, sUserInfo);
  10662. if (sre.Status == Constant.ServiceResultStatus.Success)
  10663. {
  10664. if (sre.OtherStatus > 0)
  10665. {
  10666. actionResult.Status = (int)Constant.PDAResult.Success;
  10667. }
  10668. else
  10669. {
  10670. actionResult.Status = (int)Constant.PDAResult.Fail;
  10671. actionResult.Message = sre.Message;
  10672. }
  10673. }
  10674. else
  10675. {
  10676. actionResult.Status = (int)Constant.PDAResult.Fail;
  10677. actionResult.Message = sre.Message;
  10678. }
  10679. return actionResult;
  10680. }
  10681. }
  10682. // 3#条码打印
  10683. else if (module == "01070805")
  10684. {
  10685. // 获取3#条码打印机配置(PDA用)
  10686. if (action == "GetWorkStationPrinter3")
  10687. {
  10688. ServiceResultEntity sre = SystemModuleLogic.GetWorkStationPrinter3(sUserInfo);
  10689. if (sre.Data != null && sre.Data.Tables.Count > 0)
  10690. {
  10691. actionResult.Status = (int)Constant.PDAResult.Success;
  10692. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10693. }
  10694. else
  10695. {
  10696. actionResult.Status = (int)Constant.PDAResult.Fail;
  10697. }
  10698. return actionResult;
  10699. }
  10700. // 条码打印(PDA用)
  10701. else if (action == "PrintBarcode_3BL")
  10702. {
  10703. ClientRequestEntity cre = new ClientRequestEntity();
  10704. cre.Properties["Barcode"] = data["Barcode"];
  10705. cre.Properties["WorkStationID"] = data["WorkStationID"];
  10706. ServiceResultEntity sre = SystemModuleLogic.PrintBarcode_3BL(cre, sUserInfo);
  10707. if (sre.Status == Constant.ServiceResultStatus.Success)
  10708. {
  10709. if (sre.Result != null)
  10710. {
  10711. actionResult.Status = (int)Constant.PDAResult.Success;
  10712. }
  10713. else
  10714. {
  10715. actionResult.Status = (int)Constant.PDAResult.Fail;
  10716. actionResult.Message = sre.Message;
  10717. }
  10718. }
  10719. else
  10720. {
  10721. actionResult.Status = (int)Constant.PDAResult.Fail;
  10722. actionResult.Message = sre.Message;
  10723. }
  10724. return actionResult;
  10725. }
  10726. }
  10727. // 3#条码补打
  10728. else if (module == "01070806")
  10729. {
  10730. // 获取3#条码打印机配置(PDA用)
  10731. if (action == "GetWorkStationPrinter3")
  10732. {
  10733. ServiceResultEntity sre = SystemModuleLogic.GetWorkStationPrinter3(sUserInfo);
  10734. if (sre.Data != null && sre.Data.Tables.Count > 0)
  10735. {
  10736. actionResult.Status = (int)Constant.PDAResult.Success;
  10737. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10738. }
  10739. else
  10740. {
  10741. actionResult.Status = (int)Constant.PDAResult.Fail;
  10742. }
  10743. return actionResult;
  10744. }
  10745. // 补打3#条码(PDA用)
  10746. else if (action == "PrintBarcode_3BL_B")
  10747. {
  10748. ClientRequestEntity cre = new ClientRequestEntity();
  10749. cre.Properties["Barcode"] = data["Barcode"];
  10750. if (data.ContainsKey("PrinterID1"))
  10751. cre.Properties["PrinterID1"] = data["PrinterID1"];
  10752. if (data.ContainsKey("PrinterID2"))
  10753. cre.Properties["PrinterID2"] = data["PrinterID2"];
  10754. if (data.ContainsKey("PrinterID3"))
  10755. cre.Properties["PrinterID3"] = data["PrinterID3"];
  10756. ServiceResultEntity sre = SystemModuleLogic.PrintBarcode_3BL_B(cre, sUserInfo);
  10757. if (sre.Status == Constant.ServiceResultStatus.Success)
  10758. {
  10759. if (sre.Result != null)
  10760. {
  10761. actionResult.Status = (int)Constant.PDAResult.Success;
  10762. }
  10763. else
  10764. {
  10765. actionResult.Status = (int)Constant.PDAResult.Fail;
  10766. actionResult.Message = sre.Message;
  10767. }
  10768. }
  10769. else
  10770. {
  10771. actionResult.Status = (int)Constant.PDAResult.Fail;
  10772. actionResult.Message = sre.Message;
  10773. }
  10774. return actionResult;
  10775. }
  10776. }
  10777. #endregion
  10778. #region 获取3#成检二检PLC重量
  10779. else if (module == "GetPLCWeight")
  10780. {
  10781. // 获取3#条码打印机配置(PDA用)
  10782. if (action == "GetPLCWeight")
  10783. {
  10784. actionResult.Result = PMModuleLogic.Get3PLCWeight(sUserInfo);
  10785. actionResult.Status = (int)Constant.PDAResult.Success;
  10786. return actionResult;
  10787. }
  10788. }
  10789. #endregion
  10790. #region 注浆绑码时,验证成型线是否能绑码
  10791. else if (module == "CheckGroutingLine")
  10792. {
  10793. if (action == "CheckGroutingLine")
  10794. {
  10795. ServiceResultEntity sre = PDAModuleLogic.CheckGroutingLine(data["GroutingLineCode"] + "");
  10796. if (sre.OtherStatus < 0)
  10797. {
  10798. actionResult.Status = (int)Constant.PDAResult.Fail;
  10799. actionResult.Message = sre.Message;
  10800. }
  10801. else
  10802. {
  10803. actionResult.Status = (int)Constant.PDAResult.Success;
  10804. }
  10805. return actionResult;
  10806. }
  10807. }
  10808. #endregion
  10809. #region 注浆绑码选批次查询最小启用的模具编码
  10810. else if (module == "GetGroutingMouldByBatchNo")
  10811. {
  10812. if (action == "GetGroutingMouldByBatchNo")
  10813. {
  10814. string groutingLineCode = data["groutingLineCode"] + "";
  10815. string groutingDay = data["groutingDay"] + "";
  10816. string groutingBatchNo = data["groutingBatchNo"] + "";
  10817. string groutingMouldCode = data["groutingMouldCode"] + "";
  10818. ServiceResultEntity sre = PDAModuleLogic.GetGroutingMouldByBatchNo(groutingMouldCode, groutingLineCode, groutingDay, groutingBatchNo);
  10819. if (sre.Status == Constant.ServiceResultStatus.Success)
  10820. {
  10821. actionResult.Status = (int)Constant.PDAResult.Success;
  10822. actionResult.Result = JsonHelper.ToJson(sre.Result);
  10823. actionResult.Message = sre.Message;
  10824. }
  10825. else
  10826. {
  10827. actionResult.Status = (int)Constant.PDAResult.Fail;
  10828. actionResult.Result = sre.OtherStatus;
  10829. actionResult.Message = sre.Message;
  10830. }
  10831. return actionResult;
  10832. }
  10833. }
  10834. #endregion
  10835. #region 3#半检一检交坯
  10836. else if (module == "SemiQualityStatistics")
  10837. {
  10838. if (action == "SemiQualityStatisticsDeliver3")
  10839. {
  10840. ServiceResultEntity sre = PMModuleLogicDAL.SemiQualityStatisticsDeliver3(data, sUserInfo);
  10841. if (sre.OtherStatus < 0)
  10842. {
  10843. actionResult.Status = (int)Constant.PDAResult.Fail;
  10844. actionResult.Message = sre.Message;
  10845. }
  10846. else
  10847. {
  10848. actionResult.Status = (int)Constant.PDAResult.Success;
  10849. }
  10850. return actionResult;
  10851. }
  10852. }
  10853. #endregion
  10854. #region 产品分级(3车间)
  10855. else if (module == "0628")
  10856. {
  10857. if (action == "CheckOneLevelType")
  10858. {
  10859. string barcode = data["Barcode"] + "";
  10860. ServiceResultEntity sre = PDAModuleLogic.CheckOneLevelType(barcode);
  10861. if (sre.OtherStatus < 0)
  10862. {
  10863. actionResult.Status = (int)Constant.PDAResult.Fail;
  10864. actionResult.Message = sre.Message;
  10865. }
  10866. else
  10867. {
  10868. actionResult.Status = (int)Constant.PDAResult.Success;
  10869. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  10870. }
  10871. return actionResult;
  10872. }
  10873. if (action == "SaveOneLevelType")
  10874. {
  10875. int? levelTypeID = data["LevelTypeID"].ToNullableInt32();
  10876. string barcode = data["Barcode"] + "";
  10877. ServiceResultEntity sre = PDAModuleLogic.SaveOneLevelType(levelTypeID, barcode);
  10878. if (sre.OtherStatus < 0)
  10879. {
  10880. actionResult.Status = (int)Constant.PDAResult.Fail;
  10881. actionResult.Message = sre.Message;
  10882. }
  10883. else
  10884. {
  10885. actionResult.Status = (int)Constant.PDAResult.Success;
  10886. }
  10887. return actionResult;
  10888. }
  10889. }
  10890. #endregion
  10891. #region 半检查询责任工序(3车间)
  10892. else if (module == "GetDutyProcedureByBarCode3")
  10893. {
  10894. if (action == "GetDutyProcedureByBarCode3")
  10895. {
  10896. string barcode = data["barcode"] + "";
  10897. int defectid = Convert.ToInt32(data["defectid"] + "");
  10898. int procedureid = Convert.ToInt32(data["procedureid"] + "");
  10899. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  10900. () => PMModuleLogic.GetDutyProcedureByBarCode(barcode, defectid, sUserInfo.AccountID, procedureid));
  10901. if (dutyProcedureDs != null)
  10902. {
  10903. actionResult.Status = (int)Constant.PDAResult.Success;
  10904. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs);
  10905. }
  10906. else
  10907. {
  10908. actionResult.Status = (int)Constant.PDAResult.Fail;
  10909. }
  10910. return actionResult;
  10911. }
  10912. }
  10913. #endregion
  10914. #region 成品检验
  10915. if (module == "ProductionData")
  10916. {
  10917. //扫码查询
  10918. if (action == "CheckBarcode")
  10919. {
  10920. string barcode = data["barcode"] + "";
  10921. ServiceResultEntity sre = Service.PCModuleService.FinishedCheckLogic.GetProductionID(barcode);
  10922. int procedureID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["finishedcheckprocedureid"]);
  10923. sre = Service.PCModuleService.FinishedCheckLogic.CheckBarcode(procedureID, barcode, sUserInfo);
  10924. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10925. if (Convert.ToInt32(sre.Result) < 0)
  10926. {
  10927. actionResult.Status = (int)Constant.PDAResult.Fail;
  10928. actionResult.Result = sre.OtherStatus; //漏扫1,反之0
  10929. actionResult.Message = sre.Message;
  10930. }
  10931. else
  10932. {
  10933. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10934. actionResult.Status = (int)Constant.PDAResult.Success;
  10935. actionResult.Message = sre.Message;
  10936. }
  10937. return actionResult;
  10938. }
  10939. //撤销查询
  10940. if (action == "GetFinishedCancleData")
  10941. {
  10942. string barcode = data["barcode"] + "";
  10943. ServiceResultEntity sre = Service.PCModuleService.FinishedCheckLogic.GetFinishedCancleData(barcode, sUserInfo);
  10944. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  10945. if (Convert.ToInt32(sre.Result) < 0)
  10946. {
  10947. actionResult.Status = (int)Constant.PDAResult.Fail;
  10948. actionResult.Result = sre.OtherStatus; //漏扫1,反之0
  10949. actionResult.Message = sre.Message;
  10950. }
  10951. else
  10952. {
  10953. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10954. actionResult.Status = (int)Constant.PDAResult.Success;
  10955. actionResult.Message = sre.Message;
  10956. }
  10957. return actionResult;
  10958. }
  10959. //保存成品检验
  10960. if (action == "AddCheckBarcode")
  10961. {
  10962. int procedureID = Convert.ToInt32(data["procedureID"]);
  10963. //DataTable TableProductionData = JsonHelper.FromJson<DataTable>(data["productionData"] + "");
  10964. //缺陷
  10965. //DataTable productionDefectTable = JsonHelper.FromJson<DataTable>(data["productionDefectTable"] + "");
  10966. //责任员工
  10967. //DataTable DSTableStaff = JsonHelper.FromJson<DataTable>(data["dSTableStaff"] + "");
  10968. //漏检员工
  10969. //DataTable DSTableMissedStaff = JsonHelper.FromJson<DataTable>(data["dSTableMissedStaff"] + "");
  10970. //图片
  10971. //DataTable DSTableImage = JsonHelper.FromJson<DataTable>(data["dSTableImage"] + "");
  10972. //ProductionDataEntity[] productionDataEntitys = new ProductionDataEntity[TableProductionData.Rows.Count];
  10973. #region 转换实体
  10974. //for (int i = 0; i < TableProductionData.Rows.Count; i++)
  10975. //{
  10976. // if (TableProductionData.Rows[i]["ReadOnly"].ToString() == "1") //只读数据不进行保存
  10977. // {
  10978. // continue;
  10979. // }
  10980. // ProductionDataEntity productionDataEntity = new ProductionDataEntity();
  10981. // if (TableProductionData.Rows[i]["ProductionDataID"].ToString() != "")
  10982. // {
  10983. // productionDataEntity.ProductionDataID = Convert.ToInt32(TableProductionData.Rows[i]["ProductionDataID"]);
  10984. // }
  10985. // productionDataEntity.Barcode = TableProductionData.Rows[i]["BarCode"].ToString();
  10986. // productionDataEntity.UserID = sUserInfo.UserID;
  10987. // productionDataEntity.UserCode = sUserInfo.UserCode;
  10988. // productionDataEntity.UserName = sUserInfo.UserName; ;
  10989. // productionDataEntity.DefectFlag = Convert.ToInt32(TableProductionData.Rows[i]["GoodsLevelTypeID"]) == 4 ? 1 : 2;
  10990. // productionDataEntity.GoodsLevelID = Convert.ToInt32(TableProductionData.Rows[i]["DefectFlagID"]);
  10991. // productionDataEntity.GoodsLevelTypeID = Convert.ToInt32(TableProductionData.Rows[i]["GoodsLevelTypeID"]);
  10992. // productionDataEntity.Remarks = TableProductionData.Rows[i]["Remarks"].ToString();
  10993. // if (TableProductionData.Rows[i]["LogoID"].ToString() != "")
  10994. // {
  10995. // productionDataEntity.LogoID = Convert.ToInt32(TableProductionData.Rows[i]["LogoID"]);
  10996. // }
  10997. // if (TableProductionData.Rows[i]["OPTimeStamp"].ToString() != "")
  10998. // {
  10999. // productionDataEntity.OPTimeStamp = Convert.ToDateTime(TableProductionData.Rows[i]["OPTimeStamp"]);
  11000. // }
  11001. // if (TableProductionData.Rows[i]["CheckTime"].ToString() != "")
  11002. // {
  11003. // productionDataEntity.CheckTime = Convert.ToDateTime(TableProductionData.Rows[i]["CheckTime"]);
  11004. // }
  11005. // if (TableProductionData.Rows[i]["OrgGoodsLevelTypeID"].ToString() != "-1")
  11006. // {
  11007. // productionDataEntity.OrgGoodsLevelTypeID = Convert.ToInt32(TableProductionData.Rows[i]["OrgGoodsLevelTypeID"]);
  11008. // }
  11009. // if (!string.IsNullOrEmpty(TableProductionData.Rows[i]["ReworkProcedureID"].ToString()))
  11010. // {
  11011. // productionDataEntity.ReworkProcedureID = int.Parse(TableProductionData.Rows[i]["ReworkProcedureID"].ToString());
  11012. // productionDataEntity.IsReworked = 1;
  11013. // }
  11014. // productionDataEntitys[i] = productionDataEntity;
  11015. // List<ProductionDefectEntity> productionDefectEntitys = new List<ProductionDefectEntity>();
  11016. // ProductionDefectEntity productionDefectEntity = null;
  11017. // for (int j = 0; j < productionDefectTable.Rows.Count; j++) //缺陷列表
  11018. // {
  11019. // productionDefectEntity = new ProductionDefectEntity();
  11020. // productionDefectEntity.SpecialDefect = productionDefectTable.Rows[j]["IsOtherDefect"].ToString();
  11021. // //if (productionDefectTable.Rows[j]["DefectDeductionID"].ToString() != "-1"
  11022. // // && productionDefectTable.Rows[j]["DefectDeductionID"].ToString() != string.Empty)
  11023. // //{
  11024. // // productionDefectEntity.DefectDeductionNum = Convert.ToDecimal(productionDefectTable.Rows[j]["DefectDeductionNum"]);
  11025. // //}
  11026. // if (!string.IsNullOrEmpty(productionDefectTable.Rows[j]["DefectDeductionNum"] + ""))
  11027. // {
  11028. // productionDefectEntity.DefectDeductionNum = Convert.ToDecimal(productionDefectTable.Rows[j]["DefectDeductionNum"]);
  11029. // }
  11030. // productionDefectEntity.ScrapResponFlag = "0";
  11031. // productionDefectEntity.DefectID =
  11032. // Convert.ToInt32(productionDefectTable.Rows[j]["DefectID"]);
  11033. // productionDefectEntity.DefectCode =
  11034. // productionDefectTable.Rows[j]["DefectCode"].ToString();
  11035. // productionDefectEntity.DefectName =
  11036. // productionDefectTable.Rows[j]["DefectName"].ToString().Replace(productionDefectEntity.DefectCode + "->", "");
  11037. // productionDefectEntity.DefectPositionID =
  11038. // Convert.ToInt32(productionDefectTable.Rows[j]["DefectPositionID"]);
  11039. // productionDefectEntity.DefectPositionCode =
  11040. // productionDefectTable.Rows[j]["DefectPositionCode"].ToString();
  11041. // productionDefectEntity.DefectPositionName =
  11042. // productionDefectTable.Rows[j]["DefectPositionName"].ToString().Replace(productionDefectEntity.DefectPositionCode + "->", "");
  11043. // productionDefectEntity.DefectProductionDataID =
  11044. // Convert.ToInt32(productionDefectTable.Rows[j]["ProductionDataID"] + "");
  11045. // if (productionDefectEntity.DefectProductionDataID == 0)
  11046. // {
  11047. // productionDefectEntity.DefectProductionDataID = null;
  11048. // }
  11049. // if (productionDefectTable.Rows[j]["DefectProcedureID"].ToString() != string.Empty &&
  11050. // Convert.ToInt32(productionDefectTable.Rows[j]["DefectProcedureID"] + "") > Constant.INT_IS_ZERO)
  11051. // {
  11052. // productionDefectEntity.DefectProcedureID =
  11053. // Convert.ToInt32(productionDefectTable.Rows[j]["DefectProcedureID"]);
  11054. // }
  11055. // productionDefectEntity.DefectProcedureCode =
  11056. // productionDefectTable.Rows[j]["DefectProcedureCode"].ToString();
  11057. // productionDefectEntity.DefectProcedureName =
  11058. // productionDefectTable.Rows[j]["DefectProcedureName"].ToString();
  11059. // productionDefectEntity.DefectUserID =
  11060. // Convert.ToInt32(productionDefectTable.Rows[j]["DefectUserID"]);
  11061. // productionDefectEntity.DefectUserCode =
  11062. // productionDefectTable.Rows[j]["DefectUserCode"].ToString();
  11063. // productionDefectEntity.DefectUserName =
  11064. // productionDefectTable.Rows[j]["DefectUserName"].ToString();
  11065. // productionDefectEntity.DefectJobs =
  11066. // Convert.ToInt32(productionDefectTable.Rows[j]["Jobs"].ToString());
  11067. // productionDefectEntity.Remarks =
  11068. // productionDefectTable.Rows[j]["DefectRemarks"].ToString();
  11069. // productionDefectEntity.Remarks =
  11070. // productionDefectTable.Rows[j]["DefectRemarks"].ToString();
  11071. // if (productionDefectTable.Rows[j]["DefectFineID"].ToString() != "-1"
  11072. // && productionDefectTable.Rows[j]["DefectFineID"].ToString() != string.Empty)
  11073. // {
  11074. // productionDefectEntity.DefectFine = Convert.ToInt32(productionDefectTable.Rows[j]["DefectFineID"]);
  11075. // }
  11076. // if (productionDefectTable.Rows[j]["CheckTime"].ToString() != string.Empty)
  11077. // {
  11078. // //if (Convert.ToInt32(this.TableProductionData.Rows[i]["OrgGoodsLevelTypeID"]) == Convert.ToInt32(this.TableProductionData.Rows[i]["GoodsLevelTypeID"]))
  11079. // //{
  11080. // productionDefectEntity.CheckTime = Convert.ToDateTime(productionDefectTable.Rows[j]["CheckTime"]);
  11081. // //}
  11082. // }
  11083. // if (productionDefectTable.Rows[j]["MissedUserID"].ToString() != "-1"
  11084. // && productionDefectTable.Rows[j]["MissedUserID"].ToString() != string.Empty)
  11085. // {
  11086. // productionDefectEntity.MissedUserID = Convert.ToInt32(productionDefectTable.Rows[j]["MissedUserID"]);
  11087. // productionDefectEntity.MissedUserCode = productionDefectTable.Rows[j]["MissedUserCode"].ToString();
  11088. // productionDefectEntity.MissedUserName = productionDefectTable.Rows[j]["MissedUserName"].ToString();
  11089. // }
  11090. // // 遍历责任员工
  11091. // List<DefectResponsibleEntity> DefectResponsibles = new List<DefectResponsibleEntity>();
  11092. // if (DSTableStaff != null && DSTableStaff.Rows.Count > 0)
  11093. // {
  11094. // DefectResponsibleEntity defectResponsibleEntity = null;
  11095. // foreach (DataRow drStaff in DSTableStaff.Rows)
  11096. // {
  11097. // if (Convert.ToInt32(drStaff["IsSelected"]) == Constant.INT_IS_ONE)
  11098. // {
  11099. // defectResponsibleEntity = new DefectResponsibleEntity();
  11100. // defectResponsibleEntity.StaffID = Convert.ToInt32(drStaff["StaffID"]);
  11101. // defectResponsibleEntity.UserID = Convert.ToInt32(productionDefectEntity.DefectUserID);
  11102. // defectResponsibleEntity.UserCode = productionDefectEntity.DefectUserCode;
  11103. // defectResponsibleEntity.UJobsID =
  11104. // Convert.ToInt32(productionDefectTable.Rows[j]["Jobs"].ToString());
  11105. // defectResponsibleEntity.SJobsID =
  11106. // Convert.ToInt32(productionDefectTable.Rows[j]["Jobs"].ToString());
  11107. // defectResponsibleEntity.StaffStatus = Convert.ToInt32(drStaff["StaffStatus"]);
  11108. // DefectResponsibles.Add(defectResponsibleEntity);
  11109. // }
  11110. // }
  11111. // //productionDefectEntity.DefectResponsibles = DefectResponsibles.ToArray();//每个缺陷对应的责任员工
  11112. // productionDefectEntity.DefectResponsibles = DefectResponsibles;//每个缺陷对应的责任员工
  11113. // }
  11114. // // 遍历漏检责任员工
  11115. // List<DefectMissedResponsibleEntity> DefectMissedResponsibles = new List<DefectMissedResponsibleEntity>();
  11116. // if (DSTableMissedStaff != null && DSTableMissedStaff.Rows.Count > 0)
  11117. // {
  11118. // DefectMissedResponsibleEntity defectMissedResponsibleEntity = null;
  11119. // foreach (DataRow drStaff in DSTableMissedStaff.Rows)
  11120. // {
  11121. // if (Convert.ToInt32(drStaff["IsSelected"]) == Constant.INT_IS_ONE)
  11122. // {
  11123. // defectMissedResponsibleEntity = new DefectMissedResponsibleEntity();
  11124. // defectMissedResponsibleEntity.StaffID = Convert.ToInt32(drStaff["StaffID"]);
  11125. // defectMissedResponsibleEntity.UserID = Convert.ToInt32(productionDefectEntity.DefectUserID);
  11126. // defectMissedResponsibleEntity.UserCode = productionDefectEntity.DefectUserCode;
  11127. // defectMissedResponsibleEntity.UJobsID = Convert.ToInt32(drStaff["UJobsID"]);
  11128. // defectMissedResponsibleEntity.SJobsID = Convert.ToInt32(drStaff["SJobsID"]);
  11129. // defectMissedResponsibleEntity.StaffStatus = Convert.ToInt32(drStaff["StaffStatus"]);
  11130. // DefectMissedResponsibles.Add(defectMissedResponsibleEntity);
  11131. // }
  11132. // }
  11133. // //productionDefectEntity.DefectMissedResponsibles = DefectMissedResponsibles.ToArray();
  11134. // productionDefectEntity.DefectMissedResponsibles = DefectMissedResponsibles;
  11135. // }
  11136. // // 遍历缺陷图片
  11137. // if (DSTableImage != null && DSTableImage.Rows.Count > 0)
  11138. // {
  11139. // List<DefectImageEntity> defectImageEntitys = new List<DefectImageEntity>();
  11140. // DefectImageEntity defectImageEntity = null;
  11141. // foreach (DataRow drImage in DSTableImage.Rows)
  11142. // {
  11143. // defectImageEntity = new DefectImageEntity();
  11144. // defectImageEntity.Thumbnail = (byte[])drImage["ImageByte"];
  11145. // defectImageEntity.Image = (byte[])drImage["orgImageByte"];
  11146. // defectImageEntitys.Add(defectImageEntity);
  11147. // }
  11148. // productionDefectEntity.DefectImages = defectImageEntitys;
  11149. // }
  11150. // productionDefectEntitys.Add(productionDefectEntity);
  11151. // }
  11152. // productionDataEntitys[i].ProductionDefects = productionDefectEntitys;
  11153. // }
  11154. #endregion
  11155. ProductionDataEntity[] productionDataEntitys = JsonHelper.FromJson<ProductionDataEntity[]>(data["productionDataEntitys"] + "");
  11156. DataTable bomDetailTable = new DataTable();
  11157. if (data["bomDetailTable"] != null)
  11158. {
  11159. bomDetailTable = JsonHelper.FromJson<DataTable>(data["bomDetailTable"] + "");
  11160. }
  11161. ServiceResultEntity sre = Service.PCModuleService.FinishedCheckLogic.AddCheckBarcode(procedureID, productionDataEntitys, bomDetailTable, sUserInfo);
  11162. if (Convert.ToInt32(sre.Result) > 0)
  11163. {
  11164. actionResult.Status = (int)Constant.PDAResult.Success;
  11165. actionResult.Message = "保存成功";
  11166. }
  11167. else
  11168. {
  11169. actionResult.Status = (int)Constant.PDAResult.Fail;
  11170. actionResult.Message = sre.Message;
  11171. }
  11172. return actionResult;
  11173. }
  11174. //撤销
  11175. if (action == "FinishedCancleData")
  11176. {
  11177. int productionDataID = Convert.ToInt32(data["productionDataID"]);
  11178. ServiceResultEntity sre = Service.PCModuleService.FinishedCheckLogic.FinishedCancleData(productionDataID, sUserInfo);
  11179. if (Convert.ToInt32(sre.OtherStatus) > 0)
  11180. {
  11181. actionResult.Status = (int)Constant.PDAResult.Success;
  11182. actionResult.Message = "撤销成功";
  11183. }
  11184. else
  11185. {
  11186. actionResult.Status = (int)Constant.PDAResult.Fail;
  11187. actionResult.Message = sre.Message;
  11188. }
  11189. return actionResult;
  11190. }
  11191. //查询用户
  11192. if (action == "CheckProcedureUser")
  11193. {
  11194. string userCode1 = data["UserCode"] + "";
  11195. ServiceResultEntity sre = Service.PCModuleService.FinishedCheckLogic.CheckProcedureUser(userCode1, sUserInfo);
  11196. if (Convert.ToInt32(sre.Result) < 0)
  11197. {
  11198. actionResult.Status = (int)Constant.PDAResult.Fail;
  11199. actionResult.Result = sre.OtherStatus;
  11200. actionResult.Message = sre.Message;
  11201. }
  11202. else
  11203. {
  11204. actionResult.Result = JsonHelper.ToJson(sre.Data);
  11205. actionResult.Status = (int)Constant.PDAResult.Success;
  11206. actionResult.Message = sre.Message;
  11207. }
  11208. return actionResult;
  11209. }
  11210. }
  11211. #endregion
  11212. #region BPM同步日志 add xiacm 2022-11-17
  11213. else if (module == "BARCODEIDNRKSCRAP")
  11214. {
  11215. if (action == "GetBarcodeIdnrkScrap")
  11216. {
  11217. //组件唯一编码
  11218. string IdnrkOnlyCode = data["IdnrkOnlyCode"].ToString();
  11219. // 确认日期
  11220. DateTime createTime = DateTime.Now.Date;
  11221. if (data.ContainsKey("CreateTime") && !string.IsNullOrEmpty(data["CreateTime"] + ""))
  11222. {
  11223. createTime = Convert.ToDateTime(data["CreateTime"].ToString());
  11224. }
  11225. // 确认标识(1:确认;2:撤销)
  11226. string confirmFlag = data["ConfirmFlag"].ToString();
  11227. string message = string.Empty;
  11228. DataSet IdnrkOnlyCodeDs = ServiceInvoker.Invoke(this,
  11229. () => PMModuleLogic.GetIdnrkOnlyCode(IdnrkOnlyCode, createTime, confirmFlag, sUserInfo, out message));
  11230. if (IdnrkOnlyCodeDs != null)
  11231. {
  11232. if (string.IsNullOrEmpty(message))
  11233. {
  11234. actionResult.Status = (int)Constant.PDAResult.Success;
  11235. actionResult.Result = JsonHelper.ToJson(IdnrkOnlyCodeDs);
  11236. }
  11237. else
  11238. {
  11239. actionResult.Status = (int)Constant.PDAResult.Fail;
  11240. actionResult.Message = message;
  11241. }
  11242. }
  11243. else
  11244. {
  11245. actionResult.Status = (int)Constant.PDAResult.Fail;
  11246. actionResult.Message = message;
  11247. }
  11248. return actionResult;
  11249. }
  11250. if (action == "ConfirmBarcodeIdnrkScrap")
  11251. {
  11252. ClientRequestEntity cre = new ClientRequestEntity();
  11253. DataTable dtBarcodeIdnrkScrap = JsonHelper.FromJson<DataTable>(data["Table1"] + "");
  11254. DateTime createTime = DateTime.Now.Date;
  11255. if (data.ContainsKey("CreateTime") && !string.IsNullOrEmpty(data["CreateTime"] + ""))
  11256. {
  11257. createTime = Convert.ToDateTime(data["CreateTime"].ToString());
  11258. }
  11259. cre.Data = new DataSet();
  11260. cre.Data.Tables.Add(dtBarcodeIdnrkScrap);
  11261. // 确认日期
  11262. cre.Properties["CreateTime"] = createTime;
  11263. // 确认标识(1:确认;2:撤销)
  11264. cre.Properties["ConfirmFlag"] = data["ConfirmFlag"].ToString();
  11265. if (dtBarcodeIdnrkScrap != null && dtBarcodeIdnrkScrap.Rows.Count > 0)
  11266. {
  11267. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11268. () => PMModuleLogic.ConfirmBarcodeIdnrkScrap(cre, sUserInfo));
  11269. if (Convert.ToInt32(sre.Result) <= 0)
  11270. {
  11271. actionResult.Status = (int)Constant.PDAResult.Fail;
  11272. actionResult.Message = sre.Message;
  11273. }
  11274. else
  11275. {
  11276. actionResult.Status = (int)Constant.PDAResult.Success;
  11277. actionResult.Message = "保存成功";
  11278. }
  11279. }
  11280. else
  11281. {
  11282. actionResult.Status = (int)Constant.PDAResult.Fail;
  11283. }
  11284. return actionResult;
  11285. }
  11286. }
  11287. #endregion
  11288. #region 次品扫描功能 20230406 by qq
  11289. if (module == "Recycling")
  11290. {
  11291. //扫码查询
  11292. if (action == "RecyclingAddBarcode")
  11293. {
  11294. string barcode = data["barcode"] + "";
  11295. string type = data["type"] + "";
  11296. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  11297. () => PMModuleLogic.RecyclingAddBarcode(barcode, type, sUserInfo));
  11298. if (Convert.ToInt32(sre.Result) <= 0)
  11299. {
  11300. actionResult.Status = (int)Constant.PDAResult.Fail;
  11301. actionResult.Message = sre.Message;
  11302. }
  11303. else
  11304. {
  11305. actionResult.Status = (int)Constant.PDAResult.Success;
  11306. actionResult.Message = "保存成功";
  11307. }
  11308. return actionResult;
  11309. }
  11310. }
  11311. #endregion
  11312. return actionResult;
  11313. }
  11314. catch (Exception ex)
  11315. {
  11316. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  11317. OutputLog.TraceLog(LogPriority.Error,
  11318. this.ToString(),
  11319. System.Reflection.MethodBase.GetCurrentMethod().Name + System.Environment.NewLine +
  11320. JsonHelper.ToJson(sUserInfo) + System.Environment.NewLine +
  11321. " module:" + module + " action:" + action + " json:" + jsonData,
  11322. ex.ToString(),
  11323. LocalPath.LogExePath);
  11324. actionResult.Status = (int)Constant.PDAResult.Exception;
  11325. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  11326. }
  11327. return actionResult;
  11328. }
  11329. #endregion
  11330. }
  11331. }