PDAModuleService.cs 393 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117
  1. /*******************************************************************************
  2. * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:PDAModuleService.cs
  5. * 2.功能描述:PDA模块WCF服务
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 陈晓野 2014/09/16 1.00 新建
  9. *******************************************************************************/
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Data;
  13. using System.IO;
  14. using System.ServiceModel;
  15. using System.ServiceModel.Activation;
  16. using Curtain.Log;
  17. using Dongke.IBOSS.PRD.Basics.BaseResources;
  18. using Dongke.IBOSS.PRD.Basics.Library;
  19. using Dongke.IBOSS.PRD.Service.BarcodePrintService;
  20. using Dongke.IBOSS.PRD.Service.CommonModuleLogic;
  21. using Dongke.IBOSS.PRD.Service.DataModels;
  22. using Dongke.IBOSS.PRD.Service.DKIBOSSPRDLogic;
  23. using Dongke.IBOSS.PRD.Service.PCModuleLogic;
  24. using Dongke.IBOSS.PRD.Service.PDAModuleLogic;
  25. using Dongke.IBOSS.PRD.Service.PMModuleLogic;
  26. using Dongke.IBOSS.PRD.Service.PublicModuleService;
  27. using Dongke.IBOSS.PRD.Service.ReportModuleLogic;
  28. using Dongke.IBOSS.PRD.Service.SmartDeviceService;
  29. using Dongke.IBOSS.PRD.Service.SystemModuleLogic;
  30. using Dongke.IBOSS.PRD.WCF.Contracts;
  31. using Dongke.IBOSS.PRD.WCF.DataModels;
  32. using Dongke.IBOSS.PRD.WCF.DataModels.ConfigModule;
  33. using Dongke.IBOSS.PRD.WCF.DataModels.HRModule;
  34. using Dongke.IBOSS.PRD.WCF.DataModels.PCModule;
  35. using Dongke.IBOSS.PRD.WCF.DataModels.PMModule;
  36. namespace Dongke.IBOSS.PRD.WCF.Services
  37. {
  38. // 服务实现类,继承服务声明接口
  39. // 该标签声明该服务可以在ASP.NET下运行
  40. [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
  41. [ServiceBehavior(ConfigurationName = "PDAModuleService",
  42. InstanceContextMode = InstanceContextMode.PerCall,
  43. ConcurrencyMode = ConcurrencyMode.Multiple,
  44. UseSynchronizationContext = false)]
  45. public partial class PDAModuleService : IPDAModule
  46. {
  47. #region 属性
  48. /// <summary>
  49. /// 用户登陆的信息
  50. /// </summary>
  51. SUserInfo sUserInfo
  52. {
  53. get;
  54. set;
  55. }
  56. #endregion
  57. #region 构造函数
  58. /// <summary>
  59. /// 构造函数
  60. /// </summary>
  61. public PDAModuleService()
  62. : base()
  63. {
  64. }
  65. #endregion
  66. #region 验证
  67. /// <summary>
  68. /// 验证访问头
  69. /// </summary>
  70. /// <param name="accountCode">帐套编码</param>
  71. /// <param name="userCode">用户编码</param>
  72. /// <param name="userPassword">用户密码</param>
  73. /// <param name="sessionKey">访问密钥</param>
  74. /// <returns></returns>
  75. private ActionResult DoPDACheck(string accountCode, string userCode, string userPassword, string sessionKey)
  76. {
  77. try
  78. {
  79. ActionResult actionResult = new ActionResult();
  80. LoginRequestEntity requestEntity = new LoginRequestEntity();
  81. requestEntity.AccountCode = accountCode;
  82. requestEntity.UserCode = userCode;
  83. requestEntity.Password = userPassword;
  84. requestEntity.SessionKey = sessionKey;
  85. SUserInfo userInfo = null;
  86. string loginStatus = DKIBOSSPRDLogic.AuthenticateRepeatLogin(requestEntity, out userInfo);
  87. // 用户登录信息错误
  88. if (Constant.INT_IS_ONE.ToString().Equals(loginStatus))
  89. {
  90. actionResult.Status = (int)Constant.PDAResult.LoginInfoError;
  91. actionResult.Message = Constant.PDA_RESULT_LOGININFOERROR;
  92. }
  93. // 用户在其它终端登陆
  94. else if (Constant.INT_IS_TWO.ToString().Equals(loginStatus))
  95. {
  96. actionResult.Status = (int)Constant.PDAResult.RepeatLogin;
  97. actionResult.Message = Constant.PDA_RESULT_REPEATLOGIN;
  98. }
  99. // Lic错误
  100. else if ("3".Equals(loginStatus))
  101. {
  102. actionResult.Status = (int)Constant.PDAResult.LicInfoError;
  103. actionResult.Message = "授权信息错误,请联系管理员。";
  104. }
  105. else
  106. {
  107. actionResult.Status = (int)Constant.PDAResult.Success;
  108. }
  109. sUserInfo = userInfo;
  110. return actionResult;
  111. }
  112. catch (Exception ex)
  113. {
  114. throw ex;
  115. }
  116. }
  117. #endregion
  118. #region WCF服务
  119. /// <summary>
  120. /// 测试PDA连接WCF服务
  121. /// </summary>
  122. /// <param name="value">测试文本</param>
  123. /// <returns>返回文本</returns>
  124. public string TestConnectionEx(string value)
  125. {
  126. return "连接成功!" + value;
  127. }
  128. public string TestConnection()
  129. {
  130. return "连接成功!";
  131. }
  132. #endregion
  133. #region 系统登录
  134. /// <summary>
  135. /// 系统登录
  136. /// </summary>
  137. /// <param name="accountCode"></param>
  138. /// <param name="userCode"></param>
  139. /// <param name="userPassword"></param>
  140. /// <param name="macAddress"></param>
  141. /// <param name="ipAddress"></param>
  142. /// <param name="phoneCode"></param>
  143. /// <param name="phoneType"></param>
  144. /// <param name="appVersion"></param>
  145. /// <param name="systemType"></param>
  146. /// <param name="systemVersion"></param>
  147. /// <returns></returns>
  148. public PDALoginResult DoPDALogin(string accountCode, string userCode, string userPassword,
  149. string macAddress, string ipAddress, string phoneCode, string phoneType,
  150. string appVersion, string systemType, string systemVersion,string IMEI)
  151. {
  152. try
  153. {
  154. LoginRequestEntity requestEntity = new LoginRequestEntity();
  155. requestEntity.AccountCode = accountCode;
  156. requestEntity.UserCode = userCode;
  157. requestEntity.Password = userPassword;
  158. requestEntity.ComputerName = phoneCode;
  159. requestEntity.IPAddress = ipAddress;
  160. requestEntity.MACAddress = macAddress;
  161. requestEntity.IMEI = IMEI;
  162. PDALoginResult result = ServiceInvoker.Invoke<PDALoginResult>(this,
  163. () => PDAModuleLogic.DoPDALogin(requestEntity));
  164. return result;
  165. }
  166. catch (Exception ex)
  167. {
  168. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  169. OutputLog.TraceLog(LogPriority.Error,
  170. this.ToString(),
  171. System.Reflection.MethodBase.GetCurrentMethod().Name,
  172. ex.ToString(),
  173. LocalPath.LogExePath);
  174. PDALoginResult result = new PDALoginResult();
  175. result.Status = (int)Constant.PDAResult.Exception;
  176. result.Message = Constant.PDA_RESULT_EXCEPTION;
  177. return result;
  178. }
  179. }
  180. /// <summary>
  181. /// 退出
  182. /// </summary>
  183. /// <param name="accountCode">帐套code</param>
  184. /// <param name="userCode">用户code</param>
  185. /// <param name="userPassword">用户密码</param>
  186. /// <param name="sessionKey">本次登陆密钥</param>
  187. /// <returns></returns>
  188. public ActionResult DoPDAOut(string accountCode, string userCode, string userPassword, string sessionKey)
  189. {
  190. ActionResult actionResult = new ActionResult();
  191. try
  192. {
  193. // 验证请求头信息
  194. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  195. // 验证失败
  196. if (actionResult.Status != (int)Constant.PDAResult.Success)
  197. {
  198. return actionResult;
  199. }
  200. bool result = DKIBOSSPRDLogic.Logout(sUserInfo.UserID, "3", sUserInfo);
  201. actionResult.Result = JsonHelper.ToJson(result);
  202. actionResult.Status = (int)Constant.PDAResult.Success;
  203. }
  204. catch (Exception ex)
  205. {
  206. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  207. OutputLog.TraceLog(LogPriority.Error,
  208. this.ToString(),
  209. System.Reflection.MethodBase.GetCurrentMethod().Name,
  210. ex.ToString(),
  211. LocalPath.LogExePath);
  212. actionResult.Status = (int)Constant.PDAResult.Exception;
  213. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  214. }
  215. return actionResult;
  216. }
  217. /// <summary>
  218. /// 修改密码
  219. /// </summary>
  220. /// <param name="accountCode"></param>
  221. /// <param name="userCode"></param>
  222. /// <param name="userPassword"></param>
  223. /// <param name="sessionKey"></param>
  224. /// <returns></returns>
  225. public ActionResult ChangeUserPassword(string accountCode, string userCode, string userPassword, string sessionKey,
  226. string newPassWord)
  227. {
  228. ActionResult actionResult = new ActionResult();
  229. try
  230. {
  231. // 验证请求头信息
  232. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  233. // 验证失败
  234. if (actionResult.Status != (int)Constant.PDAResult.Success)
  235. {
  236. return actionResult;
  237. }
  238. string result = ServiceInvoker.Invoke<string>(this,
  239. () => SystemModuleDAL.SaveUserPassWord(newPassWord, userCode, null, sUserInfo));
  240. actionResult.Status = (int)Constant.PDAResult.Success;
  241. }
  242. catch (Exception ex)
  243. {
  244. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  245. OutputLog.TraceLog(LogPriority.Error,
  246. this.ToString(),
  247. System.Reflection.MethodBase.GetCurrentMethod().Name,
  248. ex.ToString(),
  249. LocalPath.LogExePath);
  250. actionResult.Status = (int)Constant.PDAResult.Exception;
  251. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  252. }
  253. return actionResult;
  254. }
  255. #endregion
  256. #region 取得展示数据
  257. /// <summary>
  258. /// 获得生产线菜单
  259. /// </summary>
  260. /// <param name="accountCode">帐套code</param>
  261. /// <param name="userCode">用户code</param>
  262. /// <param name="userPassword">用户密码</param>
  263. /// <param name="sessionKey">本次登陆密钥</param>
  264. /// <returns></returns>
  265. /// <remarks>
  266. /// 陈冰 2014.09.18 新建
  267. /// </remarks>
  268. public ActionResult GetProductionLineMenu(string accountCode, string userCode, string userPassword, string sessionKey)
  269. {
  270. ActionResult actionResult = new ActionResult();
  271. try
  272. {
  273. // 验证请求头信息
  274. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  275. // 验证失败
  276. if (actionResult.Status != (int)Constant.PDAResult.Success)
  277. {
  278. return actionResult;
  279. }
  280. // 查询菜单
  281. DataTable dtPLM = ServiceInvoker.Invoke<DataTable>(this,
  282. () => PDAModuleLogic.GetProductionLineMenu(sUserInfo));
  283. PDAFunctionResult pdaFunction = new PDAFunctionResult();
  284. pdaFunction.MenuCode = "Root";
  285. DataRow[] navigationRows = dtPLM.Select("LEN(MenuCode) = " + Constant.INT_IS_TWO.ToString(), "MenuCode ASC"); // 编号2为一级菜单
  286. foreach (DataRow newRow in navigationRows)
  287. {
  288. #region 插入子节点数据
  289. int? intProcedureID = null;
  290. int? intModelType = null;
  291. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  292. {
  293. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  294. }
  295. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  296. {
  297. intModelType = Convert.ToInt32(newRow["ModelType"]);
  298. }
  299. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  300. //xuwei add 2020-01-02
  301. pdaFunctionChild.IsGlazeChange = string.IsNullOrEmpty(newRow["IsGlazeChange"].ToString()) ? 0 : Convert.ToInt32(newRow["IsGlazeChange"].ToString());
  302. //pdaFunctionChild.IsGlazeChange = 0;
  303. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  304. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  305. pdaFunctionChild.ProcedureID = intProcedureID;
  306. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  307. pdaFunctionChild.ModelType = intModelType;
  308. pdaFunction.PDAFunctions.Add(pdaFunctionChild);
  309. #endregion
  310. InitTreeView(dtPLM, newRow["MenuCode"].ToString(), pdaFunctionChild);
  311. }
  312. //actionResult.Result = JsonHelper.ToJson(dtPLM);
  313. actionResult.Result = JsonHelper.ToJson(pdaFunction);
  314. actionResult.Status = (int)Constant.PDAResult.Success;
  315. }
  316. catch (Exception ex)
  317. {
  318. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  319. OutputLog.TraceLog(LogPriority.Error,
  320. this.ToString(),
  321. System.Reflection.MethodBase.GetCurrentMethod().Name,
  322. ex.ToString(),
  323. LocalPath.LogExePath);
  324. actionResult.Status = (int)Constant.PDAResult.Exception;
  325. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  326. }
  327. return actionResult;
  328. }
  329. /// <summary>
  330. /// 初始化树形控件
  331. /// </summary>
  332. /// <param name="treeTable">菜单数据表</param>
  333. /// <param name="rows">待处理的菜单集合</param>
  334. /// <param name="node">当前树节点</param>
  335. private void InitTreeView(DataTable treeTable, string pFuncCode, PDAFunctionResult pFunctions)
  336. {
  337. string filterExpression = "MenuCode LIKE '" + pFuncCode + "%' AND LEN(MenuCode) = "
  338. + (pFuncCode.Length + Constant.INT_IS_TWO);
  339. DataRow[] subRows = treeTable.Select(filterExpression, "MenuCode ASC");
  340. //DataRow[] subRows = treeTable.Select(filterExpression, "ProcedureCode ASC");
  341. foreach (DataRow newRow in subRows)
  342. {
  343. #region 插入子节点数据
  344. int? intProcedureID = null;
  345. int? intModelType = null;
  346. if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString()))
  347. {
  348. intProcedureID = Convert.ToInt32(newRow["ProcedureID"]);
  349. }
  350. if (!string.IsNullOrEmpty(newRow["ModelType"].ToString()))
  351. {
  352. intModelType = Convert.ToInt32(newRow["ModelType"]);
  353. }
  354. PDAFunctionResult pdaFunctionChild = new PDAFunctionResult();
  355. //xuwei add 2020-01-02
  356. pdaFunctionChild.IsGlazeChange = string.IsNullOrEmpty(newRow["IsGlazeChange"].ToString()) ? 0 : Convert.ToInt32(newRow["IsGlazeChange"].ToString());
  357. //pdaFunctionChild.IsGlazeChange = 0;
  358. pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString();
  359. pdaFunctionChild.MenuName = newRow["MenuName"].ToString();
  360. pdaFunctionChild.ProcedureID = intProcedureID;
  361. pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString();
  362. pdaFunctionChild.ModelType = intModelType;
  363. pFunctions.PDAFunctions.Add(pdaFunctionChild);
  364. #endregion
  365. // 递归方法
  366. InitTreeView(treeTable, newRow["MenuCode"].ToString(), pdaFunctionChild);
  367. }
  368. }
  369. #endregion
  370. #region 获得工序信息
  371. /// <summary>
  372. /// 获得工序信息
  373. /// </summary>
  374. /// <param name="accountCode">帐套code</param>
  375. /// <param name="userCode">用户code</param>
  376. /// <param name="userPassword">用户密码</param>
  377. /// <param name="sessionKey">本次登陆密钥</param>
  378. /// <param name="procedureID">工序ID</param>
  379. /// <returns></returns>
  380. /// <remarks>
  381. /// 陈冰 2014.09.18 新建
  382. /// </remarks>
  383. public ActionResult GetProcedureByID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  384. {
  385. ActionResult actionResult = new ActionResult();
  386. try
  387. {
  388. // 验证请求头信息
  389. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  390. // 验证失败
  391. if (actionResult.Status != (int)Constant.PDAResult.Success)
  392. {
  393. return actionResult;
  394. }
  395. ProcedureEntity procedureEntity = ServiceInvoker.Invoke<ProcedureEntity>(this,
  396. () => PMModuleLogic.GetProcedureDataEntityByID(procedureID, sUserInfo));
  397. actionResult.Result = JsonHelper.ToJson(procedureEntity);
  398. actionResult.Status = (int)Constant.PDAResult.Success;
  399. }
  400. catch (Exception ex)
  401. {
  402. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  403. OutputLog.TraceLog(LogPriority.Error,
  404. this.ToString(),
  405. System.Reflection.MethodBase.GetCurrentMethod().Name,
  406. ex.ToString(),
  407. LocalPath.LogExePath);
  408. actionResult.Status = (int)Constant.PDAResult.Exception;
  409. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  410. }
  411. return actionResult;
  412. }
  413. #endregion
  414. #region 校验
  415. /// <summary>
  416. /// 校验产品条码是否可以走到该工序
  417. /// </summary>
  418. /// <param name="accountCode">帐套code</param>
  419. /// <param name="userCode">用户code</param>
  420. /// <param name="userPassword">用户密码</param>
  421. /// <param name="sessionKey">本次登陆密钥</param>
  422. /// <param name="procedureID">工序ID</param>
  423. /// <param name="barcode">条码</param>
  424. /// <returns></returns>
  425. /// <remarks>
  426. /// 陈冰 2014.09.18 新建
  427. /// </remarks>
  428. public ActionResult CheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  429. {
  430. ActionResult actionResult = new ActionResult();
  431. try
  432. {
  433. // 验证请求头信息
  434. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  435. // 验证失败
  436. if (actionResult.Status != (int)Constant.PDAResult.Success)
  437. {
  438. return actionResult;
  439. }
  440. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  441. () => PMModuleLogic.CheckBarcodePDA(procedureID, barcode, sUserInfo));
  442. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  443. {
  444. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  445. actionResult.Status = (int)Constant.PDAResult.Success;
  446. }
  447. else
  448. {
  449. actionResult.Status = (int)Constant.PDAResult.Fail;
  450. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  451. }
  452. }
  453. catch (Exception ex)
  454. {
  455. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  456. OutputLog.TraceLog(LogPriority.Error,
  457. this.ToString(),
  458. System.Reflection.MethodBase.GetCurrentMethod().Name,
  459. ex.ToString(),
  460. LocalPath.LogExePath);
  461. actionResult.Status = (int)Constant.PDAResult.Exception;
  462. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  463. }
  464. return actionResult;
  465. }
  466. /// <summary>
  467. /// 校验产品条码是否可以进行干补
  468. /// </summary>
  469. /// <param name="accountCode">帐套code</param>
  470. /// <param name="userCode">用户code</param>
  471. /// <param name="userPassword">用户密码</param>
  472. /// <param name="sessionKey">本次登陆密钥</param>
  473. /// <param name="procedureID">工序ID</param>
  474. /// <param name="barcode">条码</param>
  475. /// <returns></returns>
  476. /// <remarks>
  477. /// 袁新成 2015.4.1 新建
  478. /// </remarks>
  479. public ActionResult CheckDryRepairBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  480. {
  481. ActionResult actionResult = new ActionResult();
  482. try
  483. {
  484. // 验证请求头信息
  485. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  486. // 验证失败
  487. if (actionResult.Status != (int)Constant.PDAResult.Success)
  488. {
  489. return actionResult;
  490. }
  491. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  492. () => PMModuleLogic.CheckDryRepairBarcode(procedureID, barcode, sUserInfo));
  493. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  494. {
  495. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  496. actionResult.Status = (int)Constant.PDAResult.Success;
  497. }
  498. else
  499. {
  500. actionResult.Status = (int)Constant.PDAResult.Fail;
  501. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  502. }
  503. }
  504. catch (Exception ex)
  505. {
  506. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  507. OutputLog.TraceLog(LogPriority.Error,
  508. this.ToString(),
  509. System.Reflection.MethodBase.GetCurrentMethod().Name,
  510. ex.ToString(),
  511. LocalPath.LogExePath);
  512. actionResult.Status = (int)Constant.PDAResult.Exception;
  513. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  514. }
  515. return actionResult;
  516. }
  517. /// <summary>
  518. /// 检验生产工号
  519. /// </summary>
  520. /// <param name="accountCode">帐套code</param>
  521. /// <param name="userCode">用户code</param>
  522. /// <param name="userPassword">用户密码</param>
  523. /// <param name="sessionKey">本次登陆密钥</param>
  524. /// <param name="procedureID">工序ID</param>
  525. /// <param name="procedureUserCode">生产工号</param>
  526. /// <remarks>
  527. /// 陈冰 2014.09.18 新建
  528. /// </remarks>
  529. public ActionResult CheckProcedureUser(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string procedureUserCode)
  530. {
  531. ActionResult actionResult = new ActionResult();
  532. try
  533. {
  534. // 验证请求头信息
  535. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  536. // 验证失败
  537. if (actionResult.Status != (int)Constant.PDAResult.Success)
  538. {
  539. return actionResult;
  540. }
  541. CheckProcedureUserResult checkProcedureUserResult = ServiceInvoker.Invoke<CheckProcedureUserResult>(this,
  542. () => PMModuleLogic.CheckProcedureUser(procedureID, procedureUserCode, sUserInfo));
  543. actionResult.Result = JsonHelper.ToJson(checkProcedureUserResult);
  544. actionResult.Status = (int)Constant.PDAResult.Success;
  545. }
  546. catch (Exception ex)
  547. {
  548. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  549. OutputLog.TraceLog(LogPriority.Error,
  550. this.ToString(),
  551. System.Reflection.MethodBase.GetCurrentMethod().Name,
  552. ex.ToString(),
  553. LocalPath.LogExePath);
  554. actionResult.Status = (int)Constant.PDAResult.Exception;
  555. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  556. }
  557. return actionResult;
  558. }
  559. /// <summary>
  560. /// 校验窑车是否可装车并返回窑车信息
  561. /// </summary>
  562. /// <param name="accountCode">帐套code</param>
  563. /// <param name="userCode">用户code</param>
  564. /// <param name="userPassword">用户密码</param>
  565. /// <param name="sessionKey">本次登陆密钥</param>
  566. /// <param name="kilnCarCode">窑车号</param>
  567. /// <param name="modelType">工序类别</param>
  568. /// <returns></returns>
  569. /// <remarks>
  570. /// 陈冰 2014.10.04 新建
  571. /// </remarks>
  572. public ActionResult CheckKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int pProcedureId, string kilnCarCode, int modelType)
  573. {
  574. ActionResult actionResult = new ActionResult();
  575. try
  576. {
  577. // 验证请求头信息
  578. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  579. // 验证失败
  580. if (actionResult.Status != (int)Constant.PDAResult.Success)
  581. {
  582. return actionResult;
  583. }
  584. CheckKilnCarResultEntity checkKilnCarResultEntity = ServiceInvoker.Invoke<CheckKilnCarResultEntity>(this,
  585. () => PMModuleLogic.CheckKilnCar(pProcedureId, kilnCarCode, modelType, sUserInfo));
  586. actionResult.Result = JsonHelper.ToJson(checkKilnCarResultEntity);
  587. actionResult.Status = (int)Constant.PDAResult.Success;
  588. }
  589. catch (Exception ex)
  590. {
  591. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  592. OutputLog.TraceLog(LogPriority.Error,
  593. this.ToString(),
  594. System.Reflection.MethodBase.GetCurrentMethod().Name,
  595. ex.ToString(),
  596. LocalPath.LogExePath);
  597. actionResult.Status = (int)Constant.PDAResult.Exception;
  598. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  599. }
  600. return actionResult;
  601. }
  602. #endregion
  603. #region 保存条码信息
  604. /// <summary>
  605. /// 保存条码信息
  606. /// </summary>
  607. /// <param name="accountCode">帐套code</param>
  608. /// <param name="userCode">用户code</param>
  609. /// <param name="userPassword">用户密码</param>
  610. /// <param name="sessionKey">本次登陆密钥</param>
  611. /// <param name="procedureID">工序ID</param>
  612. /// <param name="productionDataEntitys">条码信息</param>
  613. public ActionResult AddWorkPiece(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  614. {
  615. ActionResult actionResult = new ActionResult();
  616. try
  617. {
  618. // 验证请求头信息
  619. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  620. // 验证失败
  621. if (actionResult.Status != (int)Constant.PDAResult.Success)
  622. {
  623. return actionResult;
  624. }
  625. DataTable dtProductionData = DataConvert.ObjectConvertToTable<ProductionDataEntity>(productionDataEntitys);
  626. if (!dtProductionData.Columns.Contains("IsPDA"))
  627. {
  628. dtProductionData.Columns.Add("IsPDA");
  629. }
  630. ProcedureEntity procedureInfo = null;
  631. DataTable resultDT = ServiceInvoker.Invoke<DataTable>(this,
  632. () => PMModuleLogicDAL.AddWorkPiece(procedureID, dtProductionData, sUserInfo, out procedureInfo));
  633. actionResult.Result = JsonHelper.ToJson(resultDT);
  634. actionResult.Status = (int)Constant.PDAResult.Success;
  635. if (resultDT != null)
  636. {
  637. DataRow[] drs = resultDT.Select("out_errMsg is not null and out_errMsg <> ''");
  638. if (drs != null && drs.Length > 0)
  639. {
  640. return actionResult;
  641. }
  642. }
  643. #region PDA条码打印
  644. if (procedureInfo != null && procedureInfo.BarCodePrintCopies > 0 &&
  645. procedureInfo.ModelType == (int)Constant.ProcedureModelType.Normal)
  646. {
  647. try
  648. {
  649. if (procedureInfo.CollectType == 1)
  650. {
  651. //foreach (DataRow item in dtProductionData.Rows)
  652. //{
  653. // ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(item["barcode"].ToString(),
  654. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  655. // if (sre.Status != Constant.ServiceResultStatus.Success)
  656. // {
  657. // actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  658. // actionResult.Message = sre.Message;
  659. // return actionResult;
  660. // }
  661. //}
  662. }
  663. else
  664. {
  665. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(dtProductionData.Rows[0]["barcode"].ToString(),
  666. // procedureInfo.BarCodePrintCopies, null, sUserInfo);
  667. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(dtProductionData.Rows[0]["barcode"].ToString(),
  668. procedureInfo.BarCodePrintCopies, null, sUserInfo, 0);
  669. if (sre.Status != Constant.ServiceResultStatus.Success)
  670. {
  671. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  672. actionResult.Message = sre.Message;
  673. return actionResult;
  674. }
  675. }
  676. }
  677. catch (Exception ex)
  678. {
  679. OutputLog.TraceLog(LogPriority.Error,
  680. this.ToString(),
  681. System.Reflection.MethodBase.GetCurrentMethod().Name,
  682. ex.ToString(),
  683. LocalPath.LogExePath);
  684. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  685. actionResult.Message = "条码打印异常";
  686. return actionResult;
  687. }
  688. }
  689. #endregion PDA条码打印
  690. }
  691. catch (Exception ex)
  692. {
  693. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  694. OutputLog.TraceLog(LogPriority.Error,
  695. this.ToString(),
  696. System.Reflection.MethodBase.GetCurrentMethod().Name,
  697. ex.ToString(),
  698. LocalPath.LogExePath);
  699. try
  700. {
  701. string ss = JsonHelper.ToJson(productionDataEntitys);
  702. OutputLog.TraceLog(LogPriority.Error,
  703. this.ToString(),
  704. System.Reflection.MethodBase.GetCurrentMethod().Name,
  705. $" userCode:{userCode} procedureID:{procedureID} " + ss,
  706. LocalPath.LogExePath);
  707. }
  708. catch
  709. {
  710. }
  711. actionResult.Status = (int)Constant.PDAResult.Exception;
  712. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  713. }
  714. return actionResult;
  715. }
  716. #endregion
  717. #region 获得系统/基数数据
  718. /// <summary>
  719. /// 获得数据字典
  720. /// </summary>
  721. /// <param name="accountCode">帐套code</param>
  722. /// <param name="userCode">用户code</param>
  723. /// <param name="userPassword">用户密码</param>
  724. /// <param name="sessionKey">本次登陆密钥</param>
  725. /// <param name="dicType">字典类型</param>
  726. /// <returns></returns>
  727. public ActionResult GetDataDictionaryByType(string accountCode, string userCode, string userPassword, string sessionKey, string dicType)
  728. {
  729. ActionResult actionResult = new ActionResult();
  730. try
  731. {
  732. // 验证请求头信息
  733. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  734. // 验证失败
  735. if (actionResult.Status != (int)Constant.PDAResult.Success)
  736. {
  737. return actionResult;
  738. }
  739. DataTable dicDataTable = ServiceInvoker.Invoke<DataTable>(this,
  740. () => CommonModuleLogic.GetDataDictionaryByType(sUserInfo, dicType));
  741. actionResult.Result = JsonHelper.ToJson(dicDataTable);
  742. actionResult.Status = (int)Constant.PDAResult.Success;
  743. }
  744. catch (Exception ex)
  745. {
  746. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  747. OutputLog.TraceLog(LogPriority.Error,
  748. this.ToString(),
  749. System.Reflection.MethodBase.GetCurrentMethod().Name,
  750. ex.ToString(),
  751. LocalPath.LogExePath);
  752. actionResult.Status = (int)Constant.PDAResult.Exception;
  753. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  754. }
  755. return actionResult;
  756. }
  757. #endregion
  758. #region 检验工序接口
  759. /// <summary>
  760. /// 获得检验标识
  761. /// </summary>
  762. /// <param name="accountCode">帐套code</param>
  763. /// <param name="userCode">用户code</param>
  764. /// <param name="userPassword">用户密码</param>
  765. /// <param name="sessionKey">本次登陆密钥</param>
  766. /// <returns></returns>
  767. /// <remarks>
  768. /// 陈冰 2014.10.04 新建
  769. /// </remarks>
  770. public ActionResult GetDefectFlagData(string accountCode, string userCode, string userPassword, string sessionKey)
  771. {
  772. ActionResult actionResult = new ActionResult();
  773. try
  774. {
  775. // 验证请求头信息
  776. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  777. // 验证失败
  778. if (actionResult.Status != (int)Constant.PDAResult.Success)
  779. {
  780. return actionResult;
  781. }
  782. #region 构造缺陷标识的数据源
  783. DataTable dtDefectFlag = CreateDataSource.GetDefectFlagTable();
  784. #endregion
  785. actionResult.Result = JsonHelper.ToJson(dtDefectFlag);
  786. actionResult.Status = (int)Constant.PDAResult.Success;
  787. }
  788. catch (Exception ex)
  789. {
  790. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  791. OutputLog.TraceLog(LogPriority.Error,
  792. this.ToString(),
  793. System.Reflection.MethodBase.GetCurrentMethod().Name,
  794. ex.ToString(),
  795. LocalPath.LogExePath);
  796. actionResult.Status = (int)Constant.PDAResult.Exception;
  797. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  798. }
  799. return actionResult;
  800. }
  801. /// <summary>
  802. /// 由条码和当前检验工序获取返工工序
  803. /// </summary>
  804. /// <param name="accountCode">帐套code</param>
  805. /// <param name="userCode">用户code</param>
  806. /// <param name="userPassword">用户密码</param>
  807. /// <param name="sessionKey">本次登陆密钥</param>
  808. /// <param name="procedureID">当前检验工序ID</param>
  809. /// <param name="barcode">条码</param>
  810. /// <returns></returns>
  811. /// <remarks>
  812. /// 陈冰 2014.10.04 新建
  813. /// </remarks>
  814. public ActionResult GetReworkProcedureByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  815. {
  816. ActionResult actionResult = new ActionResult();
  817. try
  818. {
  819. // 验证请求头信息
  820. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  821. // 验证失败
  822. if (actionResult.Status != (int)Constant.PDAResult.Success)
  823. {
  824. return actionResult;
  825. }
  826. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  827. () => PMModuleLogic.GetReworkProcedureByBarcode(procedureID, barcode));
  828. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  829. {
  830. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  831. actionResult.Status = (int)Constant.PDAResult.Success;
  832. }
  833. else
  834. {
  835. actionResult.Status = (int)Constant.PDAResult.Fail;
  836. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  837. }
  838. }
  839. catch (Exception ex)
  840. {
  841. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  842. OutputLog.TraceLog(LogPriority.Error,
  843. this.ToString(),
  844. System.Reflection.MethodBase.GetCurrentMethod().Name,
  845. ex.ToString(),
  846. LocalPath.LogExePath);
  847. actionResult.Status = (int)Constant.PDAResult.Exception;
  848. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  849. }
  850. return actionResult;
  851. }
  852. /// <summary>
  853. /// 由当前检验工序获取缺陷列表
  854. /// </summary>
  855. /// <param name="accountCode">帐套code</param>
  856. /// <param name="userCode">用户code</param>
  857. /// <param name="userPassword">用户密码</param>
  858. /// <param name="sessionKey">本次登陆密钥</param>
  859. /// <param name="procedureID">当前检验工序ID</param>
  860. /// <param name="defectCode">缺陷编码</param>
  861. /// <returns></returns>
  862. /// <remarks>
  863. /// 陈冰 2014.10.04 新建
  864. /// </remarks>
  865. public ActionResult GetDefectByProcedureIDAndDefectCode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string defectCode)
  866. {
  867. ActionResult actionResult = new ActionResult();
  868. try
  869. {
  870. // 验证请求头信息
  871. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  872. // 验证失败
  873. if (actionResult.Status != (int)Constant.PDAResult.Success)
  874. {
  875. return actionResult;
  876. }
  877. object defectDs = ServiceInvoker.Invoke<object>(this,
  878. () => PMModuleLogic.GetDefectByProcedureIDAndDefectCode(procedureID, defectCode));
  879. if (defectDs != null)
  880. {
  881. actionResult.Result = JsonHelper.ToJson(defectDs);
  882. actionResult.Status = (int)Constant.PDAResult.Success;
  883. }
  884. else
  885. {
  886. actionResult.Status = (int)Constant.PDAResult.Fail;
  887. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  888. }
  889. }
  890. catch (Exception ex)
  891. {
  892. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  893. OutputLog.TraceLog(LogPriority.Error,
  894. this.ToString(),
  895. System.Reflection.MethodBase.GetCurrentMethod().Name,
  896. ex.ToString(),
  897. LocalPath.LogExePath);
  898. actionResult.Status = (int)Constant.PDAResult.Exception;
  899. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  900. }
  901. return actionResult;
  902. }
  903. /// <summary>
  904. /// 根据产品ID查出缺陷位置
  905. /// </summary>
  906. /// <param name="accountCode">帐套code</param>
  907. /// <param name="userCode">用户code</param>
  908. /// <param name="userPassword">用户密码</param>
  909. /// <param name="sessionKey">本次登陆密钥</param>
  910. /// <param name="goodsID">产品ID</param>
  911. /// <param name="positionCode">位置编码</param>
  912. /// <returns></returns>
  913. /// <remarks>
  914. /// 陈冰 2014.10.04 新建
  915. /// </remarks>
  916. public ActionResult GetDefectPositionByGoodsIDAndPositionCode(string accountCode, string userCode, string userPassword, string sessionKey, int goodsID, string positionCode)
  917. {
  918. ActionResult actionResult = new ActionResult();
  919. try
  920. {
  921. // 验证请求头信息
  922. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  923. // 验证失败
  924. if (actionResult.Status != (int)Constant.PDAResult.Success)
  925. {
  926. return actionResult;
  927. }
  928. // 缺陷位置已经不用在关联产品
  929. //object defectDs = ServiceInvoker.Invoke<object>(this,() => PMModuleLogic.GetDefectPositionByGoodsIDAndPositionCode(goodsID, positionCode));
  930. object defectDs = ServiceInvoker.Invoke<object>(this, () => PMModuleLogic.GetDefectPosition(positionCode, sUserInfo));
  931. if (defectDs != null)
  932. {
  933. actionResult.Result = JsonHelper.ToJson(defectDs);
  934. actionResult.Status = (int)Constant.PDAResult.Success;
  935. }
  936. else
  937. {
  938. actionResult.Status = (int)Constant.PDAResult.Fail;
  939. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  940. }
  941. }
  942. catch (Exception ex)
  943. {
  944. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  945. OutputLog.TraceLog(LogPriority.Error,
  946. this.ToString(),
  947. System.Reflection.MethodBase.GetCurrentMethod().Name,
  948. ex.ToString(),
  949. LocalPath.LogExePath);
  950. actionResult.Status = (int)Constant.PDAResult.Exception;
  951. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  952. }
  953. return actionResult;
  954. }
  955. /// <summary>
  956. /// 通过条码和缺陷查出责任工序
  957. /// </summary>
  958. /// <param name="accountCode">帐套code</param>
  959. /// <param name="userCode">用户code</param>
  960. /// <param name="userPassword">用户密码</param>
  961. /// <param name="sessionKey">本次登陆密钥</param>
  962. /// <param name="barcode">条码</param>
  963. /// <param name="defectid">缺陷ID</param>
  964. /// <returns></returns>
  965. /// <remarks>
  966. /// 陈冰 2014.10.04 新建
  967. /// </remarks>
  968. public ActionResult GetDutyProcedureByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int defectid)
  969. {
  970. ActionResult actionResult = new ActionResult();
  971. try
  972. {
  973. // 验证请求头信息
  974. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  975. // 验证失败
  976. if (actionResult.Status != (int)Constant.PDAResult.Success)
  977. {
  978. return actionResult;
  979. }
  980. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  981. () => PMModuleLogic.GetDutyProcedureByBarCode(barcode, defectid, sUserInfo.AccountID));
  982. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  983. {
  984. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs);
  985. actionResult.Status = (int)Constant.PDAResult.Success;
  986. }
  987. else
  988. {
  989. actionResult.Status = (int)Constant.PDAResult.Fail;
  990. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  991. }
  992. }
  993. catch (Exception ex)
  994. {
  995. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  996. OutputLog.TraceLog(LogPriority.Error,
  997. this.ToString(),
  998. System.Reflection.MethodBase.GetCurrentMethod().Name,
  999. ex.ToString(),
  1000. LocalPath.LogExePath);
  1001. actionResult.Status = (int)Constant.PDAResult.Exception;
  1002. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1003. }
  1004. return actionResult;
  1005. }
  1006. /// <summary>
  1007. /// 通过条码与工序查出责任工号(己废)
  1008. /// </summary>
  1009. /// <param name="accountCode">帐套code</param>
  1010. /// <param name="userCode">用户code</param>
  1011. /// <param name="userPassword">用户密码</param>
  1012. /// <param name="sessionKey">本次登陆密钥</param>
  1013. /// <param name="barcode">条码</param>
  1014. /// <param name="dutyProcedureID">责任工序</param>
  1015. /// <returns></returns>
  1016. /// <remarks>
  1017. /// 陈冰 2014.10.04 新建
  1018. /// </remarks>
  1019. public ActionResult GetDutyProcedureCodeByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int dutyProcedureID)
  1020. {
  1021. ActionResult actionResult = new ActionResult();
  1022. try
  1023. {
  1024. // 验证请求头信息
  1025. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1026. // 验证失败
  1027. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1028. {
  1029. return actionResult;
  1030. }
  1031. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1032. () => PMModuleLogic.GetDutyProcedureCodeByBarCode(barcode, dutyProcedureID));
  1033. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1034. {
  1035. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1036. actionResult.Status = (int)Constant.PDAResult.Success;
  1037. }
  1038. else
  1039. {
  1040. actionResult.Status = (int)Constant.PDAResult.Fail;
  1041. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1042. }
  1043. }
  1044. catch (Exception ex)
  1045. {
  1046. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1047. OutputLog.TraceLog(LogPriority.Error,
  1048. this.ToString(),
  1049. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1050. ex.ToString(),
  1051. LocalPath.LogExePath);
  1052. actionResult.Status = (int)Constant.PDAResult.Exception;
  1053. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1054. }
  1055. return actionResult;
  1056. }
  1057. /// <summary>
  1058. /// 通过条码与工序查出责任工号
  1059. /// </summary>
  1060. /// <param name="accountCode"></param>
  1061. /// <param name="userCode"></param>
  1062. /// <param name="userPassword"></param>
  1063. /// <param name="sessionKey"></param>
  1064. /// <param name="ProductionDataID">生产数据ID</param>
  1065. /// <returns></returns>
  1066. public ActionResult GetDutyProcedureCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  1067. {
  1068. ActionResult actionResult = new ActionResult();
  1069. try
  1070. {
  1071. // 验证请求头信息
  1072. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1073. // 验证失败
  1074. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1075. {
  1076. return actionResult;
  1077. }
  1078. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1079. () => PMModuleLogic.GetDutyProcedureCodeByProductionDataID(ProductionDataID));
  1080. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1081. {
  1082. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1083. actionResult.Status = (int)Constant.PDAResult.Success;
  1084. }
  1085. else
  1086. {
  1087. actionResult.Status = (int)Constant.PDAResult.Fail;
  1088. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1089. }
  1090. }
  1091. catch (Exception ex)
  1092. {
  1093. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1094. OutputLog.TraceLog(LogPriority.Error,
  1095. this.ToString(),
  1096. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1097. ex.ToString(),
  1098. LocalPath.LogExePath);
  1099. actionResult.Status = (int)Constant.PDAResult.Exception;
  1100. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1101. }
  1102. return actionResult;
  1103. }
  1104. /// <summary>
  1105. /// 通过生产数据与工号ID查询工种
  1106. /// </summary>
  1107. /// <param name="accountCode">帐套code</param>
  1108. /// <param name="userCode">用户code</param>
  1109. /// <param name="userPassword">用户密码</param>
  1110. /// <param name="sessionKey">本次登陆密钥</param>
  1111. /// <param name="productionDataID">生产数据ID</param>
  1112. /// <param name="userID">工号ID</param>
  1113. /// <returns></returns>
  1114. /// <remarks>
  1115. /// 陈冰 2014.10.08 新建
  1116. /// </remarks>
  1117. public ActionResult GetDutyJobsByUserIDAndProductionID(string accountCode, string userCode, string userPassword, string sessionKey,
  1118. //int productionDataID, int userID)
  1119. int classesSettingID, int defectid, int procedureID)
  1120. {
  1121. ActionResult actionResult = new ActionResult();
  1122. try
  1123. {
  1124. // 验证请求头信息
  1125. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1126. // 验证失败
  1127. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1128. {
  1129. return actionResult;
  1130. }
  1131. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1132. //() => PMModuleLogic.GetDutyJobsCodeByUser(userID, productionDataID));
  1133. () => PDAModuleLogic.GetDutyJobsCodeByUser(classesSettingID, defectid, procedureID));
  1134. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1135. {
  1136. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1137. actionResult.Status = (int)Constant.PDAResult.Success;
  1138. }
  1139. else
  1140. {
  1141. actionResult.Status = (int)Constant.PDAResult.Fail;
  1142. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1143. }
  1144. }
  1145. catch (Exception ex)
  1146. {
  1147. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1148. OutputLog.TraceLog(LogPriority.Error,
  1149. this.ToString(),
  1150. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1151. ex.ToString(),
  1152. LocalPath.LogExePath);
  1153. actionResult.Status = (int)Constant.PDAResult.Exception;
  1154. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1155. }
  1156. return actionResult;
  1157. }
  1158. /// <summary>
  1159. /// 根据生产数据ID,用户ID及工种选出责任员工
  1160. /// </summary>
  1161. /// <param name="accountCode">帐套code</param>
  1162. /// <param name="userCode">用户code</param>
  1163. /// <param name="userPassword">用户密码</param>
  1164. /// <param name="sessionKey">本次登陆密钥</param>
  1165. /// <param name="productionDataID">生产数据ID</param>
  1166. /// <param name="userID">工号ID</param>
  1167. /// <param name="jobsID">工种ID</param>
  1168. /// <returns></returns>
  1169. /// <remarks>
  1170. /// 陈冰 2014.10.08 新建
  1171. /// </remarks>
  1172. public ActionResult GetDutyStaffByUserIDAndJobs(string accountCode, string userCode, string userPassword, string sessionKey,
  1173. //int productionDataID, int userID, int jobsID)
  1174. int classesSettingID, int jobsID)
  1175. {
  1176. ActionResult actionResult = new ActionResult();
  1177. try
  1178. {
  1179. // 验证请求头信息
  1180. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1181. // 验证失败
  1182. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1183. {
  1184. return actionResult;
  1185. }
  1186. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  1187. //() => PMModuleLogic.GetDutyStaffByUserIDAndJobs(productionDataID, userID, jobsID));
  1188. () => PDAModuleLogic.GetDutyStaffByUserIDAndJobs(classesSettingID, jobsID));
  1189. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  1190. {
  1191. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  1192. actionResult.Status = (int)Constant.PDAResult.Success;
  1193. }
  1194. else
  1195. {
  1196. actionResult.Status = (int)Constant.PDAResult.Fail;
  1197. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1198. }
  1199. }
  1200. catch (Exception ex)
  1201. {
  1202. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1203. OutputLog.TraceLog(LogPriority.Error,
  1204. this.ToString(),
  1205. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1206. ex.ToString(),
  1207. LocalPath.LogExePath);
  1208. actionResult.Status = (int)Constant.PDAResult.Exception;
  1209. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1210. }
  1211. return actionResult;
  1212. }
  1213. /// <summary>
  1214. /// 获得产品分级
  1215. /// </summary>
  1216. /// <param name="accountCode">帐套code</param>
  1217. /// <param name="userCode">用户code</param>
  1218. /// <param name="userPassword">用户密码</param>
  1219. /// <param name="sessionKey">本次登陆密钥</param>
  1220. /// <returns></returns>
  1221. /// <remarks>
  1222. /// 陈冰 2014.10.08 新建
  1223. /// xuwei 2019-12-4 添加参数type 默认为2成检 为1时 半检
  1224. /// </remarks>
  1225. public ActionResult GetGoodsGradeData(string accountCode, string userCode, string userPassword, string sessionKey, int type = 2)
  1226. {
  1227. ActionResult actionResult = new ActionResult();
  1228. try
  1229. {
  1230. // 验证请求头信息
  1231. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1232. // 验证失败
  1233. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1234. {
  1235. return actionResult;
  1236. }
  1237. #region 构造产品分级的数据源
  1238. //DataTable dtGrade = CreateDataSource.GetGoodsGradeTable();
  1239. //xuwei modify 2019-12-04 支持半检 没传参数 type=0
  1240. //DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(2 , sUserInfo);
  1241. DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(type == 0 ? 2 : type, sUserInfo);
  1242. if (dsGrade != null && dsGrade.Tables.Count > Constant.INT_IS_ZERO)
  1243. {
  1244. actionResult.Result = JsonHelper.ToJson(dsGrade.Tables[0]);
  1245. actionResult.Status = (int)Constant.PDAResult.Success;
  1246. }
  1247. else
  1248. {
  1249. actionResult.Status = (int)Constant.PDAResult.Fail;
  1250. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1251. }
  1252. #endregion
  1253. }
  1254. catch (Exception ex)
  1255. {
  1256. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1257. OutputLog.TraceLog(LogPriority.Error,
  1258. this.ToString(),
  1259. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1260. ex.ToString(),
  1261. LocalPath.LogExePath);
  1262. OutputLog.TraceLog(LogPriority.Error,
  1263. this.ToString(),
  1264. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1265. ex.ToString(),
  1266. LocalPath.LogExePath);
  1267. actionResult.Status = (int)Constant.PDAResult.Exception;
  1268. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1269. }
  1270. return actionResult;
  1271. }
  1272. #endregion
  1273. #region 保存检验条码
  1274. /// <summary>
  1275. /// 保存检验条码
  1276. /// </summary>
  1277. /// <param name="accountCode">帐套code</param>
  1278. /// <param name="userCode">用户code</param>
  1279. /// <param name="userPassword">用户密码</param>
  1280. /// <param name="sessionKey">本次登陆密钥</param>
  1281. /// <param name="procedureID">工序ID</param>
  1282. /// <param name="productionDataEntitys">条码信息</param>
  1283. /// <returns></returns>
  1284. public ActionResult AddCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys)
  1285. {
  1286. ActionResult actionResult = new ActionResult();
  1287. try
  1288. {
  1289. // 验证请求头信息
  1290. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1291. // 验证失败
  1292. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1293. {
  1294. return actionResult;
  1295. }
  1296. //if(productionDataEntitys.Length>0)
  1297. //{
  1298. // if(productionDataEntitys[0].ProductionDataID>0)
  1299. // {
  1300. // productionDataEntitys[0].OPTimeStamp = Convert.ToDateTime(productionDataEntitys[0].OPTimeStampPDA.Replace("-","/"));
  1301. // }
  1302. //}
  1303. string err = ServiceInvoker.Invoke<string>(this,
  1304. //() => PMModuleLogicDAL.AddCheckBarcode(procedureID, productionDataEntitys, sUserInfo));
  1305. () => PMModuleLogicDAL.AddCheckBarcodePDA(procedureID, productionDataEntitys, sUserInfo));
  1306. if (err == null)
  1307. {
  1308. err = "";
  1309. }
  1310. //actionResult.Result = JsonHelper.ToJson(err);
  1311. actionResult.Result = err;// JsonHelper.ToJson(err);
  1312. actionResult.Status = (int)Constant.PDAResult.Success;
  1313. }
  1314. catch (Exception ex)
  1315. {
  1316. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1317. OutputLog.TraceLog(LogPriority.Error,
  1318. this.ToString(),
  1319. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1320. ex.ToString(),
  1321. LocalPath.LogExePath);
  1322. actionResult.Status = (int)Constant.PDAResult.Exception;
  1323. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1324. }
  1325. return actionResult;
  1326. }
  1327. #endregion
  1328. #region 文件上传下载
  1329. /// <summary>
  1330. /// 软件更新
  1331. /// </summary>
  1332. /// <param name="accountCode">帐套code</param>
  1333. /// <param name="userCode">用户code</param>
  1334. /// <param name="userPassword">用户密码</param>
  1335. /// <param name="sessionKey">本次登陆密钥</param>
  1336. /// <returns></returns>
  1337. public Stream AutoUpgrade(string accountCode, string userCode, string userPassword, string sessionKey)
  1338. {
  1339. try
  1340. {
  1341. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.AutoUpgrade());
  1342. }
  1343. catch (Exception ex)
  1344. {
  1345. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1346. OutputLog.TraceLog(LogPriority.Error,
  1347. this.ToString(),
  1348. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1349. ex.ToString(),
  1350. LocalPath.LogExePath);
  1351. return null;
  1352. }
  1353. }
  1354. /// <summary>
  1355. /// 上传临时文件
  1356. /// </summary>
  1357. /// <param name="imgStream"></param>
  1358. /// <returns></returns>
  1359. public ActionResult SaveImg(Stream mageStream)
  1360. {
  1361. ActionResult actionResult = new ActionResult();
  1362. try
  1363. {
  1364. string err = PDAModuleLogic.SaveImg(mageStream);
  1365. if (err == null)
  1366. {
  1367. err = "";
  1368. }
  1369. actionResult.Result = err;
  1370. actionResult.Status = (int)Constant.PDAResult.Success;
  1371. }
  1372. catch (Exception ex)
  1373. {
  1374. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1375. OutputLog.TraceLog(LogPriority.Error,
  1376. this.ToString(),
  1377. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1378. ex.ToString(),
  1379. LocalPath.LogExePath);
  1380. actionResult.Status = (int)Constant.PDAResult.Exception;
  1381. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1382. }
  1383. return actionResult;
  1384. }
  1385. public Stream GetFileTest(string path)
  1386. {
  1387. return PDAModuleLogic.GetImg(path);
  1388. }
  1389. public Stream GetFileStream()
  1390. {
  1391. FileStream fs = new FileStream("999.apk", FileMode.OpenOrCreate, FileAccess.Read);
  1392. long l = fs.Length;
  1393. return fs;
  1394. }
  1395. public byte[] GetFileTestByte(string path)
  1396. {
  1397. FileStream stream = new FileInfo(path).OpenRead();
  1398. Byte[] buffer = new Byte[stream.Length];
  1399. //从流中读取字节块并将该数据写入给定缓冲区buffer中
  1400. stream.Read(buffer, 0, Convert.ToInt32(stream.Length));
  1401. return buffer;
  1402. }
  1403. public string GetFile(string path)
  1404. {
  1405. string imgFilePath = path;
  1406. System.IO.FileStream fs = new System.IO.FileStream(imgFilePath, System.IO.FileMode.Open);
  1407. int i = (int)fs.Length;
  1408. byte[] content = new byte[i];
  1409. fs.Read(content, 0, i);
  1410. string result = Convert.ToBase64String(content);
  1411. fs.Close();
  1412. FileStream fsTxt = new FileStream("A.txt", FileMode.OpenOrCreate);
  1413. StreamWriter sw = new StreamWriter(fsTxt, System.Text.Encoding.Default);
  1414. sw.Write(result);
  1415. sw.Close();
  1416. fsTxt.Close();
  1417. return result;
  1418. }
  1419. #endregion
  1420. /// <summary>
  1421. /// 获得产品分级
  1422. /// </summary>
  1423. /// <param name="accountCode">帐套code</param>
  1424. /// <param name="userCode">用户code</param>
  1425. /// <param name="userPassword">用户密码</param>
  1426. /// <param name="sessionKey">本次登陆密钥</param>
  1427. /// <param name="procedureID">当前工序ID</param>
  1428. /// <returns></returns>
  1429. /// <remarks>
  1430. /// 陈冰 2014.10.22 新建
  1431. /// </remarks>
  1432. public ActionResult GetReworkProcedureByProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1433. {
  1434. ActionResult actionResult = new ActionResult();
  1435. try
  1436. {
  1437. // 验证请求头信息
  1438. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1439. // 验证失败
  1440. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1441. {
  1442. return actionResult;
  1443. }
  1444. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1445. () => PMModuleLogic.GetReworkProcedureByProcedureID(procedureID));
  1446. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1447. {
  1448. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1449. actionResult.Status = (int)Constant.PDAResult.Success;
  1450. }
  1451. else
  1452. {
  1453. actionResult.Status = (int)Constant.PDAResult.Fail;
  1454. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1455. }
  1456. }
  1457. catch (Exception ex)
  1458. {
  1459. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1460. OutputLog.TraceLog(LogPriority.Error,
  1461. this.ToString(),
  1462. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1463. ex.ToString(),
  1464. LocalPath.LogExePath);
  1465. actionResult.Status = (int)Constant.PDAResult.Exception;
  1466. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1467. }
  1468. return actionResult;
  1469. }
  1470. /// <summary>
  1471. /// 获得产品分级
  1472. /// </summary>
  1473. /// <param name="accountCode">帐套code</param>
  1474. /// <param name="userCode">用户code</param>
  1475. /// <param name="userPassword">用户密码</param>
  1476. /// <param name="sessionKey">本次登陆密钥</param>
  1477. /// <param name="barcode">条码</param>
  1478. /// <returns></returns>
  1479. public ActionResult GetKilnCarByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1480. {
  1481. ActionResult actionResult = new ActionResult();
  1482. try
  1483. {
  1484. // 验证请求头信息
  1485. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1486. // 验证失败
  1487. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1488. {
  1489. return actionResult;
  1490. }
  1491. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1492. () => PMModuleLogic.GetKilnCarByBarCode(barcode));
  1493. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1494. {
  1495. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1496. actionResult.Status = (int)Constant.PDAResult.Success;
  1497. }
  1498. else
  1499. {
  1500. actionResult.Status = (int)Constant.PDAResult.Fail;
  1501. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1502. }
  1503. }
  1504. catch (Exception ex)
  1505. {
  1506. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1507. OutputLog.TraceLog(LogPriority.Error,
  1508. this.ToString(),
  1509. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1510. ex.ToString(),
  1511. LocalPath.LogExePath);
  1512. actionResult.Status = (int)Constant.PDAResult.Exception;
  1513. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1514. }
  1515. return actionResult;
  1516. }
  1517. #region 统计
  1518. /// <summary>
  1519. /// 统计当日计数数量
  1520. /// </summary>
  1521. /// <param name="accountCode">帐套code</param>
  1522. /// <param name="userCode">用户code</param>
  1523. /// <param name="userPassword">用户密码</param>
  1524. /// <param name="sessionKey">本次登陆密钥</param>
  1525. /// <param name="procedureID">工序ID</param>
  1526. /// <returns></returns>
  1527. public ActionResult StatisticsCollectBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1528. {
  1529. ActionResult actionResult = new ActionResult();
  1530. try
  1531. {
  1532. // 验证请求头信息
  1533. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1534. // 验证失败
  1535. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1536. {
  1537. return actionResult;
  1538. }
  1539. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1540. () => PDAModuleLogic.StatisticsCollectBarcode(procedureID, sUserInfo));
  1541. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1542. {
  1543. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1544. actionResult.Status = (int)Constant.PDAResult.Success;
  1545. }
  1546. else
  1547. {
  1548. actionResult.Status = (int)Constant.PDAResult.Fail;
  1549. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1550. }
  1551. }
  1552. catch (Exception ex)
  1553. {
  1554. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1555. OutputLog.TraceLog(LogPriority.Error,
  1556. this.ToString(),
  1557. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1558. ex.ToString(),
  1559. LocalPath.LogExePath);
  1560. actionResult.Status = (int)Constant.PDAResult.Exception;
  1561. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1562. }
  1563. return actionResult;
  1564. }
  1565. /// <summary>
  1566. /// 统计当日计数数量
  1567. /// </summary>
  1568. /// <param name="accountCode">帐套code</param>
  1569. /// <param name="userCode">用户code</param>
  1570. /// <param name="userPassword">用户密码</param>
  1571. /// <param name="sessionKey">本次登陆密钥</param>
  1572. /// <param name="procedureID">工序ID</param>
  1573. /// <returns></returns>
  1574. public ActionResult StatisticsKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  1575. {
  1576. ActionResult actionResult = new ActionResult();
  1577. try
  1578. {
  1579. // 验证请求头信息
  1580. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1581. // 验证失败
  1582. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1583. {
  1584. return actionResult;
  1585. }
  1586. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1587. () => PDAModuleLogic.StatisticsKilnCar(procedureID, sUserInfo));
  1588. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1589. {
  1590. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1591. actionResult.Status = (int)Constant.PDAResult.Success;
  1592. }
  1593. else
  1594. {
  1595. actionResult.Status = (int)Constant.PDAResult.Fail;
  1596. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1597. }
  1598. }
  1599. catch (Exception ex)
  1600. {
  1601. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1602. OutputLog.TraceLog(LogPriority.Error,
  1603. this.ToString(),
  1604. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1605. ex.ToString(),
  1606. LocalPath.LogExePath);
  1607. actionResult.Status = (int)Constant.PDAResult.Exception;
  1608. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1609. }
  1610. return actionResult;
  1611. }
  1612. /// <summary>
  1613. /// 统计产品跟踪
  1614. /// </summary>
  1615. /// <param name="accountCode">帐套code</param>
  1616. /// <param name="userCode">用户code</param>
  1617. /// <param name="userPassword">用户密码</param>
  1618. /// <param name="sessionKey">本次登陆密钥</param>
  1619. /// <param name="procedureID">工序ID</param>
  1620. /// <returns></returns>
  1621. public ActionResult StatisticsProductTrack(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1622. {
  1623. ActionResult actionResult = new ActionResult();
  1624. try
  1625. {
  1626. // 验证请求头信息
  1627. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1628. // 验证失败
  1629. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1630. {
  1631. return actionResult;
  1632. }
  1633. RPT020101_SE se = new RPT020101_SE();
  1634. se.Barcode = barcode;
  1635. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  1636. () => Dongke.IBOSS.PRD.Service.ReportModuleLogic.ReportModuleLogic.GetRPT020101SData(sUserInfo, se));
  1637. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  1638. {
  1639. actionResult.Status = (int)Constant.PDAResult.Fail;
  1640. actionResult.Message = Messages.MSG_CMN_I002;
  1641. }
  1642. else
  1643. {
  1644. actionResult.Result = JsonHelper.ToJson(sre.Data);
  1645. actionResult.Status = (int)Constant.PDAResult.Success;
  1646. }
  1647. //ProductionDataEntity productionDataEntity = ServiceInvoker.Invoke<ProductionDataEntity>(this,
  1648. // () => PDAModuleLogic.StatisticsProductTrack(barcode, sUserInfo));
  1649. //if (productionDataEntity != null)
  1650. //{
  1651. // actionResult.Result = JsonHelper.ToJson(productionDataEntity);
  1652. // actionResult.Status = (int)Constant.PDAResult.Success;
  1653. //}
  1654. //else
  1655. //{
  1656. // actionResult.Status = (int)Constant.PDAResult.Fail;
  1657. // actionResult.Message = Messages.MSG_CMN_I002;
  1658. //}
  1659. }
  1660. catch (Exception ex)
  1661. {
  1662. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1663. OutputLog.TraceLog(LogPriority.Error,
  1664. this.ToString(),
  1665. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1666. ex.ToString() + ex.HelpLink,
  1667. LocalPath.LogExePath);
  1668. actionResult.Status = (int)Constant.PDAResult.Exception;
  1669. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1670. }
  1671. return actionResult;
  1672. }
  1673. #endregion
  1674. #region 撤销装车及成检
  1675. /// <summary>
  1676. /// 检验条码是否可以撤销装车
  1677. /// </summary>
  1678. /// <param name="accountCode">帐套code</param>
  1679. /// <param name="userCode">用户code</param>
  1680. /// <param name="userPassword">用户密码</param>
  1681. /// <param name="sessionKey">本次登陆密钥</param>
  1682. /// <param name="procedureID">当前工序ID</param>
  1683. /// <param name="barcode">条码</param>
  1684. /// <returns></returns>
  1685. public ActionResult CheckCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1686. {
  1687. ActionResult actionResult = new ActionResult();
  1688. try
  1689. {
  1690. // 验证请求头信息
  1691. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1692. // 验证失败
  1693. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1694. {
  1695. return actionResult;
  1696. }
  1697. CheckCancelLoadCar checkCancelLoadCar = ServiceInvoker.Invoke<CheckCancelLoadCar>(this,
  1698. () => PMModuleLogic.CheckCancelLoadCar(procedureID, barcode, sUserInfo));
  1699. actionResult.Result = JsonHelper.ToJson(checkCancelLoadCar);
  1700. actionResult.Status = (int)Constant.PDAResult.Success;
  1701. }
  1702. catch (Exception ex)
  1703. {
  1704. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1705. OutputLog.TraceLog(LogPriority.Error,
  1706. this.ToString(),
  1707. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1708. ex.ToString(),
  1709. LocalPath.LogExePath);
  1710. actionResult.Status = (int)Constant.PDAResult.Exception;
  1711. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1712. }
  1713. return actionResult;
  1714. }
  1715. /// <summary>
  1716. /// 保存撤销装车的条码
  1717. /// </summary>
  1718. /// <param name="accountCode">帐套code</param>
  1719. /// <param name="userCode">用户code</param>
  1720. /// <param name="userPassword">用户密码</param>
  1721. /// <param name="sessionKey">本次登陆密钥</param>
  1722. /// <param name="procedureID">当前工序ID</param>
  1723. /// <param name="barcode">条码</param>
  1724. /// <returns></returns>
  1725. public ActionResult AddCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  1726. {
  1727. ActionResult actionResult = new ActionResult();
  1728. try
  1729. {
  1730. // 验证请求头信息
  1731. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1732. // 验证失败
  1733. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1734. {
  1735. return actionResult;
  1736. }
  1737. string err = ServiceInvoker.Invoke<string>(this,
  1738. () => PMModuleLogicDAL.AddCancelLoadCar(procedureID, barcode, sUserInfo));
  1739. if (err == null)
  1740. {
  1741. err = "";
  1742. }
  1743. actionResult.Result = JsonHelper.ToJson(err);
  1744. actionResult.Status = (int)Constant.PDAResult.Success;
  1745. }
  1746. catch (Exception ex)
  1747. {
  1748. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1749. OutputLog.TraceLog(LogPriority.Error,
  1750. this.ToString(),
  1751. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1752. ex.ToString(),
  1753. LocalPath.LogExePath);
  1754. actionResult.Status = (int)Constant.PDAResult.Exception;
  1755. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1756. }
  1757. return actionResult;
  1758. }
  1759. /// <summary>
  1760. /// 由产品条码获取注浆信息
  1761. /// </summary>
  1762. /// <param name="barcode"></param>
  1763. /// <returns></returns>
  1764. public ActionResult GetGroutingProducttByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  1765. {
  1766. ActionResult actionResult = new ActionResult();
  1767. try
  1768. {
  1769. // 验证请求头信息
  1770. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1771. // 验证失败
  1772. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1773. {
  1774. return actionResult;
  1775. }
  1776. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1777. () => PDAModuleLogic.GetGroutingProducttByBarCode(barcode));
  1778. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1779. {
  1780. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1781. actionResult.Status = (int)Constant.PDAResult.Success;
  1782. }
  1783. else
  1784. {
  1785. actionResult.Status = (int)Constant.PDAResult.Fail;
  1786. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1787. }
  1788. }
  1789. catch (Exception ex)
  1790. {
  1791. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1792. OutputLog.TraceLog(LogPriority.Error,
  1793. this.ToString(),
  1794. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1795. ex.ToString(),
  1796. LocalPath.LogExePath);
  1797. actionResult.Status = (int)Constant.PDAResult.Exception;
  1798. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1799. }
  1800. return actionResult;
  1801. }
  1802. /// <summary>
  1803. /// 获取工号下的所有工种信息
  1804. /// </summary>
  1805. /// <param name="UserID">工号ID</param>
  1806. /// <returns></returns>
  1807. public ActionResult GetAllJobsByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int UserID)
  1808. {
  1809. ActionResult actionResult = new ActionResult();
  1810. try
  1811. {
  1812. // 验证请求头信息
  1813. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1814. // 验证失败
  1815. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1816. {
  1817. return actionResult;
  1818. }
  1819. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1820. () => PDAModuleLogic.GetAllJobsByUserID(UserID, sUserInfo));
  1821. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1822. {
  1823. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1824. actionResult.Status = (int)Constant.PDAResult.Success;
  1825. }
  1826. else
  1827. {
  1828. actionResult.Status = (int)Constant.PDAResult.Fail;
  1829. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1830. }
  1831. }
  1832. catch (Exception ex)
  1833. {
  1834. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1835. OutputLog.TraceLog(LogPriority.Error,
  1836. this.ToString(),
  1837. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1838. ex.ToString(),
  1839. LocalPath.LogExePath);
  1840. actionResult.Status = (int)Constant.PDAResult.Exception;
  1841. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1842. }
  1843. return actionResult;
  1844. }
  1845. /// <summary>
  1846. /// 根据所选工号对应的工种,查出缺陷责任员工
  1847. /// </summary>
  1848. /// <param name="jobs">工种ID</param>
  1849. /// <returns></returns>
  1850. public ActionResult GetDutyStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs)
  1851. {
  1852. ActionResult actionResult = new ActionResult();
  1853. try
  1854. {
  1855. // 验证请求头信息
  1856. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1857. // 验证失败
  1858. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1859. {
  1860. return actionResult;
  1861. }
  1862. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1863. () => PDAModuleLogic.GetDutyStaffByUserID(jobs, sUserInfo));
  1864. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1865. {
  1866. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1867. actionResult.Status = (int)Constant.PDAResult.Success;
  1868. }
  1869. else
  1870. {
  1871. actionResult.Status = (int)Constant.PDAResult.Fail;
  1872. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1873. }
  1874. }
  1875. catch (Exception ex)
  1876. {
  1877. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1878. OutputLog.TraceLog(LogPriority.Error,
  1879. this.ToString(),
  1880. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1881. ex.ToString(),
  1882. LocalPath.LogExePath);
  1883. actionResult.Status = (int)Constant.PDAResult.Exception;
  1884. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1885. }
  1886. return actionResult;
  1887. }
  1888. /// <summary>
  1889. /// 根据所选工号,查出漏检责任员工
  1890. /// </summary>
  1891. /// <param name="userid">工号</param>
  1892. /// <returns></returns>
  1893. public ActionResult GetMissedStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  1894. {
  1895. ActionResult actionResult = new ActionResult();
  1896. try
  1897. {
  1898. // 验证请求头信息
  1899. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1900. // 验证失败
  1901. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1902. {
  1903. return actionResult;
  1904. }
  1905. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1906. () => PDAModuleLogic.GetMissedStaffByUserID(userid, sUserInfo));
  1907. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1908. {
  1909. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1910. actionResult.Status = (int)Constant.PDAResult.Success;
  1911. }
  1912. else
  1913. {
  1914. actionResult.Status = (int)Constant.PDAResult.Fail;
  1915. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1916. }
  1917. }
  1918. catch (Exception ex)
  1919. {
  1920. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1921. OutputLog.TraceLog(LogPriority.Error,
  1922. this.ToString(),
  1923. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1924. ex.ToString(),
  1925. LocalPath.LogExePath);
  1926. actionResult.Status = (int)Constant.PDAResult.Exception;
  1927. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1928. }
  1929. return actionResult;
  1930. }
  1931. /// <summary>
  1932. /// 获取用户列表
  1933. /// </summary>
  1934. /// <param name="requestEntity">用户实体</param>
  1935. /// <returns></returns>
  1936. public ActionResult SearchUserData(string accountCode, string userCode, string userPassword, string sessionKey, byte IsWorker)
  1937. {
  1938. ActionResult actionResult = new ActionResult();
  1939. try
  1940. {
  1941. // 验证请求头信息
  1942. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1943. // 验证失败
  1944. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1945. {
  1946. return actionResult;
  1947. }
  1948. SUserEntity requestEntity = new SUserEntity();
  1949. requestEntity.IsWorker = IsWorker;
  1950. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1951. () => PDAModuleLogic.SearchUserData(requestEntity, sUserInfo));
  1952. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  1953. {
  1954. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  1955. actionResult.Status = (int)Constant.PDAResult.Success;
  1956. }
  1957. else
  1958. {
  1959. actionResult.Status = (int)Constant.PDAResult.Fail;
  1960. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  1961. }
  1962. }
  1963. catch (Exception ex)
  1964. {
  1965. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  1966. OutputLog.TraceLog(LogPriority.Error,
  1967. this.ToString(),
  1968. System.Reflection.MethodBase.GetCurrentMethod().Name,
  1969. ex.ToString(),
  1970. LocalPath.LogExePath);
  1971. actionResult.Status = (int)Constant.PDAResult.Exception;
  1972. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  1973. }
  1974. return actionResult;
  1975. }
  1976. /// <summary>
  1977. /// 获取数据字典管理的数据
  1978. /// </summary>
  1979. /// <param name="Pvalue">显示停用标识</param>
  1980. /// <param name="dictionaryType">字典类别</param>
  1981. /// <returns></returns>
  1982. /// <remarks>
  1983. /// 2014.12.03 新建
  1984. /// </remarks>
  1985. public ActionResult GetDictionaryData(string accountCode, string userCode, string userPassword, string sessionKey, byte Pvalue, string dictionaryType)
  1986. {
  1987. ActionResult actionResult = new ActionResult();
  1988. try
  1989. {
  1990. // 验证请求头信息
  1991. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  1992. // 验证失败
  1993. if (actionResult.Status != (int)Constant.PDAResult.Success)
  1994. {
  1995. return actionResult;
  1996. }
  1997. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  1998. () => PDAModuleLogic.GetDictionaryData(Pvalue, dictionaryType, sUserInfo));
  1999. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2000. {
  2001. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2002. actionResult.Status = (int)Constant.PDAResult.Success;
  2003. }
  2004. else
  2005. {
  2006. actionResult.Status = (int)Constant.PDAResult.Fail;
  2007. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2008. }
  2009. }
  2010. catch (Exception ex)
  2011. {
  2012. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2013. OutputLog.TraceLog(LogPriority.Error,
  2014. this.ToString(),
  2015. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2016. ex.ToString(),
  2017. LocalPath.LogExePath);
  2018. actionResult.Status = (int)Constant.PDAResult.Exception;
  2019. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2020. }
  2021. return actionResult;
  2022. }
  2023. #endregion
  2024. #region 保存半检数据
  2025. /// <summary>
  2026. /// 保存半检数据
  2027. /// </summary>
  2028. /// <param name="accountCode">帐套code</param>
  2029. /// <param name="userCode">用户code</param>
  2030. /// <param name="userPassword">用户密码</param>
  2031. /// <param name="sessionKey">本次登陆密钥</param>
  2032. /// <param name="productionDataEntitys">半检信息</param>
  2033. /// <returns></returns>
  2034. public ActionResult AddSemiTest(string accountCode, string userCode, string userPassword, string sessionKey, SemiTestEntity[] semiTestEntitys)
  2035. {
  2036. ActionResult actionResult = new ActionResult();
  2037. try
  2038. {
  2039. // 验证请求头信息
  2040. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2041. // 验证失败
  2042. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2043. {
  2044. return actionResult;
  2045. }
  2046. string err = ServiceInvoker.Invoke<string>(this,
  2047. () => PMModuleLogicDAL.AddSemiTest(semiTestEntitys, sUserInfo));
  2048. if (err == null)
  2049. {
  2050. err = "";
  2051. }
  2052. actionResult.Result = JsonHelper.ToJson(err);
  2053. actionResult.Status = (int)Constant.PDAResult.Success;
  2054. }
  2055. catch (Exception ex)
  2056. {
  2057. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2058. OutputLog.TraceLog(LogPriority.Error,
  2059. this.ToString(),
  2060. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2061. ex.ToString(),
  2062. LocalPath.LogExePath);
  2063. actionResult.Status = (int)Constant.PDAResult.Exception;
  2064. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2065. }
  2066. return actionResult;
  2067. }
  2068. #endregion
  2069. /// <summary>
  2070. /// 获取产品列表
  2071. /// </summary>
  2072. /// <returns></returns>
  2073. public ActionResult SerachGoods(string accountCode, string userCode, string userPassword, string sessionKey, int valueFlag)
  2074. {
  2075. ActionResult actionResult = new ActionResult();
  2076. try
  2077. {
  2078. // 验证请求头信息
  2079. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2080. // 验证失败
  2081. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2082. {
  2083. return actionResult;
  2084. }
  2085. GoodsEntity goodsEntity = new GoodsEntity();
  2086. goodsEntity.ValueFlag = 1;//有效标记
  2087. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2088. () => PDAModuleLogic.SerachGoods(sUserInfo, goodsEntity));
  2089. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2090. {
  2091. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2092. actionResult.Status = (int)Constant.PDAResult.Success;
  2093. }
  2094. else
  2095. {
  2096. actionResult.Status = (int)Constant.PDAResult.Fail;
  2097. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2098. }
  2099. }
  2100. catch (Exception ex)
  2101. {
  2102. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2103. OutputLog.TraceLog(LogPriority.Error,
  2104. this.ToString(),
  2105. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2106. ex.ToString(),
  2107. LocalPath.LogExePath);
  2108. actionResult.Status = (int)Constant.PDAResult.Exception;
  2109. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2110. }
  2111. return actionResult;
  2112. }
  2113. /// <summary>
  2114. /// 使用存储过程PRO_PM_GetProductionData获取生产工序计件数据
  2115. /// </summary>
  2116. /// <param name="searchEntity">生产数据实体类</param>
  2117. /// <returns>DataTable</returns>
  2118. public ActionResult GetProductionData(string accountCode, string userCode, string userPassword, string sessionKey, int ProcedureID, string BarCode)
  2119. {
  2120. ActionResult actionResult = new ActionResult();
  2121. try
  2122. {
  2123. // 验证请求头信息
  2124. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2125. // 验证失败
  2126. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2127. {
  2128. return actionResult;
  2129. }
  2130. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2131. searchEntity.ProcedureID = ProcedureID;
  2132. searchEntity.BarCode = BarCode;
  2133. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2134. () => PDAModuleLogic.GetProductionData(searchEntity, sUserInfo));
  2135. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2136. {
  2137. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2138. actionResult.Status = (int)Constant.PDAResult.Success;
  2139. }
  2140. else
  2141. {
  2142. actionResult.Status = (int)Constant.PDAResult.Fail;
  2143. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2144. }
  2145. }
  2146. catch (Exception ex)
  2147. {
  2148. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2149. OutputLog.TraceLog(LogPriority.Error,
  2150. this.ToString(),
  2151. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2152. ex.ToString(),
  2153. LocalPath.LogExePath);
  2154. actionResult.Status = (int)Constant.PDAResult.Exception;
  2155. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2156. }
  2157. return actionResult;
  2158. }
  2159. /// <summary>
  2160. /// xuwei add 2020-03-23 此方法用于成检后 回收 再次成检 获取正确ID
  2161. /// </summary>
  2162. /// <param name="searchEntity">生产数据实体类</param>
  2163. /// <returns>DataTable</returns>
  2164. public ActionResult GetProductionDataCheckID(string accountCode, string userCode, string userPassword, string sessionKey, string BarCode)
  2165. {
  2166. ActionResult actionResult = new ActionResult();
  2167. try
  2168. {
  2169. // 验证请求头信息
  2170. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2171. // 验证失败
  2172. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2173. {
  2174. return actionResult;
  2175. }
  2176. SearchProductionDataEntity searchEntity = new SearchProductionDataEntity();
  2177. searchEntity.BarCode = BarCode;
  2178. DataTable reworkDs = ServiceInvoker.Invoke<DataTable>(this,
  2179. () => PDAModuleLogic.GetProductionDataCheckID(searchEntity, sUserInfo));
  2180. if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO)
  2181. {
  2182. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2183. actionResult.Status = (int)Constant.PDAResult.Success;
  2184. }
  2185. else
  2186. {
  2187. actionResult.Status = (int)Constant.PDAResult.Fail;
  2188. actionResult.Message = Constant.PDA_RESULT_ALLOW_ERR;
  2189. }
  2190. }
  2191. catch (Exception ex)
  2192. {
  2193. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2194. OutputLog.TraceLog(LogPriority.Error,
  2195. this.ToString(),
  2196. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2197. ex.ToString(),
  2198. LocalPath.LogExePath);
  2199. actionResult.Status = (int)Constant.PDAResult.Exception;
  2200. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2201. }
  2202. return actionResult;
  2203. }
  2204. /// <summary>
  2205. /// 根据所选生产数据ID,显示成检数据信息
  2206. /// </summary>
  2207. /// <param name="productionDataID">生产数据ID</param>
  2208. /// <returns>DataSet</returns>
  2209. public ActionResult GetProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2210. {
  2211. ActionResult actionResult = new ActionResult();
  2212. try
  2213. {
  2214. // 验证请求头信息
  2215. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2216. // 验证失败
  2217. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2218. {
  2219. return actionResult;
  2220. }
  2221. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2222. () => PDAModuleLogic.GetProductionDataByID(productionDataID));
  2223. PDAProductionDataResult productionDatas = new PDAProductionDataResult();
  2224. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2225. {
  2226. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  2227. {
  2228. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  2229. {
  2230. PDAProductionDataResult productionData = new PDAProductionDataResult();
  2231. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2232. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  2233. {
  2234. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  2235. }
  2236. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  2237. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  2238. if (reworkDs.Tables[0].Rows[0]["DefectFlagID"].ToString() != "")
  2239. {
  2240. productionData.DefectFlagID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["DefectFlagID"].ToString());
  2241. }
  2242. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  2243. {
  2244. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  2245. }
  2246. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  2247. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  2248. {
  2249. productionData.UserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  2250. }
  2251. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  2252. {
  2253. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  2254. }
  2255. productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  2256. productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  2257. productionData.SpecialRepairflag = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SpecialRepairflag"]);
  2258. productionData.IsReFire = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsReFire"]);
  2259. productionData.KilnCarCode = reworkDs.Tables[0].Rows[i]["KilnCarCode"].ToString();
  2260. productionData.KilnCode = reworkDs.Tables[0].Rows[i]["KilnCode"].ToString();
  2261. productionData.GlazeName = reworkDs.Tables[0].Rows[i]["GlazeName"].ToString();
  2262. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  2263. {
  2264. productionData.LogoID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["logoid"]);
  2265. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  2266. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  2267. }
  2268. productionData.CreateTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CreateTime"]);
  2269. if (reworkDs.Tables[0].Rows[i]["CheckTime"].ToString() != "")
  2270. {
  2271. productionData.CheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CheckTime"].ToString());
  2272. }
  2273. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  2274. dvDefect.RowFilter = "BarCode=" + reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  2275. DataTable dtDefect = dvDefect.ToTable();
  2276. for (int row = 0; row < dtDefect.Rows.Count; row++)
  2277. {
  2278. // 产品缺陷
  2279. PDADefectResult defect = new PDADefectResult();
  2280. defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  2281. defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  2282. if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  2283. {
  2284. defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  2285. }
  2286. defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  2287. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  2288. {
  2289. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  2290. }
  2291. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  2292. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  2293. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  2294. {
  2295. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  2296. }
  2297. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  2298. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  2299. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  2300. {
  2301. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  2302. }
  2303. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  2304. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  2305. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  2306. {
  2307. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  2308. }
  2309. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  2310. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  2311. if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  2312. {
  2313. defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  2314. }
  2315. if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  2316. {
  2317. defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  2318. }
  2319. defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  2320. defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  2321. defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  2322. defect.DefectRemarks = dtDefect.Rows[row]["DefectRemarks"].ToString();
  2323. if (dtDefect.Rows[row]["ProductionDataID"].ToString() != "")
  2324. {
  2325. defect.ProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDataID"].ToString());
  2326. }
  2327. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  2328. {
  2329. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  2330. }
  2331. if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  2332. {
  2333. defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  2334. }
  2335. defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  2336. defect.CheckTime = Convert.ToDateTime(dtDefect.Rows[row]["CheckTime"]);
  2337. //--------责任员工-------------------
  2338. DataRow[] drRow = reworkDs.Tables[2].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2339. if (drRow.Length > Constant.INT_IS_ZERO)
  2340. {
  2341. foreach (DataRow r in drRow)
  2342. {
  2343. PDADefectResponsibleResult defectResponsible = new PDADefectResponsibleResult();
  2344. if (r["ProductionDefectID"].ToString() != "")
  2345. {
  2346. defectResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2347. }
  2348. if (r["StaffID"].ToString() != "")
  2349. {
  2350. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2351. }
  2352. defectResponsible.StaffCode = r["StaffCode"].ToString();
  2353. defectResponsible.StaffName = r["StaffName"].ToString();
  2354. if (r["StaffStatus"].ToString() != "")
  2355. {
  2356. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2357. }
  2358. if (r["UJobsID"].ToString() != "")
  2359. {
  2360. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2361. }
  2362. if (r["SJobsID"].ToString() != "")
  2363. {
  2364. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2365. }
  2366. defect.PDADefectResponsibles.Add(defectResponsible);
  2367. }
  2368. }
  2369. //------------------------------
  2370. //--------漏检员工-------------------
  2371. DataRow[] drMissedRow = reworkDs.Tables[4].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[i]["ProductionDefectID"]);
  2372. if (drMissedRow.Length > Constant.INT_IS_ZERO)
  2373. {
  2374. foreach (DataRow r in drMissedRow)
  2375. {
  2376. PDADefectMissedResponsibleResult defectMissedResponsible = new PDADefectMissedResponsibleResult();
  2377. if (r["ProductionDefectID"].ToString() != "")
  2378. {
  2379. defectMissedResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2380. }
  2381. if (r["StaffID"].ToString() != "")
  2382. {
  2383. defectMissedResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  2384. }
  2385. defectMissedResponsible.StaffCode = r["StaffCode"].ToString();
  2386. defectMissedResponsible.StaffName = r["StaffName"].ToString();
  2387. if (r["StaffStatus"].ToString() != "")
  2388. {
  2389. defectMissedResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  2390. }
  2391. if (r["UJobsID"].ToString() != "")
  2392. {
  2393. defectMissedResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  2394. }
  2395. if (r["SJobsID"].ToString() != "")
  2396. {
  2397. defectMissedResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  2398. }
  2399. defect.PDADefectMissedResponsibles.Add(defectMissedResponsible);
  2400. }
  2401. }
  2402. //------------------------------
  2403. DataRow[] drImageRow = reworkDs.Tables[3].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
  2404. if (drImageRow.Length > Constant.INT_IS_ZERO)
  2405. {
  2406. foreach (DataRow r in drImageRow)
  2407. {
  2408. PDADefectImageResult defectImage = new PDADefectImageResult();
  2409. if (r["ProductionDefectID"].ToString() != "")
  2410. {
  2411. defectImage.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
  2412. }
  2413. defectImage.Thumbnailpath = r["Thumbnailpath"].ToString();
  2414. //if (File.Exists(System.AppDomain.CurrentDomain.BaseDirectory + r["Imagepath"].ToString()))
  2415. //{
  2416. defectImage.Imagepath = r["Imagepath"].ToString();// r["Imagepath"].ToString();
  2417. //}
  2418. defect.PDADefectImageResults.Add(defectImage);
  2419. }
  2420. }
  2421. productionData.PDADefects.Add(defect);
  2422. }
  2423. if (productionDatas.PDAProductionData == null)
  2424. {
  2425. productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  2426. }
  2427. productionDatas.PDAProductionData.Add(productionData);
  2428. //---------------------------------------------------------------------------------
  2429. }
  2430. }
  2431. actionResult.Result = JsonHelper.ToJson(productionDatas);
  2432. actionResult.Status = (int)Constant.PDAResult.Success;
  2433. }
  2434. else
  2435. {
  2436. actionResult.Status = (int)Constant.PDAResult.Fail;
  2437. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2438. }
  2439. }
  2440. catch (Exception ex)
  2441. {
  2442. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2443. OutputLog.TraceLog(LogPriority.Error,
  2444. this.ToString(),
  2445. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2446. ex.ToString(),
  2447. LocalPath.LogExePath);
  2448. actionResult.Status = (int)Constant.PDAResult.Exception;
  2449. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2450. }
  2451. return actionResult;
  2452. }
  2453. /// <summary>
  2454. /// 编辑后删除生产数据
  2455. /// </summary>
  2456. /// <param name="productionDataID">生产数据ID</param>
  2457. /// <returns>int</returns>
  2458. public ActionResult DeleteProductionDataByID(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
  2459. {
  2460. ActionResult actionResult = new ActionResult();
  2461. try
  2462. {
  2463. // 验证请求头信息
  2464. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2465. // 验证失败
  2466. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2467. {
  2468. return actionResult;
  2469. }
  2470. int row = ServiceInvoker.Invoke<int>(this,
  2471. () => PMModuleLogic.DeleteProductionDataByID(productionDataID));
  2472. actionResult.Result = JsonHelper.ToJson(row);
  2473. actionResult.Status = (int)Constant.PDAResult.Success;
  2474. }
  2475. catch (Exception ex)
  2476. {
  2477. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2478. OutputLog.TraceLog(LogPriority.Error,
  2479. this.ToString(),
  2480. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2481. ex.ToString(),
  2482. LocalPath.LogExePath);
  2483. actionResult.Status = (int)Constant.PDAResult.Exception;
  2484. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2485. }
  2486. return actionResult;
  2487. }
  2488. /// <summary>
  2489. /// 获取产品完成工序的ID
  2490. /// </summary>
  2491. /// <param name="barcode">产品条码</param>
  2492. /// <returns>int</returns>
  2493. public ActionResult GetCompleteProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  2494. {
  2495. ActionResult actionResult = new ActionResult();
  2496. try
  2497. {
  2498. // 验证请求头信息
  2499. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2500. // 验证失败
  2501. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2502. {
  2503. return actionResult;
  2504. }
  2505. int row = ServiceInvoker.Invoke<int>(this,
  2506. () => PMModuleLogic.GetCompleteProcedureID(barcode));
  2507. actionResult.Result = JsonHelper.ToJson(row);
  2508. actionResult.Status = (int)Constant.PDAResult.Success;
  2509. }
  2510. catch (Exception ex)
  2511. {
  2512. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2513. OutputLog.TraceLog(LogPriority.Error,
  2514. this.ToString(),
  2515. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2516. ex.ToString(),
  2517. LocalPath.LogExePath);
  2518. actionResult.Status = (int)Constant.PDAResult.Exception;
  2519. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2520. }
  2521. return actionResult;
  2522. }
  2523. /// <summary>
  2524. /// 绑定图片
  2525. /// </summary>
  2526. /// <param name="accountCode">帐套code</param>
  2527. /// <param name="userCode">用户code</param>
  2528. /// <param name="userPassword">用户密码</param>
  2529. /// <param name="sessionKey">本次登陆密钥</param>
  2530. /// <param name="imagePath">图片路径</param>
  2531. /// <returns></returns>
  2532. public Stream BindDefectImage(string accountCode, string userCode, string userPassword, string sessionKey, string imagePath)
  2533. {
  2534. try
  2535. {
  2536. return ServiceInvoker.Invoke<Stream>(this, () => PDAModuleLogic.BindDefectImage(imagePath));
  2537. }
  2538. catch (Exception ex)
  2539. {
  2540. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2541. OutputLog.TraceLog(LogPriority.Error,
  2542. this.ToString(),
  2543. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2544. ex.ToString(),
  2545. LocalPath.LogExePath);
  2546. return null;
  2547. }
  2548. }
  2549. /// <summary>
  2550. /// 根据所选工号对应的工种,查出缺陷责任员工
  2551. /// </summary>
  2552. /// <param name="jobs">工种ID</param>
  2553. /// <returns></returns>
  2554. public ActionResult GetDutyStaffByUserJobsID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs, int userid)
  2555. {
  2556. ActionResult actionResult = new ActionResult();
  2557. try
  2558. {
  2559. // 验证请求头信息
  2560. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2561. // 验证失败
  2562. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2563. {
  2564. return actionResult;
  2565. }
  2566. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2567. () => PDAModuleLogic.GetDutyStaffByUserJobsID(jobs, sUserInfo, userid));
  2568. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2569. {
  2570. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2571. actionResult.Status = (int)Constant.PDAResult.Success;
  2572. }
  2573. else
  2574. {
  2575. actionResult.Status = (int)Constant.PDAResult.Fail;
  2576. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2577. }
  2578. }
  2579. catch (Exception ex)
  2580. {
  2581. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2582. OutputLog.TraceLog(LogPriority.Error,
  2583. this.ToString(),
  2584. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2585. ex.ToString(),
  2586. LocalPath.LogExePath);
  2587. actionResult.Status = (int)Constant.PDAResult.Exception;
  2588. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2589. }
  2590. return actionResult;
  2591. }
  2592. #region 产品报废
  2593. /// <summary>
  2594. /// 验证废弃产品唯一性
  2595. /// </summary>
  2596. /// <param name="barcode">产品条码</param>
  2597. /// <returns>int</returns>
  2598. public ActionResult ScrapProductChack(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. string row = ServiceInvoker.Invoke<string>(this,
  2611. () => PDAModuleLogic.ScrapProductChack(barCode, sUserInfo));
  2612. string[] rm = row.Split(':');
  2613. actionResult.Result = rm[0];//JsonHelper.ToJson(rm[0]);
  2614. if (rm.Length > 1)
  2615. {
  2616. actionResult.Message = rm[1];
  2617. }
  2618. actionResult.Status = (int)Constant.PDAResult.Success;
  2619. }
  2620. catch (Exception ex)
  2621. {
  2622. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2623. OutputLog.TraceLog(LogPriority.Error,
  2624. this.ToString(),
  2625. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2626. ex.ToString(),
  2627. LocalPath.LogExePath);
  2628. actionResult.Status = (int)Constant.PDAResult.Exception;
  2629. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2630. }
  2631. return actionResult;
  2632. }
  2633. /// <summary>
  2634. /// 根据条码获取该产品的在产信息以及生产数据
  2635. /// </summary>
  2636. /// <param name="Barcode">产品条码</param>
  2637. /// <returns>装有两个DataTable的数据集,第一个是在产信息,第二个是生产数据</returns>
  2638. public ActionResult GetInProductionAndProductionData(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2639. {
  2640. ActionResult actionResult = new ActionResult();
  2641. try
  2642. {
  2643. // 验证请求头信息
  2644. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2645. // 验证失败
  2646. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2647. {
  2648. return actionResult;
  2649. }
  2650. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2651. () => PDAModuleLogic.GetInProductionAndProductionData(barCode, sUserInfo));
  2652. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2653. {
  2654. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2655. actionResult.Status = (int)Constant.PDAResult.Success;
  2656. }
  2657. else
  2658. {
  2659. actionResult.Status = (int)Constant.PDAResult.Fail;
  2660. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2661. }
  2662. }
  2663. catch (Exception ex)
  2664. {
  2665. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2666. OutputLog.TraceLog(LogPriority.Error,
  2667. this.ToString(),
  2668. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2669. ex.ToString(),
  2670. LocalPath.LogExePath);
  2671. actionResult.Status = (int)Constant.PDAResult.Exception;
  2672. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2673. }
  2674. return actionResult;
  2675. }
  2676. /// <summary>
  2677. /// 根据工号查询员工档案信息
  2678. /// </summary>
  2679. /// <param name="accountCode"></param>
  2680. /// <param name="userCode"></param>
  2681. /// <param name="userPassword"></param>
  2682. /// <param name="sessionKey"></param>
  2683. /// <param name="userId"></param>
  2684. /// <returns></returns>
  2685. public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  2686. {
  2687. ActionResult actionResult = new ActionResult();
  2688. try
  2689. {
  2690. // 验证请求头信息
  2691. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2692. // 验证失败
  2693. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2694. {
  2695. return actionResult;
  2696. }
  2697. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2698. () => PDAModuleLogic.SearchHrStaffInfo(userId, sUserInfo));
  2699. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2700. {
  2701. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2702. actionResult.Status = (int)Constant.PDAResult.Success;
  2703. }
  2704. else
  2705. {
  2706. actionResult.Status = (int)Constant.PDAResult.Fail;
  2707. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2708. }
  2709. }
  2710. catch (Exception ex)
  2711. {
  2712. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2713. OutputLog.TraceLog(LogPriority.Error,
  2714. this.ToString(),
  2715. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2716. ex.ToString(),
  2717. LocalPath.LogExePath);
  2718. actionResult.Status = (int)Constant.PDAResult.Exception;
  2719. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2720. }
  2721. return actionResult;
  2722. }
  2723. /// <summary>
  2724. /// 添加废弃产品记录
  2725. /// </summary>
  2726. /// <param name="SProductEntity">废弃产品实体</param>
  2727. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  2728. /// <param name="SResponsibleList">责任者集合</param>
  2729. /// <param name="userInfo">用户基本信息</param>
  2730. /// <returns>int结果返回值</returns>
  2731. /// <remarks>
  2732. /// 庄天威 2014.09.24 新建
  2733. /// </remarks>
  2734. public ActionResult AddScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey,
  2735. ScrapProductEntity SProductEntity, ResponProcedureEntity RProcedureEntity,
  2736. ScrapResponsibleEntity[] SResponsibleList)
  2737. {
  2738. ActionResult actionResult = new ActionResult();
  2739. if (SResponsibleList == null || SResponsibleList.Length == 0)
  2740. {
  2741. actionResult.Status = (int)Constant.PDAResult.Fail;
  2742. actionResult.Message = "没有选择责任人";
  2743. }
  2744. try
  2745. {
  2746. // 验证请求头信息
  2747. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2748. // 验证失败
  2749. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2750. {
  2751. return actionResult;
  2752. }
  2753. int addRow = ServiceInvoker.Invoke<int>(this,
  2754. () => PDAModuleLogic.AddScrapProduct(SProductEntity, RProcedureEntity, SResponsibleList, sUserInfo));
  2755. actionResult.Result = JsonHelper.ToJson(addRow);
  2756. actionResult.Status = (int)Constant.PDAResult.Success;
  2757. }
  2758. catch (Exception ex)
  2759. {
  2760. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2761. OutputLog.TraceLog(LogPriority.Error,
  2762. this.ToString(),
  2763. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2764. ex.ToString(),
  2765. LocalPath.LogExePath);
  2766. actionResult.Status = (int)Constant.PDAResult.Exception;
  2767. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2768. // TODO 空指针异常问题检测
  2769. try
  2770. {
  2771. OutputLog.TraceLog(LogPriority.Error,
  2772. this.ToString(),
  2773. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2774. "accountCode:" + accountCode + "#userCode:" + userCode + "#sessionKey:" + sessionKey,
  2775. LocalPath.LogExePath);
  2776. string json1 = JsonHelper.ToJson(SProductEntity);
  2777. OutputLog.TraceLog(LogPriority.Error,
  2778. this.ToString(),
  2779. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2780. "SProductEntity:" + json1,
  2781. LocalPath.LogExePath);
  2782. string json2 = JsonHelper.ToJson(RProcedureEntity);
  2783. OutputLog.TraceLog(LogPriority.Error,
  2784. this.ToString(),
  2785. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2786. "RProcedureEntity:" + json2,
  2787. LocalPath.LogExePath);
  2788. string json3 = JsonHelper.ToJson(SResponsibleList);
  2789. OutputLog.TraceLog(LogPriority.Error,
  2790. this.ToString(),
  2791. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2792. "SResponsibleList:" + json3,
  2793. LocalPath.LogExePath);
  2794. }
  2795. catch (Exception exc)
  2796. {
  2797. OutputLog.TraceLog(LogPriority.Error,
  2798. this.ToString(),
  2799. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2800. "参数输入异常:" + exc.Message,
  2801. LocalPath.LogExePath);
  2802. }
  2803. }
  2804. return actionResult;
  2805. }
  2806. /// <summary>
  2807. /// 获取产品分级的数据(根据ID)
  2808. /// </summary>
  2809. /// <param name="GoodsLevelTypeID">分类类别ID</param>
  2810. /// <param name="GoodsLevelID">分类ID</param>
  2811. /// <param name="sUserInfo">用户基本信息</param>
  2812. /// <returns>DataSet</returns>
  2813. /// <remarks>
  2814. /// 2014.10.22 庄天威 新建
  2815. public ActionResult GetGoodsLevelDataById(string accountCode, string userCode, string userPassword, string sessionKey, int? GoodsLevelTypeID)
  2816. {
  2817. ActionResult actionResult = new ActionResult();
  2818. try
  2819. {
  2820. // 验证请求头信息
  2821. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2822. // 验证失败
  2823. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2824. {
  2825. return actionResult;
  2826. }
  2827. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2828. () => SystemModuleLogic.GetGoodsLevelDataById(GoodsLevelTypeID, null, sUserInfo));
  2829. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2830. {
  2831. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2832. actionResult.Status = (int)Constant.PDAResult.Success;
  2833. }
  2834. else
  2835. {
  2836. actionResult.Status = (int)Constant.PDAResult.Fail;
  2837. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  2838. }
  2839. }
  2840. catch (Exception ex)
  2841. {
  2842. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2843. OutputLog.TraceLog(LogPriority.Error,
  2844. this.ToString(),
  2845. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2846. ex.ToString(),
  2847. LocalPath.LogExePath);
  2848. actionResult.Status = (int)Constant.PDAResult.Exception;
  2849. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2850. }
  2851. return actionResult;
  2852. }
  2853. /// <summary>
  2854. /// 获取账务日期
  2855. /// </summary>
  2856. /// <param name="accountCode"></param>
  2857. /// <param name="userCode"></param>
  2858. /// <param name="userPassword"></param>
  2859. /// <param name="sessionKey"></param>
  2860. /// <returns></returns>
  2861. public ActionResult GetAccountDate(string accountCode, string userCode, string userPassword, string sessionKey)
  2862. {
  2863. ActionResult actionResult = new ActionResult();
  2864. try
  2865. {
  2866. // 验证请求头信息
  2867. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2868. // 验证失败
  2869. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2870. {
  2871. return actionResult;
  2872. }
  2873. DateTime reworkDs = ServiceInvoker.Invoke<DateTime>(this,
  2874. () => CommonModuleLogic.GetAccountDate(sUserInfo));
  2875. actionResult.Result = JsonHelper.ToJson(reworkDs);
  2876. actionResult.Status = (int)Constant.PDAResult.Success;
  2877. }
  2878. catch (Exception ex)
  2879. {
  2880. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2881. OutputLog.TraceLog(LogPriority.Error,
  2882. this.ToString(),
  2883. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2884. ex.ToString(),
  2885. LocalPath.LogExePath);
  2886. actionResult.Status = (int)Constant.PDAResult.Exception;
  2887. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2888. }
  2889. return actionResult;
  2890. }
  2891. /// <summary>
  2892. /// 获取登陆帐户有无报损权限
  2893. /// </summary>
  2894. /// <param name="accountCode"></param>
  2895. /// <param name="userCode"></param>
  2896. /// <param name="userPassword"></param>
  2897. /// <param name="sessionKey"></param>
  2898. /// <param name="usercode">工号编码</param>
  2899. /// <returns></returns>
  2900. public ActionResult GetScrapFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  2901. {
  2902. ActionResult actionResult = new ActionResult();
  2903. try
  2904. {
  2905. // 验证请求头信息
  2906. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2907. // 验证失败
  2908. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2909. {
  2910. return actionResult;
  2911. }
  2912. int returnValue = ServiceInvoker.Invoke<int>(this,
  2913. () => PDAModuleLogic.GetScrapFuntion(userCode, sUserInfo));
  2914. actionResult.Result = JsonHelper.ToJson(returnValue);
  2915. actionResult.Status = (int)Constant.PDAResult.Success;
  2916. }
  2917. catch (Exception ex)
  2918. {
  2919. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2920. OutputLog.TraceLog(LogPriority.Error,
  2921. this.ToString(),
  2922. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2923. ex.ToString(),
  2924. LocalPath.LogExePath);
  2925. actionResult.Status = (int)Constant.PDAResult.Exception;
  2926. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2927. }
  2928. return actionResult;
  2929. }
  2930. #endregion
  2931. /// <summary>
  2932. /// 获取是否存在报损未审核产品
  2933. /// </summary>
  2934. /// <param name="barcode">产品条码</param>
  2935. /// <returns>int</returns>
  2936. public ActionResult GetScrapProductAuditStatus(string accountCode, string userCode, string userPassword, string sessionKey, string barCode)
  2937. {
  2938. ActionResult actionResult = new ActionResult();
  2939. try
  2940. {
  2941. // 验证请求头信息
  2942. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2943. // 验证失败
  2944. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2945. {
  2946. return actionResult;
  2947. }
  2948. int row = ServiceInvoker.Invoke<int>(this,
  2949. () => PDAModuleLogic.GetScrapProductAuditStatus(barCode));
  2950. actionResult.Result = JsonHelper.ToJson(row);
  2951. actionResult.Status = (int)Constant.PDAResult.Success;
  2952. }
  2953. catch (Exception ex)
  2954. {
  2955. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  2956. OutputLog.TraceLog(LogPriority.Error,
  2957. this.ToString(),
  2958. System.Reflection.MethodBase.GetCurrentMethod().Name,
  2959. ex.ToString(),
  2960. LocalPath.LogExePath);
  2961. actionResult.Status = (int)Constant.PDAResult.Exception;
  2962. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  2963. }
  2964. return actionResult;
  2965. }
  2966. /// <summary>
  2967. /// 查询报废产品信息
  2968. /// </summary>
  2969. /// <param name="accountCode"></param>
  2970. /// <param name="userCode"></param>
  2971. /// <param name="userPassword"></param>
  2972. /// <param name="sessionKey"></param>
  2973. /// <param name="barCode">产品条码</param>
  2974. /// <param name="scrapProductID">报废产品ID</param>
  2975. /// <returns></returns>
  2976. public ActionResult GetScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barCode, int scrapProductID)
  2977. {
  2978. ActionResult actionResult = new ActionResult();
  2979. try
  2980. {
  2981. // 验证请求头信息
  2982. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  2983. // 验证失败
  2984. if (actionResult.Status != (int)Constant.PDAResult.Success)
  2985. {
  2986. return actionResult;
  2987. }
  2988. ScrapProductEntity selectProEntity = new ScrapProductEntity();
  2989. selectProEntity.BarCode = barCode;
  2990. selectProEntity.ScrapProductID = scrapProductID;
  2991. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  2992. () => PMModuleLogic.GetScrapProduct(selectProEntity, sUserInfo));
  2993. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  2994. {
  2995. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  2996. actionResult.Status = (int)Constant.PDAResult.Success;
  2997. }
  2998. else
  2999. {
  3000. actionResult.Status = (int)Constant.PDAResult.Fail;
  3001. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3002. }
  3003. }
  3004. catch (Exception ex)
  3005. {
  3006. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3007. OutputLog.TraceLog(LogPriority.Error,
  3008. this.ToString(),
  3009. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3010. ex.ToString(),
  3011. LocalPath.LogExePath);
  3012. actionResult.Status = (int)Constant.PDAResult.Exception;
  3013. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3014. }
  3015. return actionResult;
  3016. }
  3017. /// <summary>
  3018. /// 根据废弃产品ID获取责任工序
  3019. /// </summary>
  3020. /// <param name="accountCode"></param>
  3021. /// <param name="userCode"></param>
  3022. /// <param name="userPassword"></param>
  3023. /// <param name="sessionKey"></param>
  3024. /// <param name="scrapProductID">报废产品ID</param>
  3025. /// <returns></returns>
  3026. public ActionResult GetResponProcedureBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  3027. {
  3028. ActionResult actionResult = new ActionResult();
  3029. try
  3030. {
  3031. // 验证请求头信息
  3032. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3033. // 验证失败
  3034. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3035. {
  3036. return actionResult;
  3037. }
  3038. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3039. () => PMModuleLogic.GetResponProcedureBySPId(scrapProductID));
  3040. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3041. {
  3042. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3043. actionResult.Status = (int)Constant.PDAResult.Success;
  3044. }
  3045. else
  3046. {
  3047. actionResult.Status = (int)Constant.PDAResult.Fail;
  3048. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3049. }
  3050. }
  3051. catch (Exception ex)
  3052. {
  3053. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3054. OutputLog.TraceLog(LogPriority.Error,
  3055. this.ToString(),
  3056. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3057. ex.ToString(),
  3058. LocalPath.LogExePath);
  3059. actionResult.Status = (int)Constant.PDAResult.Exception;
  3060. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3061. }
  3062. return actionResult;
  3063. }
  3064. /// <summary>
  3065. /// 根据废弃产品ID获取责任人列表
  3066. /// </summary>
  3067. /// <param name="accountCode"></param>
  3068. /// <param name="userCode"></param>
  3069. /// <param name="userPassword"></param>
  3070. /// <param name="sessionKey"></param>
  3071. /// <param name="scrapProductID">报废产品ID</param>
  3072. /// <returns></returns>
  3073. public ActionResult GetScrapResponsibleBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID)
  3074. {
  3075. ActionResult actionResult = new ActionResult();
  3076. try
  3077. {
  3078. // 验证请求头信息
  3079. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3080. // 验证失败
  3081. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3082. {
  3083. return actionResult;
  3084. }
  3085. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3086. () => PMModuleLogic.GetScrapResponsibleBySPId(scrapProductID));
  3087. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3088. {
  3089. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3090. actionResult.Status = (int)Constant.PDAResult.Success;
  3091. }
  3092. else
  3093. {
  3094. actionResult.Status = (int)Constant.PDAResult.Fail;
  3095. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3096. }
  3097. }
  3098. catch (Exception ex)
  3099. {
  3100. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3101. OutputLog.TraceLog(LogPriority.Error,
  3102. this.ToString(),
  3103. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3104. ex.ToString(),
  3105. LocalPath.LogExePath);
  3106. actionResult.Status = (int)Constant.PDAResult.Exception;
  3107. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3108. }
  3109. return actionResult;
  3110. }
  3111. /// <summary>
  3112. /// 添加废弃产品记录
  3113. /// </summary>
  3114. /// <param name="SProductEntity">废弃产品实体</param>
  3115. /// <param name="RProcedureEntity">废弃责任工序实体</param>
  3116. /// <param name="SResponsibleList">责任者集合</param>
  3117. /// <param name="userInfo">用户基本信息</param>
  3118. /// <returns>int结果返回值</returns>
  3119. /// <remarks>
  3120. /// 庄天威 2014.09.24 新建
  3121. /// </remarks>
  3122. public ActionResult UpdateScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, ScrapProductEntity UpdateSProductEntity,
  3123. ResponProcedureEntity UpdateRProcedureEntity,
  3124. ScrapResponsibleEntity[] UpdateSResponsibleList, ScrapResponsibleEntity[] YSResponsibleList)
  3125. {
  3126. ActionResult actionResult = new ActionResult();
  3127. try
  3128. {
  3129. // 验证请求头信息
  3130. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3131. // 验证失败
  3132. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3133. {
  3134. return actionResult;
  3135. }
  3136. int addRow = ServiceInvoker.Invoke<int>(this,
  3137. () => PDAModuleLogic.UpdateScrapProduct(UpdateSProductEntity, UpdateRProcedureEntity, UpdateSResponsibleList, YSResponsibleList, sUserInfo));
  3138. actionResult.Result = JsonHelper.ToJson(addRow);
  3139. actionResult.Status = (int)Constant.PDAResult.Success;
  3140. }
  3141. catch (Exception ex)
  3142. {
  3143. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3144. OutputLog.TraceLog(LogPriority.Error,
  3145. this.ToString(),
  3146. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3147. ex.ToString(),
  3148. LocalPath.LogExePath);
  3149. actionResult.Status = (int)Constant.PDAResult.Exception;
  3150. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3151. }
  3152. return actionResult;
  3153. }
  3154. /// <summary>
  3155. /// 获取产品窑炉
  3156. /// </summary>
  3157. /// <param name="accountCode"></param>
  3158. /// <param name="userCode"></param>
  3159. /// <param name="userPassword"></param>
  3160. /// <param name="sessionKey"></param>
  3161. /// <returns>Datase</returns>
  3162. public ActionResult GetAllKilntInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  3163. {
  3164. ActionResult actionResult = new ActionResult();
  3165. try
  3166. {
  3167. // 验证请求头信息
  3168. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3169. // 验证失败
  3170. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3171. {
  3172. return actionResult;
  3173. }
  3174. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3175. () => PDAModuleLogic.GetAllKilntInfo(sUserInfo));
  3176. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3177. {
  3178. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3179. actionResult.Status = (int)Constant.PDAResult.Success;
  3180. }
  3181. else
  3182. {
  3183. actionResult.Status = (int)Constant.PDAResult.Fail;
  3184. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3185. }
  3186. }
  3187. catch (Exception ex)
  3188. {
  3189. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3190. OutputLog.TraceLog(LogPriority.Error,
  3191. this.ToString(),
  3192. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3193. ex.ToString(),
  3194. LocalPath.LogExePath);
  3195. actionResult.Status = (int)Constant.PDAResult.Exception;
  3196. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3197. }
  3198. return actionResult;
  3199. }
  3200. /// <summary>
  3201. /// 获取次品产品条码允许编辑
  3202. /// </summary>
  3203. /// <param name="accountCode"></param>
  3204. /// <param name="userCode"></param>
  3205. /// <param name="userPassword"></param>
  3206. /// <param name="sessionKey"></param>
  3207. /// <param name="barcode">产品条码</param>
  3208. /// <returns>Datase</returns>
  3209. public ActionResult GetSubstandardInfo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3210. {
  3211. ActionResult actionResult = new ActionResult();
  3212. try
  3213. {
  3214. // 验证请求头信息
  3215. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3216. // 验证失败
  3217. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3218. {
  3219. return actionResult;
  3220. }
  3221. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3222. () => PDAModuleLogic.GetSubstandardInfo(barcode));
  3223. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3224. {
  3225. actionResult.Result = JsonHelper.ToJson(1);
  3226. actionResult.Status = (int)Constant.PDAResult.Success;
  3227. }
  3228. else
  3229. {
  3230. actionResult.Result = JsonHelper.ToJson(0);
  3231. actionResult.Status = (int)Constant.PDAResult.Fail;
  3232. actionResult.Message = "次品条码:" + barcode + "不允许修改";
  3233. }
  3234. }
  3235. catch (Exception ex)
  3236. {
  3237. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3238. OutputLog.TraceLog(LogPriority.Error,
  3239. this.ToString(),
  3240. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3241. ex.ToString(),
  3242. LocalPath.LogExePath);
  3243. actionResult.Status = (int)Constant.PDAResult.Exception;
  3244. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3245. }
  3246. return actionResult;
  3247. }
  3248. /// <summary>
  3249. /// 获取产品条码是否重烧
  3250. /// </summary>
  3251. /// <param name="accountCode"></param>
  3252. /// <param name="userCode"></param>
  3253. /// <param name="userPassword"></param>
  3254. /// <param name="sessionKey"></param>
  3255. /// <param name="barcode">产品条码</param>
  3256. /// <returns>Datase</returns>
  3257. public ActionResult GetReFine(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3258. {
  3259. ActionResult actionResult = new ActionResult();
  3260. try
  3261. {
  3262. // 验证请求头信息
  3263. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3264. // 验证失败
  3265. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3266. {
  3267. return actionResult;
  3268. }
  3269. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3270. () => PDAModuleLogic.GetReFine(barcode));
  3271. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  3272. {
  3273. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(reworkDs.Tables[0].Rows[0]["IsReFire"]));
  3274. }
  3275. else
  3276. {
  3277. actionResult.Result = JsonHelper.ToJson(0);
  3278. }
  3279. actionResult.Status = (int)Constant.PDAResult.Success;
  3280. }
  3281. catch (Exception ex)
  3282. {
  3283. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3284. OutputLog.TraceLog(LogPriority.Error,
  3285. this.ToString(),
  3286. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3287. ex.ToString(),
  3288. LocalPath.LogExePath);
  3289. actionResult.Status = (int)Constant.PDAResult.Exception;
  3290. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3291. }
  3292. return actionResult;
  3293. }
  3294. /// <summary>
  3295. /// 获取登陆帐户有无成检编辑权限
  3296. /// </summary>
  3297. /// <param name="accountCode"></param>
  3298. /// <param name="userCode"></param>
  3299. /// <param name="userPassword"></param>
  3300. /// <param name="sessionKey"></param>
  3301. /// <param name="usercode">工号编码</param>
  3302. /// <returns></returns>
  3303. public ActionResult GetFinishedProductEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3304. {
  3305. ActionResult actionResult = new ActionResult();
  3306. try
  3307. {
  3308. // 验证请求头信息
  3309. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3310. // 验证失败
  3311. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3312. {
  3313. return actionResult;
  3314. }
  3315. int returnValue = ServiceInvoker.Invoke<int>(this,
  3316. () => PDAModuleLogic.GetFinishedProductEditFuntion(sUserInfo));
  3317. actionResult.Result = JsonHelper.ToJson(returnValue);
  3318. actionResult.Status = (int)Constant.PDAResult.Success;
  3319. }
  3320. catch (Exception ex)
  3321. {
  3322. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3323. OutputLog.TraceLog(LogPriority.Error,
  3324. this.ToString(),
  3325. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3326. ex.ToString(),
  3327. LocalPath.LogExePath);
  3328. actionResult.Status = (int)Constant.PDAResult.Exception;
  3329. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3330. }
  3331. return actionResult;
  3332. }
  3333. /// <summary>
  3334. /// 根据条码及工序判断是否漏扫
  3335. /// </summary>
  3336. /// <param name="accountCode"></param>
  3337. /// <param name="userCode"></param>
  3338. /// <param name="userPassword"></param>
  3339. /// <param name="sessionKey"></param>
  3340. /// <param name="usercode">工号编码</param>
  3341. /// <param name="barcode">产品条码</param>
  3342. /// <param name="produceid">工序ID</param>
  3343. /// <returns></returns>
  3344. public ActionResult AddBarCodeMissing(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int produceid)
  3345. {
  3346. ActionResult actionResult = new ActionResult();
  3347. try
  3348. {
  3349. // 验证请求头信息
  3350. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3351. // 验证失败
  3352. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3353. {
  3354. return actionResult;
  3355. }
  3356. int returnValue = 1;
  3357. //int returnValue = ServiceInvoker.Invoke<int>(this,
  3358. // () => PMModuleLogicDAL.AddBarCodeMissing(barcode, produceid, sUserInfo));
  3359. actionResult.Result = JsonHelper.ToJson(returnValue);
  3360. actionResult.Status = (int)Constant.PDAResult.Success;
  3361. }
  3362. catch (Exception ex)
  3363. {
  3364. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3365. OutputLog.TraceLog(LogPriority.Error,
  3366. this.ToString(),
  3367. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3368. ex.ToString(),
  3369. LocalPath.LogExePath);
  3370. actionResult.Status = (int)Constant.PDAResult.Exception;
  3371. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3372. }
  3373. return actionResult;
  3374. }
  3375. /// <summary>
  3376. /// 获取登陆帐户有无报损审批权限
  3377. /// </summary>
  3378. /// <param name="accountCode"></param>
  3379. /// <param name="userCode"></param>
  3380. /// <param name="userPassword"></param>
  3381. /// <param name="sessionKey"></param>
  3382. /// <param name="usercode">工号编码</param>
  3383. /// <returns></returns>
  3384. public ActionResult GetScrapProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3385. {
  3386. ActionResult actionResult = new ActionResult();
  3387. try
  3388. {
  3389. // 验证请求头信息
  3390. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3391. // 验证失败
  3392. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3393. {
  3394. return actionResult;
  3395. }
  3396. int returnValue = ServiceInvoker.Invoke<int>(this,
  3397. () => PDAModuleLogic.GetScrapProductFuntion(sUserInfo));
  3398. actionResult.Result = JsonHelper.ToJson(returnValue);
  3399. actionResult.Status = (int)Constant.PDAResult.Success;
  3400. }
  3401. catch (Exception ex)
  3402. {
  3403. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3404. OutputLog.TraceLog(LogPriority.Error,
  3405. this.ToString(),
  3406. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3407. ex.ToString(),
  3408. LocalPath.LogExePath);
  3409. actionResult.Status = (int)Constant.PDAResult.Exception;
  3410. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3411. }
  3412. return actionResult;
  3413. }
  3414. /// <summary>
  3415. /// 获取登陆帐户有无报损审批权限
  3416. /// </summary>
  3417. /// <param name="accountCode"></param>
  3418. /// <param name="userCode"></param>
  3419. /// <param name="userPassword"></param>
  3420. /// <param name="sessionKey"></param>
  3421. /// <param name="usercode">工号编码</param>
  3422. /// <returns></returns>
  3423. public ActionResult GetSpecialRepairflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3424. {
  3425. ActionResult actionResult = new ActionResult();
  3426. try
  3427. {
  3428. // 验证请求头信息
  3429. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3430. // 验证失败
  3431. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3432. {
  3433. return actionResult;
  3434. }
  3435. int returnValue = ServiceInvoker.Invoke<int>(this,
  3436. () => PMModuleLogic.GetSpecialRepairflagByBarcode(barcode, sUserInfo));
  3437. actionResult.Result = JsonHelper.ToJson(returnValue);
  3438. actionResult.Status = (int)Constant.PDAResult.Success;
  3439. }
  3440. catch (Exception ex)
  3441. {
  3442. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3443. OutputLog.TraceLog(LogPriority.Error,
  3444. this.ToString(),
  3445. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3446. ex.ToString(),
  3447. LocalPath.LogExePath);
  3448. actionResult.Status = (int)Constant.PDAResult.Exception;
  3449. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3450. }
  3451. return actionResult;
  3452. }
  3453. /// <summary>
  3454. /// 获取窑车对应产品列表
  3455. /// </summary>
  3456. /// <param name="accountCode"></param>
  3457. /// <param name="userCode"></param>
  3458. /// <param name="userPassword"></param>
  3459. /// <param name="sessionKey"></param>
  3460. /// <param name="KilnCarID">窑车ID</param>
  3461. /// <returns>Dataset</returns>
  3462. public ActionResult GetKilnCarGoodsByKilnCarID(string accountCode, string userCode, string userPassword, string sessionKey, int KilnCarID)
  3463. {
  3464. ActionResult actionResult = new ActionResult();
  3465. try
  3466. {
  3467. // 验证请求头信息
  3468. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3469. // 验证失败
  3470. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3471. {
  3472. return actionResult;
  3473. }
  3474. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  3475. () => PMModuleLogic.GetKilnCarGoodsByKilnCarID(KilnCarID));
  3476. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  3477. {
  3478. actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]);
  3479. actionResult.Status = (int)Constant.PDAResult.Success;
  3480. }
  3481. else
  3482. {
  3483. actionResult.Status = (int)Constant.PDAResult.Fail;
  3484. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  3485. }
  3486. }
  3487. catch (Exception ex)
  3488. {
  3489. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3490. OutputLog.TraceLog(LogPriority.Error,
  3491. this.ToString(),
  3492. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3493. ex.ToString(),
  3494. LocalPath.LogExePath);
  3495. actionResult.Status = (int)Constant.PDAResult.Exception;
  3496. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3497. }
  3498. return actionResult;
  3499. }
  3500. /// <summary>
  3501. /// 更换条码
  3502. /// </summary>
  3503. /// <param name="accountCode"></param>
  3504. /// <param name="userCode"></param>
  3505. /// <param name="userPassword"></param>
  3506. /// <param name="sessionKey"></param>
  3507. ///<param name="barcode">原条码</param>
  3508. /// <param name="newBarcode">新条码</param>
  3509. /// <param name="remarks">备注</param>
  3510. /// <returns>操作结果</returns>
  3511. public ActionResult SaveBarCodeChange(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, string newBarcode, string remarks, string groutingUserCode, string goodsCode)
  3512. {
  3513. ActionResult actionResult = new ActionResult();
  3514. try
  3515. {
  3516. // 验证请求头信息
  3517. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3518. // 验证失败
  3519. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3520. {
  3521. return actionResult;
  3522. }
  3523. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3524. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SetFPM0201Data(sUserInfo, barcode, newBarcode, remarks, groutingUserCode, goodsCode));
  3525. if (serviceResultEntity.Status == Constant.ServiceResultStatus.Success)
  3526. {
  3527. actionResult.Result = 1;
  3528. actionResult.Status = (int)Constant.PDAResult.Success;
  3529. }
  3530. else
  3531. {
  3532. actionResult.Status = (int)Constant.PDAResult.Fail;
  3533. actionResult.Message = serviceResultEntity.Message;
  3534. }
  3535. }
  3536. catch (Exception ex)
  3537. {
  3538. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3539. OutputLog.TraceLog(LogPriority.Error,
  3540. this.ToString(),
  3541. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3542. ex.ToString(),
  3543. LocalPath.LogExePath);
  3544. actionResult.Status = (int)Constant.PDAResult.Exception;
  3545. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3546. }
  3547. return actionResult;
  3548. }
  3549. /// <summary>
  3550. /// 获取(注浆登记)的查询数据
  3551. /// </summary>
  3552. /// <param name="accountCode"></param>
  3553. /// <param name="userCode"></param>
  3554. /// <param name="userPassword"></param>
  3555. /// <param name="sessionKey"></param>
  3556. /// <param name="se">查询条件</param>
  3557. /// <returns>Dataset</returns>
  3558. public ActionResult GetGroutingList(string accountCode, string userCode, string userPassword, string sessionKey, FPM0202_SE se)
  3559. {
  3560. ActionResult actionResult = new ActionResult();
  3561. try
  3562. {
  3563. // 验证请求头信息
  3564. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3565. // 验证失败
  3566. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3567. {
  3568. return actionResult;
  3569. }
  3570. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3571. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0202SData(sUserInfo, se));
  3572. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3573. {
  3574. // PDA不显示的列删除掉
  3575. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyDetailID");
  3576. //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyID");
  3577. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingLineName");
  3578. serviceResultEntity.Data.Tables[0].Columns.Remove("UserCode");
  3579. serviceResultEntity.Data.Tables[0].Columns.Remove("GoodsName");
  3580. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldStatusName");
  3581. serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingCount");
  3582. serviceResultEntity.Data.Tables[0].Columns.Remove("Remarks");
  3583. serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldTypeName");
  3584. //serviceResultEntity.Data.Tables[0].Columns.Remove("DMUserCode");
  3585. serviceResultEntity.Data.Tables[0].Columns.Remove("IsPublicBody");
  3586. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3587. actionResult.Status = (int)Constant.PDAResult.Success;
  3588. }
  3589. else
  3590. {
  3591. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3592. actionResult.Message = "无查询数据";
  3593. }
  3594. }
  3595. catch (Exception ex)
  3596. {
  3597. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3598. OutputLog.TraceLog(LogPriority.Error,
  3599. this.ToString(),
  3600. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3601. ex.ToString(),
  3602. LocalPath.LogExePath);
  3603. actionResult.Status = (int)Constant.PDAResult.Exception;
  3604. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3605. }
  3606. return actionResult;
  3607. }
  3608. /// <summary>
  3609. /// 获取(注浆登记)的查询数据
  3610. /// </summary>
  3611. /// <param name="accountCode"></param>
  3612. /// <param name="userCode"></param>
  3613. /// <param name="userPassword"></param>
  3614. /// <param name="sessionKey"></param>
  3615. /// <param name="se">查询条件</param>
  3616. /// <returns>Dataset</returns>
  3617. public ActionResult GetGroutingListByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3618. {
  3619. ActionResult actionResult = new ActionResult();
  3620. try
  3621. {
  3622. // 验证请求头信息
  3623. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3624. // 验证失败
  3625. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3626. {
  3627. return actionResult;
  3628. }
  3629. ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  3630. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0203SData(sUserInfo, barcode));
  3631. if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults)
  3632. {
  3633. actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]);
  3634. actionResult.Status = (int)Constant.PDAResult.Success;
  3635. }
  3636. else
  3637. {
  3638. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3639. actionResult.Message = "无查询数据";
  3640. }
  3641. }
  3642. catch (Exception ex)
  3643. {
  3644. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3645. OutputLog.TraceLog(LogPriority.Error,
  3646. this.ToString(),
  3647. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3648. ex.ToString(),
  3649. LocalPath.LogExePath);
  3650. actionResult.Status = (int)Constant.PDAResult.Exception;
  3651. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3652. }
  3653. return actionResult;
  3654. }
  3655. /// <summary>
  3656. ///获得成型线信息
  3657. /// </summary>
  3658. /// <param name="accountCode"></param>
  3659. /// <param name="userCode"></param>
  3660. /// <param name="userPassword"></param>
  3661. /// <param name="sessionKey"></param>
  3662. /// <param name="se">查询条件</param>
  3663. /// <returns>Dataset</returns>
  3664. public ActionResult GetGroutingLine(string accountCode, string userCode, string userPassword, string sessionKey, GroutingLineEntity groutingLineEntity)
  3665. {
  3666. ActionResult actionResult = new ActionResult();
  3667. try
  3668. {
  3669. // 验证请求头信息
  3670. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3671. // 验证失败
  3672. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3673. {
  3674. return actionResult;
  3675. }
  3676. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3677. () => Dongke.IBOSS.PRD.Service.PCModuleLogic.PCModuleLogic.GetGroutingLine(groutingLineEntity, sUserInfo));
  3678. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3679. {
  3680. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3681. actionResult.Status = (int)Constant.PDAResult.Success;
  3682. }
  3683. else
  3684. {
  3685. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3686. actionResult.Message = "无查询数据";
  3687. }
  3688. }
  3689. catch (Exception ex)
  3690. {
  3691. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3692. OutputLog.TraceLog(LogPriority.Error,
  3693. this.ToString(),
  3694. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3695. ex.ToString(),
  3696. LocalPath.LogExePath);
  3697. actionResult.Status = (int)Constant.PDAResult.Exception;
  3698. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3699. }
  3700. return actionResult;
  3701. }
  3702. /// <summary>
  3703. ///获取在产产品的信息标识列表
  3704. /// </summary>
  3705. /// <param name="accountCode"></param>
  3706. /// <param name="userCode"></param>
  3707. /// <param name="userPassword"></param>
  3708. /// <param name="sessionKey"></param>
  3709. /// <param name="barcode">查询条件</param>
  3710. /// <returns>Dataset</returns>
  3711. public ActionResult GetInProductionDataList(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3712. {
  3713. ActionResult actionResult = new ActionResult();
  3714. try
  3715. {
  3716. // 验证请求头信息
  3717. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3718. // 验证失败
  3719. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3720. {
  3721. return actionResult;
  3722. }
  3723. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3724. () => PMModuleLogic.GetInProductionDataList(barcode));
  3725. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3726. {
  3727. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3728. actionResult.Status = (int)Constant.PDAResult.Success;
  3729. }
  3730. else
  3731. {
  3732. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3733. actionResult.Message = "无查询数据";
  3734. }
  3735. }
  3736. catch (Exception ex)
  3737. {
  3738. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3739. OutputLog.TraceLog(LogPriority.Error,
  3740. this.ToString(),
  3741. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3742. ex.ToString(),
  3743. LocalPath.LogExePath);
  3744. actionResult.Status = (int)Constant.PDAResult.Exception;
  3745. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3746. }
  3747. return actionResult;
  3748. }
  3749. /// <summary>
  3750. ///获取条码是否注浆登记过,0行无效
  3751. /// </summary>
  3752. /// <param name="accountCode"></param>
  3753. /// <param name="userCode"></param>
  3754. /// <param name="userPassword"></param>
  3755. /// <param name="sessionKey"></param>
  3756. /// <param name="barcode">查询条件</param>
  3757. /// <returns>Dataset</returns>
  3758. public ActionResult GetBarCodeInGroutingDailyDetail(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3759. {
  3760. ActionResult actionResult = new ActionResult();
  3761. try
  3762. {
  3763. // 验证请求头信息
  3764. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3765. // 验证失败
  3766. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3767. {
  3768. return actionResult;
  3769. }
  3770. DataSet dsReturn = ServiceInvoker.Invoke<DataSet>(this,
  3771. () => PMModuleLogic.GetBarCodeInGroutingDailyDetail(barcode));
  3772. if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0)
  3773. {
  3774. actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]);
  3775. actionResult.Status = (int)Constant.PDAResult.Success;
  3776. }
  3777. else
  3778. {
  3779. actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100
  3780. actionResult.Message = "该产品条码无效,无法报损!";
  3781. }
  3782. }
  3783. catch (Exception ex)
  3784. {
  3785. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3786. OutputLog.TraceLog(LogPriority.Error,
  3787. this.ToString(),
  3788. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3789. ex.ToString(),
  3790. LocalPath.LogExePath);
  3791. actionResult.Status = (int)Constant.PDAResult.Exception;
  3792. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3793. }
  3794. return actionResult;
  3795. }
  3796. /// <summary>
  3797. /// 获取登陆帐户有变更条码权限
  3798. /// </summary>
  3799. /// <param name="accountCode"></param>
  3800. /// <param name="userCode"></param>
  3801. /// <param name="userPassword"></param>
  3802. /// <param name="sessionKey"></param>
  3803. /// <returns></returns>
  3804. public ActionResult GetBarCodeRecordFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  3805. {
  3806. ActionResult actionResult = new ActionResult();
  3807. try
  3808. {
  3809. // 验证请求头信息
  3810. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3811. // 验证失败
  3812. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3813. {
  3814. return actionResult;
  3815. }
  3816. int returnValue = ServiceInvoker.Invoke<int>(this,
  3817. () => PDAModuleLogic.GetBarCodeRecordFuntion(sUserInfo));
  3818. actionResult.Result = JsonHelper.ToJson(returnValue);
  3819. actionResult.Status = (int)Constant.PDAResult.Success;
  3820. }
  3821. catch (Exception ex)
  3822. {
  3823. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3824. OutputLog.TraceLog(LogPriority.Error,
  3825. this.ToString(),
  3826. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3827. ex.ToString(),
  3828. LocalPath.LogExePath);
  3829. actionResult.Status = (int)Constant.PDAResult.Exception;
  3830. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3831. }
  3832. return actionResult;
  3833. }
  3834. /// <summary>
  3835. /// 成检时获取此条码是否报损
  3836. /// </summary>
  3837. /// <param name="accountCode"></param>
  3838. /// <param name="userCode"></param>
  3839. /// <param name="userPassword"></param>
  3840. /// <param name="sessionKey"></param>
  3841. /// <param name="barcode">产品条码</param>
  3842. /// <returns></returns>
  3843. public ActionResult CheckScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3844. {
  3845. ActionResult actionResult = new ActionResult();
  3846. try
  3847. {
  3848. // 验证请求头信息
  3849. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3850. // 验证失败
  3851. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3852. {
  3853. return actionResult;
  3854. }
  3855. int returnValue = ServiceInvoker.Invoke<int>(this,
  3856. () => PMModuleLogic.CheckScrapProduct(barcode));
  3857. if (returnValue == -100)
  3858. {
  3859. actionResult.Result = JsonHelper.ToJson(returnValue);
  3860. actionResult.Status = (int)Constant.PDAResult.Success;
  3861. }
  3862. else
  3863. {
  3864. actionResult.Status = (int)Constant.PDAResult.Fail;
  3865. if (returnValue == 0)
  3866. {
  3867. actionResult.Message = "该条码:" + barcode + "存在报损记录(待审批)";
  3868. }
  3869. else
  3870. {
  3871. actionResult.Message = "该条码:" + barcode + "存在报损记录(审批通过)";
  3872. }
  3873. }
  3874. }
  3875. catch (Exception ex)
  3876. {
  3877. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3878. OutputLog.TraceLog(LogPriority.Error,
  3879. this.ToString(),
  3880. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3881. ex.ToString(),
  3882. LocalPath.LogExePath);
  3883. actionResult.Status = (int)Constant.PDAResult.Exception;
  3884. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3885. }
  3886. return actionResult;
  3887. }
  3888. /// <summary>
  3889. /// 获取产品完成工序的ID(PDA)
  3890. /// </summary>
  3891. /// <param name="barcode">产品条码</param>
  3892. /// <returns>int</returns>
  3893. public ActionResult GetCompleteProcedureIDPDA(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3894. {
  3895. ActionResult actionResult = new ActionResult();
  3896. try
  3897. {
  3898. // 验证请求头信息
  3899. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3900. // 验证失败
  3901. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3902. {
  3903. return actionResult;
  3904. }
  3905. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3906. () => PMModuleLogic.GetCompleteProcedureIDPDA(barcode));
  3907. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  3908. actionResult.Status = (int)Constant.PDAResult.Success;
  3909. }
  3910. catch (Exception ex)
  3911. {
  3912. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3913. OutputLog.TraceLog(LogPriority.Error,
  3914. this.ToString(),
  3915. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3916. ex.ToString(),
  3917. LocalPath.LogExePath);
  3918. actionResult.Status = (int)Constant.PDAResult.Exception;
  3919. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3920. }
  3921. return actionResult;
  3922. }
  3923. /// <summary>
  3924. /// 获取产品完成工序的ID(PDA)
  3925. /// </summary>
  3926. /// <param name="barcode">产品条码</param>
  3927. /// <returns>int</returns>
  3928. public ActionResult GetGoodsInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  3929. {
  3930. ActionResult actionResult = new ActionResult();
  3931. try
  3932. {
  3933. // 验证请求头信息
  3934. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3935. // 验证失败
  3936. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3937. {
  3938. return actionResult;
  3939. }
  3940. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3941. () => PMModuleLogic.GetGoodsInfoBybarcode(barcode));
  3942. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  3943. actionResult.Status = (int)Constant.PDAResult.Success;
  3944. }
  3945. catch (Exception ex)
  3946. {
  3947. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  3948. OutputLog.TraceLog(LogPriority.Error,
  3949. this.ToString(),
  3950. System.Reflection.MethodBase.GetCurrentMethod().Name,
  3951. ex.ToString(),
  3952. LocalPath.LogExePath);
  3953. actionResult.Status = (int)Constant.PDAResult.Exception;
  3954. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  3955. }
  3956. return actionResult;
  3957. }
  3958. /// <summary>
  3959. /// 成检-校验生产工号
  3960. /// </summary>
  3961. /// <param name="usercode">生产工号</param>
  3962. /// <returns>int</returns>
  3963. public ActionResult GetUserCode(string accountCode, string userCode, string userPassword, string sessionKey, string usercode)
  3964. {
  3965. ActionResult actionResult = new ActionResult();
  3966. try
  3967. {
  3968. // 验证请求头信息
  3969. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  3970. // 验证失败
  3971. if (actionResult.Status != (int)Constant.PDAResult.Success)
  3972. {
  3973. return actionResult;
  3974. }
  3975. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  3976. () => PDAModuleLogic.GetUserCode(usercode, sUserInfo));
  3977. actionResult.Result = JsonHelper.ToJson(ds);
  3978. actionResult.Status = (int)Constant.PDAResult.Success;
  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. /// 更新漏扫的成型工号
  3995. /// </summary>
  3996. /// <param name="accountCode"></param>
  3997. /// <param name="userCode"></param>
  3998. /// <param name="userPassword"></param>
  3999. /// <param name="sessionKey"></param>
  4000. /// <param name="groutingUserCode">成型工号</param>
  4001. /// <param name="missingID">漏扫ID</param>
  4002. /// <returns></returns>
  4003. public ActionResult UpdateGroutingUserCodeByMissingID(string accountCode, string userCode, string userPassword, string sessionKey, string groutingUserCode, int missingID)
  4004. {
  4005. ActionResult actionResult = new ActionResult();
  4006. try
  4007. {
  4008. // 验证请求头信息
  4009. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4010. // 验证失败
  4011. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4012. {
  4013. return actionResult;
  4014. }
  4015. int returnValue = ServiceInvoker.Invoke<int>(this,
  4016. () => PMModuleLogicDAL.UpdateGroutingUserCodeByMissingID(groutingUserCode, missingID, sUserInfo));
  4017. if (returnValue != -1)
  4018. {
  4019. actionResult.Result = JsonHelper.ToJson(returnValue);
  4020. actionResult.Status = (int)Constant.PDAResult.Success;
  4021. }
  4022. else
  4023. {
  4024. actionResult.Status = (int)Constant.PDAResult.Fail;
  4025. actionResult.Message = "存在无效的漏扫工号";
  4026. }
  4027. }
  4028. catch (Exception ex)
  4029. {
  4030. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4031. OutputLog.TraceLog(LogPriority.Error,
  4032. this.ToString(),
  4033. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4034. ex.ToString(),
  4035. LocalPath.LogExePath);
  4036. actionResult.Status = (int)Constant.PDAResult.Exception;
  4037. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4038. }
  4039. return actionResult;
  4040. }
  4041. /// <summary>
  4042. /// 在入窑工序检验窑车号是否存在
  4043. /// </summary>
  4044. /// <param name="accountCode"></param>
  4045. /// <param name="userCode"></param>
  4046. /// <param name="userPassword"></param>
  4047. /// <param name="sessionKey"></param>
  4048. /// <param name="kilncarcode">窑车编码</param>
  4049. /// <param name="procedureid">工序ID</param>
  4050. /// <returns></returns>
  4051. public ActionResult CheckKilnCarByIntoCar(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  4052. {
  4053. ActionResult actionResult = new ActionResult();
  4054. try
  4055. {
  4056. // 验证请求头信息
  4057. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4058. // 验证失败
  4059. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4060. {
  4061. return actionResult;
  4062. }
  4063. int returnValue = ServiceInvoker.Invoke<int>(this,
  4064. () => PMModuleLogicDAL.CheckKilnCarByIntoCar(kilncarcode, procedureid, sUserInfo));
  4065. if (returnValue == 1)
  4066. {
  4067. actionResult.Result = JsonHelper.ToJson(returnValue);
  4068. actionResult.Status = (int)Constant.PDAResult.Success;
  4069. }
  4070. else
  4071. {
  4072. actionResult.Status = (int)Constant.PDAResult.Fail;
  4073. if (returnValue == -99)
  4074. actionResult.Message = "窑炉车号无效";
  4075. else if (returnValue == -98)
  4076. actionResult.Message = "窑车己无产品";
  4077. else if (returnValue == -97)
  4078. actionResult.Message = "窑车没有入窑,不可以撤销";
  4079. else if (returnValue == -1)
  4080. actionResult.Message = "保存失败";
  4081. }
  4082. }
  4083. catch (Exception ex)
  4084. {
  4085. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4086. OutputLog.TraceLog(LogPriority.Error,
  4087. this.ToString(),
  4088. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4089. ex.ToString(),
  4090. LocalPath.LogExePath);
  4091. actionResult.Status = (int)Constant.PDAResult.Exception;
  4092. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4093. }
  4094. return actionResult;
  4095. }
  4096. /// <summary>
  4097. /// 获取盘点单列表
  4098. /// </summary>
  4099. /// <param name="sUserInfo"></param>
  4100. /// <returns></returns>
  4101. public ActionResult GetInCheckedList(string accountCode, string userCode, string userPassword, string sessionKey)
  4102. {
  4103. ActionResult actionResult = new ActionResult();
  4104. try
  4105. {
  4106. // 验证请求头信息
  4107. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4108. // 验证失败
  4109. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4110. {
  4111. return actionResult;
  4112. }
  4113. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4114. () => PMModuleLogic.GetInCheckedList(sUserInfo));
  4115. actionResult.Result = JsonHelper.ToJson(ds);
  4116. actionResult.Status = (int)Constant.PDAResult.Success;
  4117. }
  4118. catch (Exception ex)
  4119. {
  4120. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4121. OutputLog.TraceLog(LogPriority.Error,
  4122. this.ToString(),
  4123. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4124. ex.ToString(),
  4125. LocalPath.LogExePath);
  4126. actionResult.Status = (int)Constant.PDAResult.Exception;
  4127. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4128. }
  4129. return actionResult;
  4130. }
  4131. /// <summary>
  4132. /// 进行盘点操作
  4133. /// </summary>
  4134. /// <param name="accountCode"></param>
  4135. /// <param name="userCode"></param>
  4136. /// <param name="userPassword"></param>
  4137. /// <param name="sessionKey"></param>
  4138. /// <param name="InCheckedID">盘点单ID</param>
  4139. /// <param name="BarCode">产品条码</param>
  4140. /// <returns></returns>
  4141. public ActionResult UpdateInChecked(string accountCode, string userCode, string userPassword, string sessionKey, int InCheckedID, string BarCode)
  4142. {
  4143. ActionResult actionResult = new ActionResult();
  4144. try
  4145. {
  4146. // 验证请求头信息
  4147. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4148. // 验证失败
  4149. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4150. {
  4151. return actionResult;
  4152. }
  4153. int returnValue = ServiceInvoker.Invoke<int>(this,
  4154. () => PMModuleLogicDAL.UpdateInChecked(InCheckedID, BarCode, sUserInfo));
  4155. if (returnValue > 0)
  4156. {
  4157. actionResult.Result = JsonHelper.ToJson(returnValue);
  4158. actionResult.Status = (int)Constant.PDAResult.Success;
  4159. actionResult.Message = "产品" + BarCode + "盘点成功";
  4160. }
  4161. else if (returnValue == 10)
  4162. {
  4163. actionResult.Result = JsonHelper.ToJson(returnValue);
  4164. actionResult.Status = (int)Constant.PDAResult.Success;
  4165. actionResult.Message = "产品" + BarCode + "盘盈成功";
  4166. }
  4167. else
  4168. {
  4169. actionResult.Status = (int)Constant.PDAResult.Fail;
  4170. if (returnValue == -2)
  4171. actionResult.Message = "产品" + BarCode + "不是在产产品";
  4172. //if (returnValue == 10)
  4173. // actionResult.Message = "产品" + BarCode + "盘盈成功";
  4174. //if (returnValue > 0)
  4175. // actionResult.Message = "产品" + BarCode + "盘点成功";
  4176. if (returnValue == -22)
  4177. actionResult.Message = "产品" + BarCode + "己被其他工号盘点";
  4178. if (returnValue == -23)
  4179. actionResult.Message = "产品" + BarCode + "己被其他工号盘盈";
  4180. if (returnValue == -24)
  4181. actionResult.Message = "产品" + BarCode + "己被此工号盘点";
  4182. if (returnValue == -25)
  4183. actionResult.Message = "产品" + BarCode + "己被此工号盘盈";
  4184. else if (returnValue == 0)
  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. #region 班次配置
  4202. /// <summary>
  4203. /// 班次配置-通过工号获取工种列表
  4204. /// </summary>
  4205. /// <param name="userId">工号ID</param>
  4206. /// <returns></returns>
  4207. public ActionResult BindUserJobs(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4208. {
  4209. ActionResult actionResult = new ActionResult();
  4210. try
  4211. {
  4212. // 验证请求头信息
  4213. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4214. // 验证失败
  4215. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4216. {
  4217. return actionResult;
  4218. }
  4219. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4220. () => SystemModuleLogic.GetJobByUserId(userId));
  4221. actionResult.Result = JsonHelper.ToJson(ds);
  4222. actionResult.Status = (int)Constant.PDAResult.Success;
  4223. }
  4224. catch (Exception ex)
  4225. {
  4226. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4227. OutputLog.TraceLog(LogPriority.Error,
  4228. this.ToString(),
  4229. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4230. ex.ToString(),
  4231. LocalPath.LogExePath);
  4232. actionResult.Status = (int)Constant.PDAResult.Exception;
  4233. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4234. }
  4235. return actionResult;
  4236. }
  4237. ///// <summary>
  4238. ///// 班次配置-根据工号查询员工档案信息
  4239. ///// </summary>
  4240. ///// <param name="userId">工号ID</param>
  4241. ///// <returns></returns>
  4242. //public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId)
  4243. //{
  4244. // ActionResult actionResult = new ActionResult();
  4245. // try
  4246. // {
  4247. // // 验证请求头信息
  4248. // actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4249. // // 验证失败
  4250. // if (actionResult.Status != (int)Constant.PDAResult.Success)
  4251. // {
  4252. // return actionResult;
  4253. // }
  4254. // DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4255. // () => HRModuleLogic.SearchHrStaffInfo(userId,sUserInfo));
  4256. // actionResult.Result = JsonHelper.ToJson(ds);
  4257. // actionResult.Status = (int)Constant.PDAResult.Success;
  4258. // }
  4259. // catch (Exception ex)
  4260. // {
  4261. // //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4262. // OutputLog.TraceLog(LogPriority.Error,
  4263. // this.ToString(),
  4264. // System.Reflection.MethodBase.GetCurrentMethod().Name,
  4265. // ex.ToString(),
  4266. // LocalPath.LogExePath);
  4267. // actionResult.Status = (int)Constant.PDAResult.Exception;
  4268. // actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4269. // }
  4270. // return actionResult;
  4271. //}
  4272. /// <summary>
  4273. /// 班次配置-根据员工姓名查员工信息
  4274. /// </summary>
  4275. /// <param name="searchStaffEntity"></param>
  4276. /// <returns></returns>
  4277. public ActionResult SearchStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, SearchStaffEntity searchStaffEntity)
  4278. {
  4279. ActionResult actionResult = new ActionResult();
  4280. try
  4281. {
  4282. // 验证请求头信息
  4283. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4284. // 验证失败
  4285. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4286. {
  4287. return actionResult;
  4288. }
  4289. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4290. () => PDAModuleLogic.SearchStaffInfo(searchStaffEntity, sUserInfo));
  4291. actionResult.Result = JsonHelper.ToJson(ds);
  4292. actionResult.Status = (int)Constant.PDAResult.Success;
  4293. }
  4294. catch (Exception ex)
  4295. {
  4296. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4297. OutputLog.TraceLog(LogPriority.Error,
  4298. this.ToString(),
  4299. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4300. ex.ToString(),
  4301. LocalPath.LogExePath);
  4302. actionResult.Status = (int)Constant.PDAResult.Exception;
  4303. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4304. }
  4305. return actionResult;
  4306. }
  4307. /// <summary>
  4308. /// 获取班次配置信息
  4309. /// </summary>
  4310. /// <param name="searchEntity"></param>
  4311. /// <returns></returns>
  4312. public ActionResult SearchClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, SearchClassesSettingEntity searchEntity)
  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. searchEntity.StartAccountDate = Convert.ToDateTime(searchEntity.StartAccountDatePDA);
  4325. searchEntity.EndAccountDate = Convert.ToDateTime(searchEntity.EndAccountDatePDA).AddDays(1).AddMinutes(-1);
  4326. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4327. () => PCModuleLogic.SearchClassesSetting(searchEntity, sUserInfo));
  4328. actionResult.Result = JsonHelper.ToJson(ds);
  4329. actionResult.Status = (int)Constant.PDAResult.Success;
  4330. }
  4331. catch (Exception ex)
  4332. {
  4333. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4334. OutputLog.TraceLog(LogPriority.Error,
  4335. this.ToString(),
  4336. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4337. ex.ToString(),
  4338. LocalPath.LogExePath);
  4339. actionResult.Status = (int)Constant.PDAResult.Exception;
  4340. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4341. }
  4342. return actionResult;
  4343. }
  4344. public ActionResult SaveClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, ClassesSettingEntity setEntity, ClassesDetailSettingEntity[] setDetailEntity)
  4345. {
  4346. ActionResult actionResult = new ActionResult();
  4347. try
  4348. {
  4349. // 验证请求头信息
  4350. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4351. // 验证失败
  4352. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4353. {
  4354. return actionResult;
  4355. }
  4356. int returnValue = ServiceInvoker.Invoke<int>(this,
  4357. () => PDAModuleLogic.SaveClassesSetting(setEntity, setDetailEntity, sUserInfo));
  4358. if (returnValue > 0)
  4359. {
  4360. actionResult.Result = JsonHelper.ToJson(returnValue);
  4361. actionResult.Status = (int)Constant.PDAResult.Success;
  4362. }
  4363. else
  4364. {
  4365. actionResult.Status = (int)Constant.PDAResult.Fail;
  4366. actionResult.Message = "保存失败";
  4367. }
  4368. }
  4369. catch (Exception ex)
  4370. {
  4371. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4372. OutputLog.TraceLog(LogPriority.Error,
  4373. this.ToString(),
  4374. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4375. ex.ToString(),
  4376. LocalPath.LogExePath);
  4377. actionResult.Status = (int)Constant.PDAResult.Exception;
  4378. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4379. }
  4380. return actionResult;
  4381. }
  4382. /// <summary>
  4383. /// 班次配置--获取详细信息
  4384. /// </summary>
  4385. /// <param name="searchEntity"></param>
  4386. /// <returns></returns>
  4387. public ActionResult SearchClassesDetail(string accountCode, string userCode, string userPassword, string sessionKey, int classesSettingID)
  4388. {
  4389. ActionResult actionResult = new ActionResult();
  4390. try
  4391. {
  4392. // 验证请求头信息
  4393. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4394. // 验证失败
  4395. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4396. {
  4397. return actionResult;
  4398. }
  4399. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4400. () => PCModuleLogic.SearchClassesDetail(classesSettingID, sUserInfo));
  4401. actionResult.Result = JsonHelper.ToJson(ds);
  4402. actionResult.Status = (int)Constant.PDAResult.Success;
  4403. }
  4404. catch (Exception ex)
  4405. {
  4406. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4407. OutputLog.TraceLog(LogPriority.Error,
  4408. this.ToString(),
  4409. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4410. ex.ToString(),
  4411. LocalPath.LogExePath);
  4412. actionResult.Status = (int)Constant.PDAResult.Exception;
  4413. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4414. }
  4415. return actionResult;
  4416. }
  4417. /// <summary>
  4418. /// 获取用户是否有班次配置权限
  4419. /// </summary>
  4420. /// <param name="accountCode"></param>
  4421. /// <param name="userCode"></param>
  4422. /// <param name="userPassword"></param>
  4423. /// <param name="sessionKey"></param>
  4424. /// <returns></returns>
  4425. public ActionResult GetClassesSettingFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4426. {
  4427. ActionResult actionResult = new ActionResult();
  4428. try
  4429. {
  4430. // 验证请求头信息
  4431. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4432. // 验证失败
  4433. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4434. {
  4435. return actionResult;
  4436. }
  4437. int returnValue = ServiceInvoker.Invoke<int>(this,
  4438. () => PDAModuleLogic.GetClassesSettingFuntion(sUserInfo));
  4439. actionResult.Result = JsonHelper.ToJson(returnValue);
  4440. actionResult.Status = (int)Constant.PDAResult.Success;
  4441. }
  4442. catch (Exception ex)
  4443. {
  4444. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4445. OutputLog.TraceLog(LogPriority.Error,
  4446. this.ToString(),
  4447. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4448. ex.ToString(),
  4449. LocalPath.LogExePath);
  4450. actionResult.Status = (int)Constant.PDAResult.Exception;
  4451. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4452. }
  4453. return actionResult;
  4454. }
  4455. /// <summary>
  4456. /// 获取盘点单列表
  4457. /// </summary>
  4458. /// <param name="sUserInfo"></param>
  4459. /// <returns></returns>
  4460. public ActionResult GetAllInChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  4461. {
  4462. ActionResult actionResult = new ActionResult();
  4463. try
  4464. {
  4465. // 验证请求头信息
  4466. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4467. // 验证失败
  4468. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4469. {
  4470. return actionResult;
  4471. }
  4472. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  4473. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  4474. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4475. () => PDAModuleLogic.GetAllInChecked(entity, sUserInfo));
  4476. actionResult.Result = JsonHelper.ToJson(ds);
  4477. actionResult.Status = (int)Constant.PDAResult.Success;
  4478. }
  4479. catch (Exception ex)
  4480. {
  4481. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4482. OutputLog.TraceLog(LogPriority.Error,
  4483. this.ToString(),
  4484. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4485. ex.ToString(),
  4486. LocalPath.LogExePath);
  4487. actionResult.Status = (int)Constant.PDAResult.Exception;
  4488. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4489. }
  4490. return actionResult;
  4491. }
  4492. #endregion
  4493. #region PDA报表
  4494. /// <summary>
  4495. /// 产品质量跟踪
  4496. /// </summary>
  4497. /// <param name="accountCode"></param>
  4498. /// <param name="userCode"></param>
  4499. /// <param name="userPassword"></param>
  4500. /// <param name="sessionKey"></param>
  4501. /// <param name="se"></param>
  4502. /// <returns></returns>
  4503. public ActionResult GetRPT040104SData(string accountCode, string userCode, string userPassword, string sessionKey, RPT040104_SE se)
  4504. {
  4505. ActionResult actionResult = new ActionResult();
  4506. try
  4507. {
  4508. // 验证请求头信息
  4509. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4510. // 验证失败
  4511. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4512. {
  4513. return actionResult;
  4514. }
  4515. se.CreateTimeStart = Convert.ToDateTime(se.CreateTimeStartPDA);
  4516. se.CreateTimeEnd = Convert.ToDateTime(se.CreateTimeEndPDA).AddDays(1);
  4517. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4518. () => PDAModuleLogic.GetRPT040104SData(sUserInfo, se));
  4519. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4520. {
  4521. actionResult.Status = (int)Constant.PDAResult.Fail;
  4522. actionResult.Message = Messages.MSG_CMN_I002;
  4523. }
  4524. else
  4525. {
  4526. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4527. actionResult.Status = (int)Constant.PDAResult.Success;
  4528. }
  4529. }
  4530. catch (Exception ex)
  4531. {
  4532. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4533. OutputLog.TraceLog(LogPriority.Error,
  4534. this.ToString(),
  4535. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4536. ex.ToString(),
  4537. LocalPath.LogExePath);
  4538. actionResult.Status = (int)Constant.PDAResult.Exception;
  4539. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4540. }
  4541. return actionResult;
  4542. }
  4543. /// <summary>
  4544. /// 工号产量质量分析表
  4545. /// </summary>
  4546. /// <param name="accountCode"></param>
  4547. /// <param name="userCode"></param>
  4548. /// <param name="userPassword"></param>
  4549. /// <param name="sessionKey"></param>
  4550. /// <param name="se"></param>
  4551. /// <returns></returns>
  4552. public ActionResult GetFP00002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4553. int rptSProcedureID, string workcode, string date)
  4554. {
  4555. ActionResult actionResult = new ActionResult();
  4556. try
  4557. {
  4558. // 验证请求头信息
  4559. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4560. // 验证失败
  4561. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4562. {
  4563. return actionResult;
  4564. }
  4565. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4566. () => PDAModuleLogic.GetFP00002Data(sUserInfo, rptSProcedureID, workcode, Convert.ToDateTime(date)));
  4567. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4568. {
  4569. actionResult.Status = (int)Constant.PDAResult.Fail;
  4570. actionResult.Message = Messages.MSG_CMN_I002;
  4571. }
  4572. else
  4573. {
  4574. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4575. actionResult.Status = (int)Constant.PDAResult.Success;
  4576. }
  4577. }
  4578. catch (Exception ex)
  4579. {
  4580. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4581. OutputLog.TraceLog(LogPriority.Error,
  4582. this.ToString(),
  4583. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4584. ex.ToString(),
  4585. LocalPath.LogExePath);
  4586. actionResult.Status = (int)Constant.PDAResult.Exception;
  4587. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4588. }
  4589. return actionResult;
  4590. }
  4591. /// <summary>
  4592. /// 工号产量质量分析表(中陶)
  4593. /// </summary>
  4594. /// <param name="accountCode"></param>
  4595. /// <param name="userCode"></param>
  4596. /// <param name="userPassword"></param>
  4597. /// <param name="sessionKey"></param>
  4598. /// <param name="se"></param>
  4599. /// <returns></returns>
  4600. public ActionResult GetFP00002_1Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4601. int rptSProcedureID, string workcode, string date, string goodscode)
  4602. {
  4603. ActionResult actionResult = new ActionResult();
  4604. try
  4605. {
  4606. // 验证请求头信息
  4607. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4608. // 验证失败
  4609. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4610. {
  4611. return actionResult;
  4612. }
  4613. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4614. () => PDAModuleLogic.GetFP00002_1Data(sUserInfo, rptSProcedureID, workcode,
  4615. Convert.ToDateTime(date), goodscode));
  4616. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4617. {
  4618. actionResult.Status = (int)Constant.PDAResult.Fail;
  4619. actionResult.Message = Messages.MSG_CMN_I002;
  4620. }
  4621. else
  4622. {
  4623. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4624. actionResult.Status = (int)Constant.PDAResult.Success;
  4625. }
  4626. }
  4627. catch (Exception ex)
  4628. {
  4629. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4630. OutputLog.TraceLog(LogPriority.Error,
  4631. this.ToString(),
  4632. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4633. ex.ToString(),
  4634. LocalPath.LogExePath);
  4635. actionResult.Status = (int)Constant.PDAResult.Exception;
  4636. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4637. }
  4638. return actionResult;
  4639. }
  4640. /// <summary>
  4641. /// 半检数据统计表
  4642. /// </summary>
  4643. /// <param name="accountCode"></param>
  4644. /// <param name="userCode"></param>
  4645. /// <param name="userPassword"></param>
  4646. /// <param name="sessionKey"></param>
  4647. /// <param name="se"></param>
  4648. /// <returns></returns>
  4649. public ActionResult GetPDARPT000001Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4650. string workcode, string datebegin, string dateend)
  4651. {
  4652. ActionResult actionResult = new ActionResult();
  4653. try
  4654. {
  4655. // 验证请求头信息
  4656. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4657. // 验证失败
  4658. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4659. {
  4660. return actionResult;
  4661. }
  4662. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4663. DateTime datetimeend = Convert.ToDateTime(dateend);
  4664. datetimebegin = datetimebegin.Date;
  4665. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4666. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4667. () => PDAModuleLogic.GetPDARPT000001Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4668. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4669. {
  4670. actionResult.Status = (int)Constant.PDAResult.Fail;
  4671. actionResult.Message = Messages.MSG_CMN_I002;
  4672. }
  4673. else
  4674. {
  4675. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4676. actionResult.Status = (int)Constant.PDAResult.Success;
  4677. }
  4678. }
  4679. catch (Exception ex)
  4680. {
  4681. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4682. OutputLog.TraceLog(LogPriority.Error,
  4683. this.ToString(),
  4684. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4685. ex.ToString(),
  4686. LocalPath.LogExePath);
  4687. actionResult.Status = (int)Constant.PDAResult.Exception;
  4688. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4689. }
  4690. return actionResult;
  4691. }
  4692. /// <summary>
  4693. /// 工号质量统计表
  4694. /// </summary>
  4695. /// <param name="accountCode"></param>
  4696. /// <param name="userCode"></param>
  4697. /// <param name="userPassword"></param>
  4698. /// <param name="sessionKey"></param>
  4699. /// <param name="se"></param>
  4700. /// <returns></returns>
  4701. public ActionResult GetPDARPT000002Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4702. int rptSProcedureID, string workcode, string datebegin, string dateend)
  4703. {
  4704. ActionResult actionResult = new ActionResult();
  4705. try
  4706. {
  4707. // 验证请求头信息
  4708. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4709. // 验证失败
  4710. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4711. {
  4712. return actionResult;
  4713. }
  4714. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4715. DateTime datetimeend = Convert.ToDateTime(dateend);
  4716. datetimebegin = datetimebegin.Date;
  4717. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4718. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4719. () => PDAModuleLogic.GetPDARPT000002Data(sUserInfo, rptSProcedureID, workcode, datetimebegin, datetimeend));
  4720. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4721. {
  4722. actionResult.Status = (int)Constant.PDAResult.Fail;
  4723. actionResult.Message = Messages.MSG_CMN_I002;
  4724. }
  4725. else
  4726. {
  4727. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4728. actionResult.Status = (int)Constant.PDAResult.Success;
  4729. }
  4730. }
  4731. catch (Exception ex)
  4732. {
  4733. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4734. OutputLog.TraceLog(LogPriority.Error,
  4735. this.ToString(),
  4736. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4737. ex.ToString(),
  4738. LocalPath.LogExePath);
  4739. actionResult.Status = (int)Constant.PDAResult.Exception;
  4740. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4741. }
  4742. return actionResult;
  4743. }
  4744. /// <summary>
  4745. /// 损坯数据统计表
  4746. /// </summary>
  4747. /// <param name="accountCode"></param>
  4748. /// <param name="userCode"></param>
  4749. /// <param name="userPassword"></param>
  4750. /// <param name="sessionKey"></param>
  4751. /// <param name="se"></param>
  4752. /// <returns></returns>
  4753. public ActionResult GetPDARPT000003Data(string accountCode, string userCode, string userPassword, string sessionKey,
  4754. string workcode, string datebegin, string dateend)
  4755. {
  4756. ActionResult actionResult = new ActionResult();
  4757. try
  4758. {
  4759. // 验证请求头信息
  4760. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4761. // 验证失败
  4762. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4763. {
  4764. return actionResult;
  4765. }
  4766. DateTime datetimebegin = Convert.ToDateTime(datebegin);
  4767. DateTime datetimeend = Convert.ToDateTime(dateend);
  4768. datetimebegin = datetimebegin.Date;
  4769. datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1);
  4770. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4771. () => PDAModuleLogic.GetPDARPT000003Data(sUserInfo, workcode, datetimebegin, datetimeend));
  4772. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4773. {
  4774. actionResult.Status = (int)Constant.PDAResult.Fail;
  4775. actionResult.Message = Messages.MSG_CMN_I002;
  4776. }
  4777. else
  4778. {
  4779. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4780. actionResult.Status = (int)Constant.PDAResult.Success;
  4781. }
  4782. }
  4783. catch (Exception ex)
  4784. {
  4785. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4786. OutputLog.TraceLog(LogPriority.Error,
  4787. this.ToString(),
  4788. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4789. ex.ToString(),
  4790. LocalPath.LogExePath);
  4791. actionResult.Status = (int)Constant.PDAResult.Exception;
  4792. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4793. }
  4794. return actionResult;
  4795. }
  4796. #endregion
  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. /// <returns></returns>
  4805. public ActionResult GetRptProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey)
  4806. {
  4807. ActionResult actionResult = new ActionResult();
  4808. try
  4809. {
  4810. // 验证请求头信息
  4811. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4812. // 验证失败
  4813. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4814. {
  4815. return actionResult;
  4816. }
  4817. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4818. () => ReportModuleLogic.GetRptProcedureModule(sUserInfo));
  4819. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4820. {
  4821. actionResult.Status = (int)Constant.PDAResult.Fail;
  4822. actionResult.Message = Messages.MSG_CMN_I002;
  4823. }
  4824. else
  4825. {
  4826. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4827. actionResult.Status = (int)Constant.PDAResult.Success;
  4828. }
  4829. }
  4830. catch (Exception ex)
  4831. {
  4832. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4833. OutputLog.TraceLog(LogPriority.Error,
  4834. this.ToString(),
  4835. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4836. ex.ToString(),
  4837. LocalPath.LogExePath);
  4838. actionResult.Status = (int)Constant.PDAResult.Exception;
  4839. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4840. }
  4841. return actionResult;
  4842. }
  4843. /// <summary>
  4844. /// 取得报表的查询数据源统计工序数据
  4845. /// </summary>
  4846. /// <param name="accountCode"></param>
  4847. /// <param name="userCode"></param>
  4848. /// <param name="userPassword"></param>
  4849. /// <param name="sessionKey"></param>
  4850. /// <param name="RptProcedureID"></param>
  4851. /// <returns></returns>
  4852. public ActionResult GetRptSourceProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey, int? RptProcedureID)
  4853. {
  4854. ActionResult actionResult = new ActionResult();
  4855. try
  4856. {
  4857. // 验证请求头信息
  4858. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4859. // 验证失败
  4860. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4861. {
  4862. return actionResult;
  4863. }
  4864. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  4865. () => ReportModuleLogic.GetRptSourceProcedureModule(sUserInfo, RptProcedureID));
  4866. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  4867. {
  4868. actionResult.Status = (int)Constant.PDAResult.Fail;
  4869. actionResult.Message = Messages.MSG_CMN_I002;
  4870. }
  4871. else
  4872. {
  4873. actionResult.Result = JsonHelper.ToJson(sre.Data);
  4874. actionResult.Status = (int)Constant.PDAResult.Success;
  4875. }
  4876. }
  4877. catch (Exception ex)
  4878. {
  4879. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4880. OutputLog.TraceLog(LogPriority.Error,
  4881. this.ToString(),
  4882. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4883. ex.ToString(),
  4884. LocalPath.LogExePath);
  4885. actionResult.Status = (int)Constant.PDAResult.Exception;
  4886. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4887. }
  4888. return actionResult;
  4889. }
  4890. /// <summary>
  4891. /// 获取用户是否有统计产成品权限
  4892. /// </summary>
  4893. /// <param name="accountCode"></param>
  4894. /// <param name="userCode"></param>
  4895. /// <param name="userPassword"></param>
  4896. /// <param name="sessionKey"></param>
  4897. /// <returns></returns>
  4898. public ActionResult GetStatisticsFinishedProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4899. {
  4900. ActionResult actionResult = new ActionResult();
  4901. try
  4902. {
  4903. // 验证请求头信息
  4904. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4905. // 验证失败
  4906. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4907. {
  4908. return actionResult;
  4909. }
  4910. int returnValue = ServiceInvoker.Invoke<int>(this,
  4911. () => PDAModuleLogic.GetStatisticsFinishedProductFuntion(sUserInfo));
  4912. actionResult.Result = JsonHelper.ToJson(returnValue);
  4913. actionResult.Status = (int)Constant.PDAResult.Success;
  4914. }
  4915. catch (Exception ex)
  4916. {
  4917. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4918. OutputLog.TraceLog(LogPriority.Error,
  4919. this.ToString(),
  4920. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4921. ex.ToString(),
  4922. LocalPath.LogExePath);
  4923. actionResult.Status = (int)Constant.PDAResult.Exception;
  4924. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4925. }
  4926. return actionResult;
  4927. }
  4928. /// <summary>
  4929. /// 获取用户是否有盘点权限
  4930. /// </summary>
  4931. /// <param name="accountCode"></param>
  4932. /// <param name="userCode"></param>
  4933. /// <param name="userPassword"></param>
  4934. /// <param name="sessionKey"></param>
  4935. /// <returns></returns>
  4936. public ActionResult GetInCheckedFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  4937. {
  4938. ActionResult actionResult = new ActionResult();
  4939. try
  4940. {
  4941. // 验证请求头信息
  4942. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4943. // 验证失败
  4944. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4945. {
  4946. return actionResult;
  4947. }
  4948. int returnValue = ServiceInvoker.Invoke<int>(this,
  4949. () => PDAModuleLogic.GetInCheckedFuntion(sUserInfo));
  4950. actionResult.Result = JsonHelper.ToJson(returnValue);
  4951. actionResult.Status = (int)Constant.PDAResult.Success;
  4952. }
  4953. catch (Exception ex)
  4954. {
  4955. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4956. OutputLog.TraceLog(LogPriority.Error,
  4957. this.ToString(),
  4958. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4959. ex.ToString(),
  4960. LocalPath.LogExePath);
  4961. actionResult.Status = (int)Constant.PDAResult.Exception;
  4962. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  4963. }
  4964. return actionResult;
  4965. }
  4966. /// <summary>
  4967. /// 根据条件查询是否存在班次配置
  4968. /// </summary>
  4969. /// <param name="accountCode"></param>
  4970. /// <param name="userCode"></param>
  4971. /// <param name="userPassword"></param>
  4972. /// <param name="sessionKey"></param>
  4973. /// <param name="userCode">工号编码</param>
  4974. /// <returns></returns>
  4975. public ActionResult GetClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, string uCode)
  4976. {
  4977. ActionResult actionResult = new ActionResult();
  4978. try
  4979. {
  4980. // 验证请求头信息
  4981. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  4982. // 验证失败
  4983. if (actionResult.Status != (int)Constant.PDAResult.Success)
  4984. {
  4985. return actionResult;
  4986. }
  4987. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  4988. () => PDAModuleLogic.GetClassesSetting(uCode, sUserInfo));
  4989. actionResult.Result = JsonHelper.ToJson(ds);
  4990. actionResult.Status = (int)Constant.PDAResult.Success;
  4991. }
  4992. catch (Exception ex)
  4993. {
  4994. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  4995. OutputLog.TraceLog(LogPriority.Error,
  4996. this.ToString(),
  4997. System.Reflection.MethodBase.GetCurrentMethod().Name,
  4998. ex.ToString(),
  4999. LocalPath.LogExePath);
  5000. actionResult.Status = (int)Constant.PDAResult.Exception;
  5001. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5002. }
  5003. return actionResult;
  5004. }
  5005. /// <summary>
  5006. /// 报损工序查出工号根据生产数据ID
  5007. /// </summary>
  5008. /// <param name="accountCode"></param>
  5009. /// <param name="userCode"></param>
  5010. /// <param name="userPassword"></param>
  5011. /// <param name="sessionKey"></param>
  5012. /// <param name="ProductionDataID">生产数据ID</param>
  5013. /// <returns></returns>
  5014. public ActionResult GetScrapProductUserCodeByProductionDataID(string accountCode, string userCode, string userPassword, string sessionKey, int ProductionDataID)
  5015. {
  5016. ActionResult actionResult = new ActionResult();
  5017. try
  5018. {
  5019. // 验证请求头信息
  5020. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5021. // 验证失败
  5022. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5023. {
  5024. return actionResult;
  5025. }
  5026. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5027. () => PMModuleLogic.GetScrapProductUserCodeByProductionDataID(ProductionDataID));
  5028. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5029. {
  5030. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5031. actionResult.Status = (int)Constant.PDAResult.Success;
  5032. }
  5033. else
  5034. {
  5035. actionResult.Status = (int)Constant.PDAResult.Fail;
  5036. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5037. }
  5038. }
  5039. catch (Exception ex)
  5040. {
  5041. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5042. OutputLog.TraceLog(LogPriority.Error,
  5043. this.ToString(),
  5044. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5045. ex.ToString(),
  5046. LocalPath.LogExePath);
  5047. actionResult.Status = (int)Constant.PDAResult.Exception;
  5048. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5049. }
  5050. return actionResult;
  5051. }
  5052. /// <summary>
  5053. /// 在入窑工序检验窑车号是否存在
  5054. /// </summary>
  5055. /// <param name="accountCode"></param>
  5056. /// <param name="userCode"></param>
  5057. /// <param name="userPassword"></param>
  5058. /// <param name="sessionKey"></param>
  5059. /// <param name="kilncarcode">窑车编码</param>
  5060. /// <param name="procedureid">工序ID</param>
  5061. /// <returns></returns>
  5062. public ActionResult CheckKilnCarByIntoCar2(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid)
  5063. {
  5064. ActionResult actionResult = new ActionResult();
  5065. try
  5066. {
  5067. // 验证请求头信息
  5068. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5069. // 验证失败
  5070. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5071. {
  5072. return actionResult;
  5073. }
  5074. int returnValue = ServiceInvoker.Invoke<int>(this,
  5075. () => PMModuleLogicDAL.CheckKilnCarByIntoCar2(kilncarcode, procedureid, sUserInfo));
  5076. if (returnValue == 1)
  5077. {
  5078. actionResult.Result = JsonHelper.ToJson(returnValue);
  5079. actionResult.Status = (int)Constant.PDAResult.Success;
  5080. }
  5081. else
  5082. {
  5083. actionResult.Status = (int)Constant.PDAResult.Fail;
  5084. if (returnValue == -99)
  5085. actionResult.Message = "窑炉车号无效";
  5086. else if (returnValue == -98)
  5087. actionResult.Message = "窑车己无产品";
  5088. else if (returnValue == -97)
  5089. actionResult.Message = "窑车没有入窑,不可以撤销";
  5090. else if (returnValue == -1)
  5091. actionResult.Message = "保存失败";
  5092. }
  5093. }
  5094. catch (Exception ex)
  5095. {
  5096. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5097. OutputLog.TraceLog(LogPriority.Error,
  5098. this.ToString(),
  5099. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5100. ex.ToString(),
  5101. LocalPath.LogExePath);
  5102. actionResult.Status = (int)Constant.PDAResult.Exception;
  5103. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5104. }
  5105. return actionResult;
  5106. }
  5107. /// <summary>
  5108. /// 撤销包装
  5109. /// </summary>
  5110. /// <param name="accountCode"></param>
  5111. /// <param name="userCode"></param>
  5112. /// <param name="userPassword"></param>
  5113. /// <param name="sessionKey"></param>
  5114. /// <param name="barcode"></param>
  5115. /// <returns></returns>
  5116. public ActionResult AddChancelFinishedproduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5117. {
  5118. ActionResult actionResult = new ActionResult();
  5119. try
  5120. {
  5121. // 验证请求头信息
  5122. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5123. // 验证失败
  5124. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5125. {
  5126. return actionResult;
  5127. }
  5128. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5129. () => PMModuleLogicDAL.AddChancelFinishedproduct(barcode, sUserInfo));
  5130. if (Convert.ToInt32(returnValue.Result) > 0)
  5131. {
  5132. actionResult.Result = JsonHelper.ToJson(returnValue);
  5133. actionResult.Status = (int)Constant.PDAResult.Success;
  5134. }
  5135. else
  5136. {
  5137. actionResult.Status = (int)Constant.PDAResult.Fail;
  5138. if (Convert.ToInt32(returnValue.Result) == -1)
  5139. actionResult.Message = "产品条码不存在包装记录";
  5140. else if (Convert.ToInt32(returnValue.Result) == -200)
  5141. actionResult.Message = returnValue.Message;
  5142. else
  5143. actionResult.Message = "成品撤销失败";
  5144. }
  5145. }
  5146. catch (Exception ex)
  5147. {
  5148. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5149. OutputLog.TraceLog(LogPriority.Error,
  5150. this.ToString(),
  5151. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5152. ex.ToString(),
  5153. LocalPath.LogExePath);
  5154. actionResult.Status = (int)Constant.PDAResult.Exception;
  5155. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5156. }
  5157. return actionResult;
  5158. }
  5159. /*
  5160. /// <summary>
  5161. /// 获取用户是否有撤销包装权限
  5162. /// </summary>
  5163. /// <param name="accountCode"></param>
  5164. /// <param name="userCode"></param>
  5165. /// <param name="userPassword"></param>
  5166. /// <param name="sessionKey"></param>
  5167. /// <returns></returns>
  5168. public ActionResult GetChancelFinishedproductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5169. {
  5170. ActionResult actionResult = new ActionResult();
  5171. try
  5172. {
  5173. // 验证请求头信息
  5174. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5175. // 验证失败
  5176. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5177. {
  5178. return actionResult;
  5179. }
  5180. int returnValue = ServiceInvoker.Invoke<int>(this,
  5181. () => PDAModuleLogic.GetChancelFinishedproductFuntion(sUserInfo));
  5182. actionResult.Result = JsonHelper.ToJson(returnValue);
  5183. actionResult.Status = (int)Constant.PDAResult.Success;
  5184. }
  5185. catch (Exception ex)
  5186. {
  5187. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5188. OutputLog.TraceLog(LogPriority.Error,
  5189. this.ToString(),
  5190. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5191. ex.ToString(),
  5192. LocalPath.LogExePath);
  5193. actionResult.Status = (int)Constant.PDAResult.Exception;
  5194. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5195. }
  5196. return actionResult;
  5197. }
  5198. */
  5199. /// <summary>
  5200. /// 窑车状态明细表查询
  5201. /// </summary>
  5202. /// <param name="accountCode"></param>
  5203. /// <param name="userCode"></param>
  5204. /// <param name="userPassword"></param>
  5205. /// <param name="sessionKey"></param>
  5206. /// <param name="kilnCarCode"></param>
  5207. /// <returns></returns>
  5208. public ActionResult GetKilnCarStatusDetailByCode(string accountCode, string userCode, string userPassword, string sessionKey, string kilnCarCode)
  5209. {
  5210. ActionResult actionResult = new ActionResult();
  5211. try
  5212. {
  5213. // 验证请求头信息
  5214. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5215. // 验证失败
  5216. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5217. {
  5218. return actionResult;
  5219. }
  5220. ServiceResultEntity sre = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5221. () => ReportModuleLogic.GetKilnCarStatusDetailByCode(kilnCarCode, sUserInfo));
  5222. if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  5223. {
  5224. actionResult.Status = (int)Constant.PDAResult.Fail;
  5225. actionResult.Message = Messages.MSG_CMN_I002;
  5226. }
  5227. else
  5228. {
  5229. actionResult.Result = JsonHelper.ToJson(sre.Data);
  5230. actionResult.Status = (int)Constant.PDAResult.Success;
  5231. }
  5232. }
  5233. catch (Exception ex)
  5234. {
  5235. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5236. OutputLog.TraceLog(LogPriority.Error,
  5237. this.ToString(),
  5238. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5239. ex.ToString(),
  5240. LocalPath.LogExePath);
  5241. actionResult.Status = (int)Constant.PDAResult.Exception;
  5242. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5243. }
  5244. return actionResult;
  5245. }
  5246. /// <summary>
  5247. /// 损坯撤销
  5248. /// </summary>
  5249. /// <param name="accountCode"></param>
  5250. /// <param name="userCode"></param>
  5251. /// <param name="userPassword"></param>
  5252. /// <param name="sessionKey"></param>
  5253. /// <param name="barcode"></param>
  5254. /// <returns></returns>
  5255. public ActionResult AddCancelScrapProduction(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5256. {
  5257. ActionResult actionResult = new ActionResult();
  5258. try
  5259. {
  5260. // 验证请求头信息
  5261. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5262. // 验证失败
  5263. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5264. {
  5265. return actionResult;
  5266. }
  5267. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5268. () => PMModuleLogicDAL.AddCancelScrapProduction(barcode, sUserInfo));
  5269. if (Convert.ToInt32(returnValue.Result) > 0)
  5270. {
  5271. actionResult.Result = JsonHelper.ToJson(returnValue);
  5272. actionResult.Status = (int)Constant.PDAResult.Success;
  5273. }
  5274. else
  5275. {
  5276. actionResult.Status = (int)Constant.PDAResult.Fail;
  5277. if (Convert.ToInt32(returnValue.Result) == -1)
  5278. actionResult.Message = "此产品没有损坯,不能撤销";
  5279. else if (Convert.ToInt32(returnValue.Result) == -200)
  5280. actionResult.Message = returnValue.Message;
  5281. else
  5282. actionResult.Message = "损坯撤销失败";
  5283. }
  5284. }
  5285. catch (Exception ex)
  5286. {
  5287. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5288. OutputLog.TraceLog(LogPriority.Error,
  5289. this.ToString(),
  5290. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5291. ex.ToString(),
  5292. LocalPath.LogExePath);
  5293. actionResult.Status = (int)Constant.PDAResult.Exception;
  5294. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5295. }
  5296. return actionResult;
  5297. }
  5298. /*
  5299. /// <summary>
  5300. /// 获取用户是否有损坯撤销权限
  5301. /// </summary>
  5302. /// <param name="accountCode"></param>
  5303. /// <param name="userCode"></param>
  5304. /// <param name="userPassword"></param>
  5305. /// <param name="sessionKey"></param>
  5306. /// <returns></returns>
  5307. public ActionResult GetCancelScrapProductionFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5308. {
  5309. ActionResult actionResult = new ActionResult();
  5310. try
  5311. {
  5312. // 验证请求头信息
  5313. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5314. // 验证失败
  5315. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5316. {
  5317. return actionResult;
  5318. }
  5319. int returnValue = ServiceInvoker.Invoke<int>(this,
  5320. () => PDAModuleLogic.GetCancelScrapProductionFuntion(sUserInfo));
  5321. actionResult.Result = JsonHelper.ToJson(returnValue);
  5322. actionResult.Status = (int)Constant.PDAResult.Success;
  5323. }
  5324. catch (Exception ex)
  5325. {
  5326. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5327. OutputLog.TraceLog(LogPriority.Error,
  5328. this.ToString(),
  5329. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5330. ex.ToString(),
  5331. LocalPath.LogExePath);
  5332. actionResult.Status = (int)Constant.PDAResult.Exception;
  5333. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5334. }
  5335. return actionResult;
  5336. }
  5337. */
  5338. /// <summary>
  5339. /// 获取条码注浆信息
  5340. /// </summary>
  5341. /// <param name="accountCode"></param>
  5342. /// <param name="userCode"></param>
  5343. /// <param name="userPassword"></param>
  5344. /// <param name="sessionKey"></param>
  5345. /// <returns></returns>
  5346. public ActionResult GetGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5347. {
  5348. ActionResult actionResult = new ActionResult();
  5349. try
  5350. {
  5351. // 验证请求头信息
  5352. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5353. // 验证失败
  5354. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5355. {
  5356. return actionResult;
  5357. }
  5358. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5359. () => PMModuleLogic.GetGroutingInfoBybarcode(barcode, sUserInfo));
  5360. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5361. {
  5362. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5363. actionResult.Status = (int)Constant.PDAResult.Success;
  5364. }
  5365. else
  5366. {
  5367. actionResult.Status = (int)Constant.PDAResult.Fail;
  5368. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5369. }
  5370. }
  5371. catch (Exception ex)
  5372. {
  5373. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5374. OutputLog.TraceLog(LogPriority.Error,
  5375. this.ToString(),
  5376. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5377. ex.ToString(),
  5378. LocalPath.LogExePath);
  5379. actionResult.Status = (int)Constant.PDAResult.Exception;
  5380. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5381. }
  5382. return actionResult;
  5383. }
  5384. /// <summary>
  5385. /// 获取条码注浆信息
  5386. /// </summary>
  5387. /// <param name="accountCode"></param>
  5388. /// <param name="userCode"></param>
  5389. /// <param name="userPassword"></param>
  5390. /// <param name="sessionKey"></param>
  5391. /// <returns></returns>
  5392. public ActionResult GetFinishedProductGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5393. {
  5394. ActionResult actionResult = new ActionResult();
  5395. try
  5396. {
  5397. // 验证请求头信息
  5398. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5399. // 验证失败
  5400. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5401. {
  5402. return actionResult;
  5403. }
  5404. DataSet dutyProcedureDs = ServiceInvoker.Invoke<DataSet>(this,
  5405. () => PMModuleLogic.GetFinishedProductGroutingInfoBybarcode(barcode, sUserInfo));
  5406. if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO)
  5407. {
  5408. actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]);
  5409. actionResult.Status = (int)Constant.PDAResult.Success;
  5410. }
  5411. else
  5412. {
  5413. actionResult.Status = (int)Constant.PDAResult.Fail;
  5414. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5415. }
  5416. }
  5417. catch (Exception ex)
  5418. {
  5419. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5420. OutputLog.TraceLog(LogPriority.Error,
  5421. this.ToString(),
  5422. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5423. ex.ToString(),
  5424. LocalPath.LogExePath);
  5425. actionResult.Status = (int)Constant.PDAResult.Exception;
  5426. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5427. }
  5428. return actionResult;
  5429. }
  5430. /// <summary>
  5431. /// 公坯设定
  5432. /// </summary>
  5433. /// <param name="accountCode"></param>
  5434. /// <param name="userCode"></param>
  5435. /// <param name="userPassword"></param>
  5436. /// <param name="sessionKey"></param>
  5437. /// <param name="barcode"></param>
  5438. /// <returns></returns>
  5439. public ActionResult AddPublicBodyProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5440. {
  5441. ActionResult actionResult = new ActionResult();
  5442. try
  5443. {
  5444. // 验证请求头信息
  5445. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5446. // 验证失败
  5447. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5448. {
  5449. return actionResult;
  5450. }
  5451. int returnValue = ServiceInvoker.Invoke<int>(this,
  5452. () => PMModuleLogicDAL.AddPublicBodyProduct(barcode, sUserInfo));
  5453. if (returnValue > 0)
  5454. {
  5455. actionResult.Result = JsonHelper.ToJson(returnValue);
  5456. actionResult.Status = (int)Constant.PDAResult.Success;
  5457. }
  5458. else
  5459. {
  5460. actionResult.Status = (int)Constant.PDAResult.Fail;
  5461. if (returnValue == -1)
  5462. actionResult.Message = "此产品不在生产线上";
  5463. else if (returnValue == -2)
  5464. actionResult.Message = "该产品已经标识为公坯";
  5465. else
  5466. actionResult.Message = "公坯设定失败";
  5467. }
  5468. }
  5469. catch (Exception ex)
  5470. {
  5471. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5472. OutputLog.TraceLog(LogPriority.Error,
  5473. this.ToString(),
  5474. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5475. ex.ToString(),
  5476. LocalPath.LogExePath);
  5477. actionResult.Status = (int)Constant.PDAResult.Exception;
  5478. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5479. }
  5480. return actionResult;
  5481. }
  5482. /*
  5483. /// <summary>
  5484. /// 获取用户是否有公坯设定
  5485. /// </summary>
  5486. /// <param name="accountCode"></param>
  5487. /// <param name="userCode"></param>
  5488. /// <param name="userPassword"></param>
  5489. /// <param name="sessionKey"></param>
  5490. /// <returns></returns>
  5491. public ActionResult GetPublicBodyProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  5492. {
  5493. ActionResult actionResult = new ActionResult();
  5494. try
  5495. {
  5496. // 验证请求头信息
  5497. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5498. // 验证失败
  5499. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5500. {
  5501. return actionResult;
  5502. }
  5503. int returnValue = ServiceInvoker.Invoke<int>(this,
  5504. () => PDAModuleLogic.GetPublicBodyProductFuntion(sUserInfo));
  5505. actionResult.Result = JsonHelper.ToJson(returnValue);
  5506. actionResult.Status = (int)Constant.PDAResult.Success;
  5507. }
  5508. catch (Exception ex)
  5509. {
  5510. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5511. OutputLog.TraceLog(LogPriority.Error,
  5512. this.ToString(),
  5513. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5514. ex.ToString(),
  5515. LocalPath.LogExePath);
  5516. actionResult.Status = (int)Constant.PDAResult.Exception;
  5517. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5518. }
  5519. return actionResult;
  5520. }
  5521. */
  5522. /// <summary>
  5523. /// 校验产品条码是否可以走到该工序
  5524. /// </summary>
  5525. /// <param name="accountCode">帐套code</param>
  5526. /// <param name="userCode">用户code</param>
  5527. /// <param name="userPassword">用户密码</param>
  5528. /// <param name="sessionKey">本次登陆密钥</param>
  5529. /// <param name="procedureID">工序ID</param>
  5530. /// <param name="barcode">条码</param>
  5531. /// <returns></returns>
  5532. /// <remarks>
  5533. /// 陈冰 2014.09.18 新建
  5534. /// </remarks>
  5535. public ActionResult CheckBarcodeDeliverMud(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  5536. {
  5537. ActionResult actionResult = new ActionResult();
  5538. try
  5539. {
  5540. // 验证请求头信息
  5541. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5542. // 验证失败
  5543. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5544. {
  5545. return actionResult;
  5546. }
  5547. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  5548. () => PMModuleLogic.CheckBarcodeDeliverMud(procedureID, barcode, sUserInfo));
  5549. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  5550. {
  5551. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  5552. actionResult.Status = (int)Constant.PDAResult.Success;
  5553. }
  5554. else
  5555. {
  5556. actionResult.Status = (int)Constant.PDAResult.Fail;
  5557. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  5558. }
  5559. }
  5560. catch (Exception ex)
  5561. {
  5562. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5563. OutputLog.TraceLog(LogPriority.Error,
  5564. this.ToString(),
  5565. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5566. ex.ToString(),
  5567. LocalPath.LogExePath);
  5568. actionResult.Status = (int)Constant.PDAResult.Exception;
  5569. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5570. }
  5571. return actionResult;
  5572. }
  5573. /// <summary>
  5574. /// 获取用户所有菜单权限
  5575. /// </summary>
  5576. /// <param name="accountCode"></param>
  5577. /// <param name="userCode"></param>
  5578. /// <param name="userPassword"></param>
  5579. /// <param name="sessionKey"></param>
  5580. /// <returns></returns>
  5581. public ActionResult GetUserAllFunction(string accountCode, string userCode, string userPassword, string sessionKey)
  5582. {
  5583. ActionResult actionResult = new ActionResult();
  5584. try
  5585. {
  5586. // 验证请求头信息
  5587. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5588. // 验证失败
  5589. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5590. {
  5591. return actionResult;
  5592. }
  5593. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5594. () => PDAModuleLogic.GetUserAllFunction(sUserInfo));
  5595. actionResult.Result = JsonHelper.ToJson(returnValue);
  5596. actionResult.Status = (int)Constant.PDAResult.Success;
  5597. }
  5598. catch (Exception ex)
  5599. {
  5600. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5601. OutputLog.TraceLog(LogPriority.Error,
  5602. this.ToString(),
  5603. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5604. ex.ToString(),
  5605. LocalPath.LogExePath);
  5606. actionResult.Status = (int)Constant.PDAResult.Exception;
  5607. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5608. }
  5609. return actionResult;
  5610. }
  5611. public ActionResult AddChancelBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5612. {
  5613. ActionResult actionResult = new ActionResult();
  5614. try
  5615. {
  5616. // 验证请求头信息
  5617. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5618. // 验证失败
  5619. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5620. {
  5621. return actionResult;
  5622. }
  5623. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5624. () => PMModuleLogicDAL.AddChancelBarCode(barcode, sUserInfo));
  5625. if (Convert.ToInt32(returnValue.Result) > 0)
  5626. {
  5627. actionResult.Result = JsonHelper.ToJson(returnValue);
  5628. actionResult.Status = (int)Constant.PDAResult.Success;
  5629. }
  5630. else
  5631. {
  5632. actionResult.Status = (int)Constant.PDAResult.Fail;
  5633. if (Convert.ToInt32(returnValue.Result) == -1)
  5634. actionResult.Message = "无效条码";
  5635. else if (Convert.ToInt32(returnValue.Result) == -2)
  5636. actionResult.Message = "已经生产完成";
  5637. else if (Convert.ToInt32(returnValue.Result) == -3)
  5638. actionResult.Message = "条码已经申请报废";
  5639. else if (Convert.ToInt32(returnValue.Result) == -4)
  5640. actionResult.Message = "此条码当前工序不允许进行撤销";
  5641. else if (Convert.ToInt32(returnValue.Result) == -5)
  5642. actionResult.Message = "此条码没有生产数据";
  5643. else if (Convert.ToInt32(returnValue.Result) == -6)
  5644. actionResult.Message = "没有当前工序权限";
  5645. else if (Convert.ToInt32(returnValue.Result) == -7)
  5646. actionResult.Message = "条码不在生产线上";
  5647. else if (Convert.ToInt32(returnValue.Result) == -8)
  5648. actionResult.Message = "操作用户无此工序的撤销范围权限";
  5649. else if (Convert.ToInt32(returnValue.Result) == -9)
  5650. actionResult.Message = "条码已经是返工状态";
  5651. else if (Convert.ToInt32(returnValue.Result) == -200)
  5652. actionResult.Message = returnValue.Message;
  5653. }
  5654. }
  5655. catch (Exception ex)
  5656. {
  5657. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5658. OutputLog.TraceLog(LogPriority.Error,
  5659. this.ToString(),
  5660. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5661. ex.ToString(),
  5662. LocalPath.LogExePath);
  5663. actionResult.Status = (int)Constant.PDAResult.Exception;
  5664. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5665. }
  5666. return actionResult;
  5667. }
  5668. public ActionResult AddChancelDeliverMudBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5669. {
  5670. ActionResult actionResult = new ActionResult();
  5671. try
  5672. {
  5673. // 验证请求头信息
  5674. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5675. // 验证失败
  5676. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5677. {
  5678. return actionResult;
  5679. }
  5680. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  5681. () => PMModuleLogicDAL.AddChancelDeliverMudBarCode(barcode, sUserInfo));
  5682. if (Convert.ToInt32(returnValue.Result) > 0)
  5683. {
  5684. actionResult.Result = JsonHelper.ToJson(returnValue);
  5685. actionResult.Status = (int)Constant.PDAResult.Success;
  5686. }
  5687. else
  5688. {
  5689. actionResult.Status = (int)Constant.PDAResult.Fail;
  5690. if (Convert.ToInt32(returnValue.Result) == -1)
  5691. actionResult.Message = "无效条码";
  5692. else if (Convert.ToInt32(returnValue.Result) == -2)
  5693. actionResult.Message = "已经生产完成";
  5694. else if (Convert.ToInt32(returnValue.Result) == -3)
  5695. actionResult.Message = "条码已经申请报废";
  5696. else if (Convert.ToInt32(returnValue.Result) == -4)
  5697. actionResult.Message = "此条码当前工序不允许进行撤销";
  5698. else if (Convert.ToInt32(returnValue.Result) == -5)
  5699. actionResult.Message = "此条码没有生产数据";
  5700. else if (Convert.ToInt32(returnValue.Result) == -55)
  5701. actionResult.Message = "条码已经不在交坯工序,不允许撤销";
  5702. else if (Convert.ToInt32(returnValue.Result) == -6)
  5703. actionResult.Message = "没有任何影响行";
  5704. else if (Convert.ToInt32(returnValue.Result) == -7)
  5705. actionResult.Message = "条码不在生产线上";
  5706. else if (Convert.ToInt32(returnValue.Result) == -8)
  5707. actionResult.Message = "条码已经是返工状态";
  5708. else if (Convert.ToInt32(returnValue.Result) == -200)
  5709. actionResult.Message = returnValue.Message;
  5710. }
  5711. }
  5712. catch (Exception ex)
  5713. {
  5714. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5715. OutputLog.TraceLog(LogPriority.Error,
  5716. this.ToString(),
  5717. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5718. ex.ToString(),
  5719. LocalPath.LogExePath);
  5720. actionResult.Status = (int)Constant.PDAResult.Exception;
  5721. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5722. }
  5723. return actionResult;
  5724. }
  5725. public ActionResult GetAllLogoInfo(string accountCode, string userCode, string userPassword, string sessionKey)
  5726. {
  5727. ActionResult actionResult = new ActionResult();
  5728. try
  5729. {
  5730. // 验证请求头信息
  5731. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5732. // 验证失败
  5733. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5734. {
  5735. return actionResult;
  5736. }
  5737. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5738. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5739. () => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5740. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5741. {
  5742. //DataView dv = returnValue.Tables[0].DefaultView;
  5743. //dv.RowFilter = "ValueFlag=1";
  5744. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5745. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5746. actionResult.Status = (int)Constant.PDAResult.Success;
  5747. }
  5748. }
  5749. catch (Exception ex)
  5750. {
  5751. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5752. OutputLog.TraceLog(LogPriority.Error,
  5753. this.ToString(),
  5754. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5755. ex.ToString(),
  5756. LocalPath.LogExePath);
  5757. actionResult.Status = (int)Constant.PDAResult.Exception;
  5758. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5759. }
  5760. return actionResult;
  5761. }
  5762. /// <summary>
  5763. /// 变更产品商标用
  5764. /// </summary>
  5765. /// <param name="accountCode"></param>
  5766. /// <param name="userCode"></param>
  5767. /// <param name="userPassword"></param>
  5768. /// <param name="sessionKey"></param>
  5769. /// <param name="goodsid"></param>
  5770. /// <returns></returns>
  5771. public ActionResult GetLogoInfoForChange(string accountCode, string userCode, string userPassword, string sessionKey
  5772. , int goodsid)
  5773. {
  5774. ActionResult actionResult = new ActionResult();
  5775. try
  5776. {
  5777. // 验证请求头信息
  5778. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5779. // 验证失败
  5780. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5781. {
  5782. return actionResult;
  5783. }
  5784. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5785. //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo));
  5786. //() => SystemModuleLogic.GetLogoInfo(sUserInfo));
  5787. () => SystemModuleLogic.GetLogoInfoForChange(sUserInfo, goodsid));
  5788. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5789. {
  5790. //DataView dv = returnValue.Tables[0].DefaultView;
  5791. //dv.RowFilter = "ValueFlag=1";
  5792. //actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  5793. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5794. actionResult.Status = (int)Constant.PDAResult.Success;
  5795. }
  5796. }
  5797. catch (Exception ex)
  5798. {
  5799. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5800. OutputLog.TraceLog(LogPriority.Error,
  5801. this.ToString(),
  5802. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5803. ex.ToString(),
  5804. LocalPath.LogExePath);
  5805. actionResult.Status = (int)Constant.PDAResult.Exception;
  5806. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5807. }
  5808. return actionResult;
  5809. }
  5810. public ActionResult GetLogoID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID)
  5811. {
  5812. ActionResult actionResult = new ActionResult();
  5813. try
  5814. {
  5815. // 验证请求头信息
  5816. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5817. // 验证失败
  5818. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5819. {
  5820. return actionResult;
  5821. }
  5822. int returnValue = ServiceInvoker.Invoke<int>(this,
  5823. () => PMModuleLogic.GetLogoID(procedureID, sUserInfo));
  5824. actionResult.Result = JsonHelper.ToJson(returnValue);
  5825. actionResult.Status = (int)Constant.PDAResult.Success;
  5826. }
  5827. catch (Exception ex)
  5828. {
  5829. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5830. OutputLog.TraceLog(LogPriority.Error,
  5831. this.ToString(),
  5832. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5833. ex.ToString(),
  5834. LocalPath.LogExePath);
  5835. actionResult.Status = (int)Constant.PDAResult.Exception;
  5836. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5837. }
  5838. return actionResult;
  5839. }
  5840. public ActionResult SaveBarCodeLogo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int logoid)
  5841. {
  5842. ActionResult actionResult = new ActionResult();
  5843. try
  5844. {
  5845. // 验证请求头信息
  5846. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5847. // 验证失败
  5848. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5849. {
  5850. return actionResult;
  5851. }
  5852. int returnValue = ServiceInvoker.Invoke<int>(this,
  5853. () => PMModuleLogicDAL.SaveBarCodeLogo(barcode, logoid, sUserInfo));
  5854. actionResult.Result = JsonHelper.ToJson(returnValue);
  5855. actionResult.Status = (int)Constant.PDAResult.Success;
  5856. }
  5857. catch (Exception ex)
  5858. {
  5859. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5860. OutputLog.TraceLog(LogPriority.Error,
  5861. this.ToString(),
  5862. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5863. ex.ToString(),
  5864. LocalPath.LogExePath);
  5865. actionResult.Status = (int)Constant.PDAResult.Exception;
  5866. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5867. }
  5868. return actionResult;
  5869. }
  5870. public ActionResult SaveBarCodeLogoAndGlazetype(string accountCode, string userCode, string userPassword, string sessionKey,
  5871. string barcode, int logoid, int glazetypeid)
  5872. {
  5873. ActionResult actionResult = new ActionResult();
  5874. try
  5875. {
  5876. // 验证请求头信息
  5877. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5878. // 验证失败
  5879. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5880. {
  5881. return actionResult;
  5882. }
  5883. int returnValue = ServiceInvoker.Invoke<int>(this,
  5884. () => PMModuleLogicDAL.SaveBarCodeLogoAndGlazetype(barcode, logoid, glazetypeid, sUserInfo));
  5885. actionResult.Result = JsonHelper.ToJson(returnValue);
  5886. if (returnValue > 0)
  5887. {
  5888. actionResult.Status = (int)Constant.PDAResult.Success;
  5889. }
  5890. else
  5891. {
  5892. actionResult.Status = (int)Constant.PDAResult.Fail;
  5893. actionResult.Message = "条码不存在";
  5894. }
  5895. }
  5896. catch (Exception ex)
  5897. {
  5898. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5899. OutputLog.TraceLog(LogPriority.Error,
  5900. this.ToString(),
  5901. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5902. ex.ToString(),
  5903. LocalPath.LogExePath);
  5904. actionResult.Status = (int)Constant.PDAResult.Exception;
  5905. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5906. }
  5907. return actionResult;
  5908. }
  5909. public ActionResult SaveBarCodesLogoAndGlazetype(string accountCode, string userCode, string userPassword, string sessionKey,
  5910. string barcodes, int logoid, int glazetypeid, int procedureID)
  5911. {
  5912. ActionResult actionResult = new ActionResult();
  5913. try
  5914. {
  5915. // 验证请求头信息
  5916. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5917. // 验证失败
  5918. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5919. {
  5920. return actionResult;
  5921. }
  5922. int returnValue = ServiceInvoker.Invoke<int>(this,
  5923. () => PMModuleLogicDAL.SaveBarCodesLogoAndGlazetype(barcodes, logoid, glazetypeid, procedureID, sUserInfo));
  5924. actionResult.Result = JsonHelper.ToJson(returnValue);
  5925. if (returnValue > 0)
  5926. {
  5927. actionResult.Status = (int)Constant.PDAResult.Success;
  5928. }
  5929. else
  5930. {
  5931. actionResult.Status = (int)Constant.PDAResult.Fail;
  5932. actionResult.Message = "条码不存在";
  5933. }
  5934. }
  5935. catch (Exception ex)
  5936. {
  5937. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5938. OutputLog.TraceLog(LogPriority.Error,
  5939. this.ToString(),
  5940. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5941. ex.ToString(),
  5942. LocalPath.LogExePath);
  5943. actionResult.Status = (int)Constant.PDAResult.Exception;
  5944. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5945. }
  5946. return actionResult;
  5947. }
  5948. public ActionResult GetBarCodeLogoID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5949. {
  5950. ActionResult actionResult = new ActionResult();
  5951. try
  5952. {
  5953. // 验证请求头信息
  5954. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5955. // 验证失败
  5956. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5957. {
  5958. return actionResult;
  5959. }
  5960. DataSet returnValue = ServiceInvoker.Invoke<DataSet>(this,
  5961. () => PMModuleLogic.GetBarCodeLogoID(barcode, sUserInfo));
  5962. if (returnValue != null && returnValue.Tables[0].Rows.Count > 0)
  5963. {
  5964. actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]);
  5965. actionResult.Status = (int)Constant.PDAResult.Success;
  5966. }
  5967. }
  5968. catch (Exception ex)
  5969. {
  5970. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  5971. OutputLog.TraceLog(LogPriority.Error,
  5972. this.ToString(),
  5973. System.Reflection.MethodBase.GetCurrentMethod().Name,
  5974. ex.ToString(),
  5975. LocalPath.LogExePath);
  5976. actionResult.Status = (int)Constant.PDAResult.Exception;
  5977. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  5978. }
  5979. return actionResult;
  5980. }
  5981. /// <summary>
  5982. /// 半检时,入窑前检验获取此条码是否报损为废品
  5983. /// </summary>
  5984. /// <param name="accountCode"></param>
  5985. /// <param name="userCode"></param>
  5986. /// <param name="userPassword"></param>
  5987. /// <param name="sessionKey"></param>
  5988. /// <param name="barcode">产品条码</param>
  5989. /// <returns></returns>
  5990. public ActionResult CheckWasteScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  5991. {
  5992. ActionResult actionResult = new ActionResult();
  5993. try
  5994. {
  5995. // 验证请求头信息
  5996. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  5997. // 验证失败
  5998. if (actionResult.Status != (int)Constant.PDAResult.Success)
  5999. {
  6000. return actionResult;
  6001. }
  6002. int returnValue = ServiceInvoker.Invoke<int>(this,
  6003. () => PMModuleLogic.CheckWasteScrapProduct(barcode));
  6004. if (returnValue != -100)
  6005. {
  6006. actionResult.Result = JsonHelper.ToJson(returnValue);
  6007. actionResult.Status = (int)Constant.PDAResult.Success;
  6008. }
  6009. else
  6010. {
  6011. actionResult.Status = (int)Constant.PDAResult.Fail;
  6012. actionResult.Message = "条码[" + barcode + "]不是废品,不能进行编辑";
  6013. }
  6014. }
  6015. catch (Exception ex)
  6016. {
  6017. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6018. OutputLog.TraceLog(LogPriority.Error,
  6019. this.ToString(),
  6020. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6021. ex.ToString(),
  6022. LocalPath.LogExePath);
  6023. actionResult.Status = (int)Constant.PDAResult.Exception;
  6024. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6025. }
  6026. return actionResult;
  6027. }
  6028. /// <summary>
  6029. /// 获取登陆帐户有无入窑前检验数据编辑权限
  6030. /// </summary>
  6031. /// <param name="accountCode"></param>
  6032. /// <param name="userCode"></param>
  6033. /// <param name="userPassword"></param>
  6034. /// <param name="sessionKey"></param>
  6035. /// <param name="usercode">工号编码</param>
  6036. /// <returns></returns>
  6037. public ActionResult GetIntoKilnCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6038. {
  6039. ActionResult actionResult = new ActionResult();
  6040. try
  6041. {
  6042. // 验证请求头信息
  6043. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6044. // 验证失败
  6045. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6046. {
  6047. return actionResult;
  6048. }
  6049. int returnValue = ServiceInvoker.Invoke<int>(this,
  6050. () => PDAModuleLogic.GetIntoKilnCheckEditFuntion(sUserInfo));
  6051. actionResult.Result = JsonHelper.ToJson(returnValue);
  6052. actionResult.Status = (int)Constant.PDAResult.Success;
  6053. }
  6054. catch (Exception ex)
  6055. {
  6056. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6057. OutputLog.TraceLog(LogPriority.Error,
  6058. this.ToString(),
  6059. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6060. ex.ToString(),
  6061. LocalPath.LogExePath);
  6062. actionResult.Status = (int)Constant.PDAResult.Exception;
  6063. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6064. }
  6065. return actionResult;
  6066. }
  6067. /// <summary>
  6068. /// 获取登陆帐户有无半检验数据编辑权限
  6069. /// </summary>
  6070. /// <param name="accountCode"></param>
  6071. /// <param name="userCode"></param>
  6072. /// <param name="userPassword"></param>
  6073. /// <param name="sessionKey"></param>
  6074. /// <param name="usercode">工号编码</param>
  6075. /// <returns></returns>
  6076. public ActionResult GetNormalCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6077. {
  6078. ActionResult actionResult = new ActionResult();
  6079. try
  6080. {
  6081. // 验证请求头信息
  6082. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6083. // 验证失败
  6084. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6085. {
  6086. return actionResult;
  6087. }
  6088. int returnValue = ServiceInvoker.Invoke<int>(this,
  6089. () => PDAModuleLogic.GetNormalCheckEditFuntion(sUserInfo));
  6090. actionResult.Result = JsonHelper.ToJson(returnValue);
  6091. actionResult.Status = (int)Constant.PDAResult.Success;
  6092. }
  6093. catch (Exception ex)
  6094. {
  6095. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6096. OutputLog.TraceLog(LogPriority.Error,
  6097. this.ToString(),
  6098. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6099. ex.ToString(),
  6100. LocalPath.LogExePath);
  6101. actionResult.Status = (int)Constant.PDAResult.Exception;
  6102. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6103. }
  6104. return actionResult;
  6105. }
  6106. /// <summary>
  6107. /// 获取缺陷扣罚管理的全部数据
  6108. /// </summary>
  6109. /// <param name="accountCode"></param>
  6110. /// <param name="userCode"></param>
  6111. /// <param name="userPassword"></param>
  6112. /// <param name="sessionKey"></param>
  6113. /// <returns></returns>
  6114. public ActionResult GetAllDefectFine(string accountCode, string userCode, string userPassword, string sessionKey)
  6115. {
  6116. ActionResult actionResult = new ActionResult();
  6117. try
  6118. {
  6119. // 验证请求头信息
  6120. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6121. // 验证失败
  6122. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6123. {
  6124. return actionResult;
  6125. }
  6126. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6127. () => SystemModuleLogic.GetAllDefectFine(sUserInfo));
  6128. if (ds != null && ds.Tables[0].Rows.Count > 0)
  6129. {
  6130. DataView dv = ds.Tables[0].DefaultView;
  6131. dv.RowFilter = "valueflag=1";
  6132. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  6133. actionResult.Status = (int)Constant.PDAResult.Success;
  6134. }
  6135. else
  6136. {
  6137. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  6138. actionResult.Status = (int)Constant.PDAResult.Success;
  6139. }
  6140. }
  6141. catch (Exception ex)
  6142. {
  6143. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6144. OutputLog.TraceLog(LogPriority.Error,
  6145. this.ToString(),
  6146. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6147. ex.ToString(),
  6148. LocalPath.LogExePath);
  6149. actionResult.Status = (int)Constant.PDAResult.Exception;
  6150. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6151. }
  6152. return actionResult;
  6153. }
  6154. /// <summary>
  6155. /// 获取缺陷扣除数管理的全部数据
  6156. /// </summary>
  6157. /// <param name="accountCode"></param>
  6158. /// <param name="userCode"></param>
  6159. /// <param name="userPassword"></param>
  6160. /// <param name="sessionKey"></param>
  6161. /// <returns></returns>
  6162. public ActionResult GetAllDefectDeduction(string accountCode, string userCode, string userPassword, string sessionKey)
  6163. {
  6164. ActionResult actionResult = new ActionResult();
  6165. try
  6166. {
  6167. // 验证请求头信息
  6168. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6169. // 验证失败
  6170. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6171. {
  6172. return actionResult;
  6173. }
  6174. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6175. () => SystemModuleLogic.GetAllDefectDeduction(sUserInfo));
  6176. if (ds != null && ds.Tables[0].Rows.Count > 0)
  6177. {
  6178. DataView dv = ds.Tables[0].DefaultView;
  6179. dv.RowFilter = "valueflag=1";
  6180. actionResult.Result = JsonHelper.ToJson(dv.ToTable());
  6181. actionResult.Status = (int)Constant.PDAResult.Success;
  6182. }
  6183. else
  6184. {
  6185. actionResult.Result = JsonHelper.ToJson(ds.Tables[0]);
  6186. actionResult.Status = (int)Constant.PDAResult.Success;
  6187. }
  6188. }
  6189. catch (Exception ex)
  6190. {
  6191. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6192. OutputLog.TraceLog(LogPriority.Error,
  6193. this.ToString(),
  6194. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6195. ex.ToString(),
  6196. LocalPath.LogExePath);
  6197. actionResult.Status = (int)Constant.PDAResult.Exception;
  6198. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6199. }
  6200. return actionResult;
  6201. }
  6202. /// <summary>
  6203. /// 获取缺陷扣罚关系管理的全部数据
  6204. /// </summary>
  6205. /// <param name="accountCode"></param>
  6206. /// <param name="userCode"></param>
  6207. /// <param name="userPassword"></param>
  6208. /// <param name="sessionKey"></param>
  6209. /// <returns></returns>
  6210. public ActionResult GetAllDefectFineRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6211. {
  6212. ActionResult actionResult = new ActionResult();
  6213. try
  6214. {
  6215. // 验证请求头信息
  6216. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6217. // 验证失败
  6218. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6219. {
  6220. return actionResult;
  6221. }
  6222. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6223. () => SystemModuleLogic.GetAllDefectFineRelation(sUserInfo));
  6224. DataTable dt = new DataTable();
  6225. dt.Columns.Add("DefectID");
  6226. dt.Columns.Add("DefectFineID");
  6227. DataView dv = ds.Tables[0].DefaultView;
  6228. DataTable dtFor = dv.ToTable("defectid", true);
  6229. for (int i = 0; i < dtFor.Rows.Count; i++)
  6230. {
  6231. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6232. string substring = "";
  6233. foreach (DataRow r1 in r)
  6234. {
  6235. substring += r1["DefectFineID"].ToString() + "-" + r1["DEFECTFINECODE"].ToString() + ",";
  6236. }
  6237. if (substring != "")
  6238. {
  6239. DataRow drnew = dt.NewRow();
  6240. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6241. drnew["DefectFineID"] = substring.TrimEnd(',');
  6242. dt.Rows.Add(drnew);
  6243. }
  6244. }
  6245. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6246. actionResult.Status = (int)Constant.PDAResult.Success;
  6247. }
  6248. catch (Exception ex)
  6249. {
  6250. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6251. OutputLog.TraceLog(LogPriority.Error,
  6252. this.ToString(),
  6253. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6254. ex.ToString(),
  6255. LocalPath.LogExePath);
  6256. actionResult.Status = (int)Constant.PDAResult.Exception;
  6257. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6258. }
  6259. return actionResult;
  6260. }
  6261. /// <summary>
  6262. /// 获取缺陷扣除数关系管理的全部数据
  6263. /// </summary>
  6264. /// <param name="accountCode"></param>
  6265. /// <param name="userCode"></param>
  6266. /// <param name="userPassword"></param>
  6267. /// <param name="sessionKey"></param>
  6268. /// <returns></returns>
  6269. public ActionResult GetAllDefectDeductionRelation(string accountCode, string userCode, string userPassword, string sessionKey)
  6270. {
  6271. ActionResult actionResult = new ActionResult();
  6272. try
  6273. {
  6274. // 验证请求头信息
  6275. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6276. // 验证失败
  6277. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6278. {
  6279. return actionResult;
  6280. }
  6281. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6282. () => SystemModuleLogic.GetAllDefectDeductionRelation(sUserInfo));
  6283. DataTable dt = new DataTable();
  6284. dt.Columns.Add("DefectID");
  6285. dt.Columns.Add("DefectDeductionNum");
  6286. DataView dv = ds.Tables[0].DefaultView;
  6287. DataTable dtFor = dv.ToTable("defectid", true);
  6288. for (int i = 0; i < dtFor.Rows.Count; i++)
  6289. {
  6290. DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]);
  6291. string substring = "";
  6292. foreach (DataRow r1 in r)
  6293. {
  6294. substring += r1["DefectDeductionID"].ToString() + "-" + r1["DefectDeductionNum"].ToString() + ",";
  6295. }
  6296. if (substring != "")
  6297. {
  6298. DataRow drnew = dt.NewRow();
  6299. drnew["DefectID"] = dtFor.Rows[i]["defectid"];
  6300. drnew["DefectDeductionNum"] = substring.TrimEnd(',');
  6301. dt.Rows.Add(drnew);
  6302. }
  6303. }
  6304. actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0]
  6305. actionResult.Status = (int)Constant.PDAResult.Success;
  6306. }
  6307. catch (Exception ex)
  6308. {
  6309. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6310. OutputLog.TraceLog(LogPriority.Error,
  6311. this.ToString(),
  6312. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6313. ex.ToString(),
  6314. LocalPath.LogExePath);
  6315. actionResult.Status = (int)Constant.PDAResult.Exception;
  6316. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6317. }
  6318. return actionResult;
  6319. }
  6320. /// <summary>
  6321. /// 获取盘点单明细
  6322. /// </summary>
  6323. /// <param name="sUserInfo"></param>
  6324. /// <returns></returns>
  6325. public ActionResult GetUpdateInCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, string incheckedno)
  6326. {
  6327. ActionResult actionResult = new ActionResult();
  6328. try
  6329. {
  6330. // 验证请求头信息
  6331. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6332. // 验证失败
  6333. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6334. {
  6335. return actionResult;
  6336. }
  6337. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  6338. () => PMModuleLogic.GetUpdateInCheckedInfo(incheckedno, sUserInfo));
  6339. actionResult.Result = JsonHelper.ToJson(ds);
  6340. actionResult.Status = (int)Constant.PDAResult.Success;
  6341. }
  6342. catch (Exception ex)
  6343. {
  6344. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6345. OutputLog.TraceLog(LogPriority.Error,
  6346. this.ToString(),
  6347. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6348. ex.ToString(),
  6349. LocalPath.LogExePath);
  6350. actionResult.Status = (int)Constant.PDAResult.Exception;
  6351. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6352. }
  6353. return actionResult;
  6354. }
  6355. /// <summary>
  6356. /// 半检检验条码
  6357. /// </summary>
  6358. /// <param name="sUserInfo"></param>
  6359. /// <returns></returns>
  6360. public ActionResult SemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6361. {
  6362. ActionResult actionResult = new ActionResult();
  6363. try
  6364. {
  6365. // 验证请求头信息
  6366. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6367. // 验证失败
  6368. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6369. {
  6370. return actionResult;
  6371. }
  6372. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6373. () => PMModuleLogic.SemiCheckBarcode(barcode, sUserInfo));
  6374. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6375. if (Convert.ToInt32(resultEntity.Result) < 0)
  6376. {
  6377. actionResult.Status = (int)Constant.PDAResult.Fail;
  6378. }
  6379. else
  6380. {
  6381. actionResult.Status = (int)Constant.PDAResult.Success;
  6382. }
  6383. actionResult.Message = resultEntity.Message;
  6384. }
  6385. catch (Exception ex)
  6386. {
  6387. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6388. OutputLog.TraceLog(LogPriority.Error,
  6389. this.ToString(),
  6390. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6391. ex.ToString(),
  6392. LocalPath.LogExePath);
  6393. actionResult.Status = (int)Constant.PDAResult.Exception;
  6394. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6395. }
  6396. return actionResult;
  6397. }
  6398. /// <summary>
  6399. /// 根据条码获取经过的工序,用于绑定返工工序
  6400. /// </summary>
  6401. /// <param name="sUserInfo"></param>
  6402. /// <returns></returns>
  6403. public ActionResult GetSemiCheckPassProcedure(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6404. {
  6405. ActionResult actionResult = new ActionResult();
  6406. try
  6407. {
  6408. // 验证请求头信息
  6409. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6410. // 验证失败
  6411. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6412. {
  6413. return actionResult;
  6414. }
  6415. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6416. () => PMModuleLogic.GetSemiCheckPassProcedure(barcode));
  6417. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6418. actionResult.Status = (int)Constant.PDAResult.Success;
  6419. }
  6420. catch (Exception ex)
  6421. {
  6422. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6423. OutputLog.TraceLog(LogPriority.Error,
  6424. this.ToString(),
  6425. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6426. ex.ToString(),
  6427. LocalPath.LogExePath);
  6428. actionResult.Status = (int)Constant.PDAResult.Exception;
  6429. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6430. }
  6431. return actionResult;
  6432. }
  6433. /// <summary>
  6434. /// 获取登陆帐户有无半检状态权限
  6435. /// </summary>
  6436. /// <param name="sUserInfo"></param>
  6437. /// <returns></returns>
  6438. public ActionResult GetSemiCheckStatusFuntion(string accountCode, string userCode, string userPassword, string sessionKey)
  6439. {
  6440. ActionResult actionResult = new ActionResult();
  6441. try
  6442. {
  6443. // 验证请求头信息
  6444. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6445. // 验证失败
  6446. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6447. {
  6448. return actionResult;
  6449. }
  6450. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6451. () => PMModuleLogic.GetSemiCheckStatusFuntion(sUserInfo));
  6452. actionResult.Result = JsonHelper.ToJson(resultEntity);
  6453. actionResult.Status = (int)Constant.PDAResult.Success;
  6454. }
  6455. catch (Exception ex)
  6456. {
  6457. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6458. OutputLog.TraceLog(LogPriority.Error,
  6459. this.ToString(),
  6460. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6461. ex.ToString(),
  6462. LocalPath.LogExePath);
  6463. actionResult.Status = (int)Constant.PDAResult.Exception;
  6464. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6465. }
  6466. return actionResult;
  6467. }
  6468. /// <summary>
  6469. /// 复检状态数据源
  6470. /// </summary>
  6471. /// <param name="sUserInfo"></param>
  6472. /// <returns></returns>
  6473. public ActionResult GetSemiCheckType(string accountCode, string userCode, string userPassword, string sessionKey)
  6474. {
  6475. ActionResult actionResult = new ActionResult();
  6476. try
  6477. {
  6478. // 验证请求头信息
  6479. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6480. // 验证失败
  6481. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6482. {
  6483. return actionResult;
  6484. }
  6485. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6486. () => SystemModuleLogic.GetSemiCheckType());
  6487. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6488. actionResult.Status = (int)Constant.PDAResult.Success;
  6489. }
  6490. catch (Exception ex)
  6491. {
  6492. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6493. OutputLog.TraceLog(LogPriority.Error,
  6494. this.ToString(),
  6495. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6496. ex.ToString(),
  6497. LocalPath.LogExePath);
  6498. actionResult.Status = (int)Constant.PDAResult.Exception;
  6499. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6500. }
  6501. return actionResult;
  6502. }
  6503. /// <summary>
  6504. /// 根据半成品检验数据ID,显示半成品数据信息
  6505. /// </summary>
  6506. /// <param name="sUserInfo"></param>
  6507. /// <returns></returns>
  6508. public ActionResult GetSemiCheckByID(string accountCode, string userCode, string userPassword, string sessionKey, int semiCheckID)
  6509. {
  6510. ActionResult actionResult = new ActionResult();
  6511. try
  6512. {
  6513. // 验证请求头信息
  6514. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6515. // 验证失败
  6516. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6517. {
  6518. return actionResult;
  6519. }
  6520. DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
  6521. () => PMModuleLogic.GetSemiCheckByID(semiCheckID));
  6522. SemiCheckEntity[] productionDatas = new SemiCheckEntity[1];
  6523. if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
  6524. {
  6525. if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  6526. {
  6527. for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
  6528. {
  6529. SemiCheckEntity productionData = new SemiCheckEntity();
  6530. productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
  6531. if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
  6532. {
  6533. productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
  6534. }
  6535. productionData.SemiCheckID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString());
  6536. productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
  6537. productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
  6538. productionData.SemiCheckType = reworkDs.Tables[0].Rows[i]["SemiCheckType"].ToString();
  6539. productionData.ReFine = 0;
  6540. if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
  6541. {
  6542. productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
  6543. }
  6544. productionData.ReSemiCheckType = reworkDs.Tables[0].Rows[i]["ReSemiCheckType"].ToString();
  6545. productionData.ReworkProcedureCode = reworkDs.Tables[0].Rows[i]["ReworkProcedureCode"].ToString();
  6546. productionData.ReworkProcedureName = reworkDs.Tables[0].Rows[i]["ReworkProcedureName"].ToString();
  6547. productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
  6548. if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
  6549. {
  6550. productionData.SemiCheckUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
  6551. productionData.SemiCheckUserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6552. }
  6553. if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
  6554. {
  6555. productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
  6556. }
  6557. //productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
  6558. //productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
  6559. productionData.SpecialRepairFlag = reworkDs.Tables[0].Rows[i]["SpecialRepairFlag"].ToString();
  6560. productionData.GroutingUserCode = reworkDs.Tables[0].Rows[i]["GroutingUserCode"].ToString();
  6561. productionData.GroutingNum = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GroutingNum"]);
  6562. productionData.IsPublicBody = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsPublicBody"]);
  6563. productionData.MouldCode = reworkDs.Tables[0].Rows[i]["MouldCode"].ToString();
  6564. productionData.GroutingDate = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["GroutingDate"]);
  6565. if (reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString() != "")
  6566. {
  6567. productionData.ReworkUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString());
  6568. productionData.ReworkUserCode = reworkDs.Tables[0].Rows[i]["ReworkUserCode"].ToString();
  6569. }
  6570. productionData.ReSemiCheckUserCode = reworkDs.Tables[0].Rows[i]["ReSemiCheckUserCode"].ToString();
  6571. if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
  6572. {
  6573. productionData.Logoid = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["Logoid"]);
  6574. productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
  6575. productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
  6576. }
  6577. productionData.SemiCheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["SemiCheckTime"]);
  6578. if (reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"] != DBNull.Value)
  6579. {
  6580. productionData.ReSemiCheckDateTimeStart = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"]);
  6581. }
  6582. DataView dvDefect = reworkDs.Tables[1].DefaultView;
  6583. dvDefect.RowFilter = "SemiCheckID=" + reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString();
  6584. DataTable dtDefect = dvDefect.ToTable();
  6585. for (int row = 0; row < dtDefect.Rows.Count; row++)
  6586. {
  6587. // 产品缺陷
  6588. SemiCheckDefectEntity defect = new SemiCheckDefectEntity();
  6589. //defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
  6590. //defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
  6591. //if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
  6592. //{
  6593. // defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
  6594. //}
  6595. //defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
  6596. if (dtDefect.Rows[row]["DefectID"].ToString() != "")
  6597. {
  6598. defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
  6599. }
  6600. defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
  6601. defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
  6602. if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
  6603. {
  6604. defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
  6605. }
  6606. defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
  6607. defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
  6608. if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
  6609. {
  6610. defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
  6611. }
  6612. defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
  6613. defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
  6614. if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
  6615. {
  6616. defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
  6617. }
  6618. defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
  6619. defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
  6620. //if (dtDefect.Rows[row]["Jobs"].ToString() != "")
  6621. //{
  6622. // defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
  6623. //}
  6624. //if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
  6625. //{
  6626. // defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
  6627. //}
  6628. //defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
  6629. //defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
  6630. //defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
  6631. defect.Remarks = dtDefect.Rows[row]["remarks"].ToString();
  6632. if (dtDefect.Rows[row]["semicheckid"].ToString() != "")
  6633. {
  6634. defect.SemiCheckID = Convert.ToInt32(dtDefect.Rows[row]["semicheckid"].ToString());
  6635. }
  6636. if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
  6637. {
  6638. defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
  6639. }
  6640. //if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
  6641. //{
  6642. // defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
  6643. //}
  6644. //defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
  6645. //--------责任员工-------------------
  6646. DataRow[] drRow = reworkDs.Tables[2].Select("SemiCheckDefectID=" + reworkDs.Tables[1].Rows[row]["SemiCheckDefectID"]);
  6647. if (drRow.Length > Constant.INT_IS_ZERO)
  6648. {
  6649. if (defect.DefectResponsibles == null)
  6650. {
  6651. defect.DefectResponsibles = new List<SemiCheckResponsibleEntity>();
  6652. }
  6653. foreach (DataRow r in drRow)
  6654. {
  6655. SemiCheckResponsibleEntity defectResponsible = new SemiCheckResponsibleEntity();
  6656. if (r["SemiCheckDefectID"].ToString() != "")
  6657. {
  6658. defectResponsible.SemiCheckDefectID = Convert.ToInt32(r["SemiCheckDefectID"]);
  6659. }
  6660. if (r["StaffID"].ToString() != "")
  6661. {
  6662. defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
  6663. }
  6664. defectResponsible.StaffCode = r["StaffCode"].ToString();
  6665. defectResponsible.StaffName = r["StaffName"].ToString();
  6666. if (r["StaffStatus"].ToString() != "")
  6667. {
  6668. defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
  6669. }
  6670. if (r["UJobsID"].ToString() != "")
  6671. {
  6672. defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
  6673. }
  6674. if (r["SJobsID"].ToString() != "")
  6675. {
  6676. defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
  6677. }
  6678. defect.DefectResponsibles.Add(defectResponsible);
  6679. }
  6680. }
  6681. //------------------------------
  6682. if (productionData.SemiCheckDefects == null)
  6683. {
  6684. productionData.SemiCheckDefects = new List<SemiCheckDefectEntity>();
  6685. }
  6686. productionData.SemiCheckDefects.Add(defect);
  6687. }
  6688. //if (productionDatas.PDAProductionData == null)
  6689. //{
  6690. // productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
  6691. //}
  6692. productionDatas[0] = productionData;
  6693. //---------------------------------------------------------------------------------
  6694. }
  6695. }
  6696. }
  6697. actionResult.Result = JsonHelper.ToJson(productionDatas);
  6698. actionResult.Status = (int)Constant.PDAResult.Success;
  6699. }
  6700. catch (Exception ex)
  6701. {
  6702. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6703. OutputLog.TraceLog(LogPriority.Error,
  6704. this.ToString(),
  6705. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6706. ex.ToString(),
  6707. LocalPath.LogExePath);
  6708. actionResult.Status = (int)Constant.PDAResult.Exception;
  6709. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6710. }
  6711. return actionResult;
  6712. }
  6713. /// <summary>
  6714. /// 保存半检登记
  6715. /// </summary>
  6716. /// <param name="accountCode">帐套code</param>
  6717. /// <param name="userCode">用户code</param>
  6718. /// <param name="userPassword">用户密码</param>
  6719. /// <param name="sessionKey">本次登陆密钥</param>
  6720. /// <param name="entity">半检实体类</param>
  6721. /// <param name="sUserInfo">用户基本信息</param>
  6722. /// <returns></returns>
  6723. public ActionResult AddSemiCheck(string accountCode, string userCode, string userPassword, string sessionKey, SemiCheckEntity[] entityobj)
  6724. {
  6725. ActionResult actionResult = new ActionResult();
  6726. try
  6727. {
  6728. // 验证请求头信息
  6729. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6730. // 验证失败
  6731. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6732. {
  6733. return actionResult;
  6734. }
  6735. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6736. () => PMModuleLogicDAL.AddSemiCheck(entityobj, sUserInfo));
  6737. string err = string.Empty;
  6738. err = resultEntity.Message;
  6739. if (err == null)
  6740. {
  6741. err = "";
  6742. }
  6743. SemiCheckEntity entity = entityobj[0];
  6744. if (entity.SemiCheckCategory == 1) // 半检登记
  6745. {
  6746. }
  6747. else if (entity.SemiCheckCategory == 2)// 复检登记
  6748. {
  6749. err = JsonHelper.ToJson(err);
  6750. }
  6751. else if (entity.SemiCheckCategory == 3)// 撤销复检
  6752. {
  6753. err = JsonHelper.ToJson(err);
  6754. }
  6755. //actionResult.Result = JsonHelper.ToJson(err);
  6756. actionResult.Result = err;//JsonHelper.ToJson(err);
  6757. actionResult.Status = (int)Constant.PDAResult.Success;
  6758. }
  6759. catch (Exception ex)
  6760. {
  6761. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6762. OutputLog.TraceLog(LogPriority.Error,
  6763. this.ToString(),
  6764. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6765. ex.ToString(),
  6766. LocalPath.LogExePath);
  6767. actionResult.Status = (int)Constant.PDAResult.Exception;
  6768. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6769. }
  6770. return actionResult;
  6771. }
  6772. /// <summary>
  6773. /// 根据所选工号,查出缺陷责任员工
  6774. /// </summary>
  6775. /// <param name="sUserInfo"></param>
  6776. /// <returns></returns>
  6777. public ActionResult GetSemiCheckDefectStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid)
  6778. {
  6779. ActionResult actionResult = new ActionResult();
  6780. try
  6781. {
  6782. // 验证请求头信息
  6783. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6784. // 验证失败
  6785. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6786. {
  6787. return actionResult;
  6788. }
  6789. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6790. () => PMModuleLogic.GetSemiCheckDefectStaffByUserID(sUserInfo, userid));
  6791. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6792. actionResult.Status = (int)Constant.PDAResult.Success;
  6793. }
  6794. catch (Exception ex)
  6795. {
  6796. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6797. OutputLog.TraceLog(LogPriority.Error,
  6798. this.ToString(),
  6799. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6800. ex.ToString(),
  6801. LocalPath.LogExePath);
  6802. actionResult.Status = (int)Constant.PDAResult.Exception;
  6803. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6804. }
  6805. return actionResult;
  6806. }
  6807. /// <summary>
  6808. /// 获取半成品缺陷管理的全部数据
  6809. /// </summary>
  6810. /// <param name="sUserInfo"></param>
  6811. /// <returns></returns>
  6812. public ActionResult GetAllSemicheckDefect(string accountCode, string userCode, string userPassword, string sessionKey)
  6813. {
  6814. ActionResult actionResult = new ActionResult();
  6815. try
  6816. {
  6817. // 验证请求头信息
  6818. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6819. // 验证失败
  6820. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6821. {
  6822. return actionResult;
  6823. }
  6824. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6825. () => SystemModuleLogic.GetAllSemicheckDefect(sUserInfo));
  6826. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6827. actionResult.Status = (int)Constant.PDAResult.Success;
  6828. }
  6829. catch (Exception ex)
  6830. {
  6831. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6832. OutputLog.TraceLog(LogPriority.Error,
  6833. this.ToString(),
  6834. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6835. ex.ToString(),
  6836. LocalPath.LogExePath);
  6837. actionResult.Status = (int)Constant.PDAResult.Exception;
  6838. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6839. }
  6840. return actionResult;
  6841. }
  6842. /// <summary>
  6843. /// 获取半成品缺陷位置管理的全部数据
  6844. /// </summary>
  6845. /// <param name="sUserInfo"></param>
  6846. /// <returns></returns>
  6847. public ActionResult GetAllScdefectPosition(string accountCode, string userCode, string userPassword, string sessionKey)
  6848. {
  6849. ActionResult actionResult = new ActionResult();
  6850. try
  6851. {
  6852. // 验证请求头信息
  6853. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6854. // 验证失败
  6855. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6856. {
  6857. return actionResult;
  6858. }
  6859. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  6860. () => SystemModuleLogic.GetAllScdefectPosition(sUserInfo));
  6861. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  6862. actionResult.Status = (int)Constant.PDAResult.Success;
  6863. }
  6864. catch (Exception ex)
  6865. {
  6866. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6867. OutputLog.TraceLog(LogPriority.Error,
  6868. this.ToString(),
  6869. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6870. ex.ToString(),
  6871. LocalPath.LogExePath);
  6872. actionResult.Status = (int)Constant.PDAResult.Exception;
  6873. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6874. }
  6875. return actionResult;
  6876. }
  6877. /// <summary>
  6878. /// 复检验条码
  6879. /// </summary>
  6880. /// <param name="sUserInfo"></param>
  6881. /// <returns></returns>
  6882. public ActionResult ReSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6883. {
  6884. ActionResult actionResult = new ActionResult();
  6885. try
  6886. {
  6887. // 验证请求头信息
  6888. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6889. // 验证失败
  6890. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6891. {
  6892. return actionResult;
  6893. }
  6894. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6895. () => PMModuleLogic.ReSemiCheckBarcode(barcode, sUserInfo));
  6896. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6897. if (Convert.ToInt32(resultEntity.Result) < 0)
  6898. {
  6899. actionResult.Status = (int)Constant.PDAResult.Fail;
  6900. }
  6901. else
  6902. {
  6903. actionResult.Status = (int)Constant.PDAResult.Success;
  6904. }
  6905. actionResult.Message = resultEntity.Message;
  6906. }
  6907. catch (Exception ex)
  6908. {
  6909. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6910. OutputLog.TraceLog(LogPriority.Error,
  6911. this.ToString(),
  6912. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6913. ex.ToString(),
  6914. LocalPath.LogExePath);
  6915. actionResult.Status = (int)Constant.PDAResult.Exception;
  6916. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6917. }
  6918. return actionResult;
  6919. }
  6920. /// <summary>
  6921. /// 撤销复检验条码
  6922. /// </summary>
  6923. /// <param name="sUserInfo"></param>
  6924. /// <returns></returns>
  6925. public ActionResult CancelSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6926. {
  6927. ActionResult actionResult = new ActionResult();
  6928. try
  6929. {
  6930. // 验证请求头信息
  6931. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6932. // 验证失败
  6933. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6934. {
  6935. return actionResult;
  6936. }
  6937. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  6938. () => PMModuleLogic.CancelSemiCheckBarcode(barcode, sUserInfo));
  6939. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  6940. if (Convert.ToInt32(resultEntity.Result) < 0)
  6941. {
  6942. actionResult.Status = (int)Constant.PDAResult.Fail;
  6943. }
  6944. else
  6945. {
  6946. actionResult.Status = (int)Constant.PDAResult.Success;
  6947. }
  6948. actionResult.Message = resultEntity.Message;
  6949. }
  6950. catch (Exception ex)
  6951. {
  6952. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  6953. OutputLog.TraceLog(LogPriority.Error,
  6954. this.ToString(),
  6955. System.Reflection.MethodBase.GetCurrentMethod().Name,
  6956. ex.ToString(),
  6957. LocalPath.LogExePath);
  6958. actionResult.Status = (int)Constant.PDAResult.Exception;
  6959. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  6960. }
  6961. return actionResult;
  6962. }
  6963. /// <summary>
  6964. /// 恢复数据
  6965. /// </summary>
  6966. /// <param name="sUserInfo"></param>
  6967. /// <returns></returns>
  6968. public ActionResult ResetBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  6969. {
  6970. ActionResult actionResult = new ActionResult();
  6971. try
  6972. {
  6973. // 验证请求头信息
  6974. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  6975. // 验证失败
  6976. if (actionResult.Status != (int)Constant.PDAResult.Success)
  6977. {
  6978. return actionResult;
  6979. }
  6980. int resultEntity = ServiceInvoker.Invoke<int>(this,
  6981. () => PMModuleLogicDAL.ResetBarCode(barcode));
  6982. if (resultEntity > 0)
  6983. {
  6984. actionResult.Status = (int)Constant.PDAResult.Success;
  6985. actionResult.Message = "恢复数据成功";
  6986. }
  6987. else
  6988. {
  6989. actionResult.Status = (int)Constant.PDAResult.Fail;
  6990. if (resultEntity == -1)
  6991. {
  6992. actionResult.Message = "此条码没有清除,不能恢复";
  6993. }
  6994. else if (resultEntity == 0)
  6995. {
  6996. actionResult.Message = "没有可恢复的数据";
  6997. }
  6998. }
  6999. }
  7000. catch (Exception ex)
  7001. {
  7002. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7003. OutputLog.TraceLog(LogPriority.Error,
  7004. this.ToString(),
  7005. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7006. ex.ToString(),
  7007. LocalPath.LogExePath);
  7008. actionResult.Status = (int)Constant.PDAResult.Exception;
  7009. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7010. }
  7011. return actionResult;
  7012. }
  7013. /// <summary>
  7014. /// 通过SettingCode获取系统参数管理的数据
  7015. /// </summary>
  7016. /// <param name="accountCode"></param>
  7017. /// <param name="userCode"></param>
  7018. /// <param name="userPassword"></param>
  7019. /// <param name="sessionKey"></param>
  7020. /// <param name="settingcode">设置编码</param>
  7021. /// <returns></returns>
  7022. public ActionResult GetSystemSettingDataByCode(string accountCode, string userCode, string userPassword, string sessionKey, string settingcode)
  7023. {
  7024. ActionResult actionResult = new ActionResult();
  7025. try
  7026. {
  7027. // 验证请求头信息
  7028. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7029. // 验证失败
  7030. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7031. {
  7032. return actionResult;
  7033. }
  7034. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7035. () => SystemModuleLogic.GetSystemSettingDataByCode(settingcode, sUserInfo));
  7036. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7037. actionResult.Status = (int)Constant.PDAResult.Success;
  7038. }
  7039. catch (Exception ex)
  7040. {
  7041. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7042. OutputLog.TraceLog(LogPriority.Error,
  7043. this.ToString(),
  7044. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7045. ex.ToString(),
  7046. LocalPath.LogExePath);
  7047. actionResult.Status = (int)Constant.PDAResult.Exception;
  7048. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7049. }
  7050. return actionResult;
  7051. }
  7052. /// <summary>
  7053. /// 校验条码是否允许撤销,如果不允许提示错误消息
  7054. /// </summary>
  7055. /// <param name="accountCode"></param>
  7056. /// <param name="userCode"></param>
  7057. /// <param name="userPassword"></param>
  7058. /// <param name="sessionKey"></param>
  7059. /// <param name="orgTime">原时间</param>
  7060. /// <param name="days">允许撤销天数</param>
  7061. /// <param name="settingCode">设置code,用于返回不同错误消息</param>
  7062. /// <returns></returns>
  7063. public ActionResult BarcodeAllowCancel(string accountCode, string userCode, string userPassword, string sessionKey, string orgTime, int days, string settingCode)
  7064. {
  7065. ActionResult actionResult = new ActionResult();
  7066. try
  7067. {
  7068. // 验证请求头信息
  7069. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7070. // 验证失败
  7071. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7072. {
  7073. return actionResult;
  7074. }
  7075. string[] subOrgTime = orgTime.Split('-');
  7076. DateTime newOrgTime = new DateTime(Convert.ToInt32(subOrgTime[0]), Convert.ToInt32(subOrgTime[1]), Convert.ToInt32(subOrgTime[2]));
  7077. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7078. () => PMModuleLogic.BarcodeAllowCancel(newOrgTime, days, settingCode, sUserInfo));
  7079. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7080. if (Convert.ToInt32(resultEntity.Result) < 0)
  7081. {
  7082. actionResult.Status = (int)Constant.PDAResult.Fail;
  7083. }
  7084. else
  7085. {
  7086. actionResult.Status = (int)Constant.PDAResult.Success;
  7087. }
  7088. actionResult.Message = resultEntity.Message;
  7089. }
  7090. catch (Exception ex)
  7091. {
  7092. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7093. OutputLog.TraceLog(LogPriority.Error,
  7094. this.ToString(),
  7095. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7096. ex.ToString(),
  7097. LocalPath.LogExePath);
  7098. actionResult.Status = (int)Constant.PDAResult.Exception;
  7099. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7100. }
  7101. return actionResult;
  7102. }
  7103. /// <summary>
  7104. /// 获取生产订单管理的全部数据
  7105. /// </summary>
  7106. /// <param name="sUserInfo"></param>
  7107. /// <returns></returns>
  7108. public ActionResult GetOrderList(string accountCode, string userCode, string userPassword, string sessionKey, OrderEntity order)
  7109. {
  7110. ActionResult actionResult = new ActionResult();
  7111. try
  7112. {
  7113. // 验证请求头信息
  7114. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7115. // 验证失败
  7116. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7117. {
  7118. return actionResult;
  7119. }
  7120. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7121. () => PMModuleLogic.GetOrderList(order, sUserInfo));
  7122. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7123. actionResult.Status = (int)Constant.PDAResult.Success;
  7124. }
  7125. catch (Exception ex)
  7126. {
  7127. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7128. OutputLog.TraceLog(LogPriority.Error,
  7129. this.ToString(),
  7130. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7131. ex.ToString(),
  7132. LocalPath.LogExePath);
  7133. actionResult.Status = (int)Constant.PDAResult.Exception;
  7134. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7135. }
  7136. return actionResult;
  7137. }
  7138. public ActionResult FinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7139. {
  7140. ActionResult actionResult = new ActionResult();
  7141. try
  7142. {
  7143. // 验证请求头信息
  7144. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7145. // 验证失败
  7146. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7147. {
  7148. return actionResult;
  7149. }
  7150. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7151. () => PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo));
  7152. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7153. if (Convert.ToInt32(resultEntity.Result) < 0)
  7154. {
  7155. actionResult.Status = (int)Constant.PDAResult.Fail;
  7156. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  7157. }
  7158. else
  7159. {
  7160. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  7161. actionResult.Status = (int)Constant.PDAResult.Success;
  7162. }
  7163. actionResult.Message = resultEntity.Message;
  7164. }
  7165. catch (Exception ex)
  7166. {
  7167. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7168. OutputLog.TraceLog(LogPriority.Error,
  7169. this.ToString(),
  7170. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7171. ex.ToString(),
  7172. LocalPath.LogExePath);
  7173. actionResult.Status = (int)Constant.PDAResult.Exception;
  7174. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7175. }
  7176. return actionResult;
  7177. }
  7178. public ActionResult GetSystemData(string accountCode, string userCode, string userPassword, string sessionKey)
  7179. {
  7180. ActionResult actionResult = new ActionResult();
  7181. try
  7182. {
  7183. // 验证请求头信息
  7184. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7185. // 验证失败
  7186. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7187. {
  7188. return actionResult;
  7189. }
  7190. DataSet resultEntity = ServiceInvoker.Invoke<DataSet>(this,
  7191. () => SystemModuleLogic.GetSystemData(sUserInfo));
  7192. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7193. actionResult.Status = (int)Constant.PDAResult.Success;
  7194. }
  7195. catch (Exception ex)
  7196. {
  7197. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7198. OutputLog.TraceLog(LogPriority.Error,
  7199. this.ToString(),
  7200. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7201. ex.ToString(),
  7202. LocalPath.LogExePath);
  7203. actionResult.Status = (int)Constant.PDAResult.Exception;
  7204. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7205. }
  7206. return actionResult;
  7207. }
  7208. public ActionResult SaveFinishedHandover(string accountCode, string userCode, string userPassword, string sessionKey, int orderid, OrderEntity[] orderEntity)
  7209. {
  7210. ActionResult actionResult = new ActionResult();
  7211. try
  7212. {
  7213. // 验证请求头信息
  7214. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7215. // 验证失败
  7216. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7217. {
  7218. return actionResult;
  7219. }
  7220. DataTable dtOrderData = DataConvert.ObjectConvertToTable<OrderEntity>(orderEntity);
  7221. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7222. () => PMModuleLogicDAL.SaveFinishedHandover(orderid, dtOrderData, sUserInfo));
  7223. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7224. if (Convert.ToInt32(resultEntity.Result) < 0)
  7225. {
  7226. actionResult.Status = (int)Constant.PDAResult.Fail;
  7227. }
  7228. else
  7229. {
  7230. actionResult.Status = (int)Constant.PDAResult.Success;
  7231. }
  7232. actionResult.Message = resultEntity.Message;
  7233. }
  7234. catch (Exception ex)
  7235. {
  7236. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7237. OutputLog.TraceLog(LogPriority.Error,
  7238. this.ToString(),
  7239. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7240. ex.ToString(),
  7241. LocalPath.LogExePath);
  7242. actionResult.Status = (int)Constant.PDAResult.Exception;
  7243. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7244. }
  7245. return actionResult;
  7246. }
  7247. public ActionResult CancelFinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7248. {
  7249. ActionResult actionResult = new ActionResult();
  7250. try
  7251. {
  7252. // 验证请求头信息
  7253. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7254. // 验证失败
  7255. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7256. {
  7257. return actionResult;
  7258. }
  7259. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7260. () => PMModuleLogic.CancelFinishedHandoverBarcode(barcode, sUserInfo));
  7261. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7262. if (Convert.ToInt32(resultEntity.Result) < 0)
  7263. {
  7264. actionResult.Status = (int)Constant.PDAResult.Fail;
  7265. }
  7266. else
  7267. {
  7268. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables[0]);
  7269. actionResult.Status = (int)Constant.PDAResult.Success;
  7270. }
  7271. actionResult.Message = resultEntity.Message;
  7272. }
  7273. catch (Exception ex)
  7274. {
  7275. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7276. OutputLog.TraceLog(LogPriority.Error,
  7277. this.ToString(),
  7278. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7279. ex.ToString(),
  7280. LocalPath.LogExePath);
  7281. actionResult.Status = (int)Constant.PDAResult.Exception;
  7282. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7283. }
  7284. return actionResult;
  7285. }
  7286. public ActionResult SaveCancelFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7287. {
  7288. ActionResult actionResult = new ActionResult();
  7289. try
  7290. {
  7291. // 验证请求头信息
  7292. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7293. // 验证失败
  7294. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7295. {
  7296. return actionResult;
  7297. }
  7298. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7299. () => PMModuleLogicDAL.SaveCancelFinishedHandoverByBarcode(barcode, sUserInfo));
  7300. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7301. if (Convert.ToInt32(resultEntity.Result) < 0)
  7302. {
  7303. actionResult.Status = (int)Constant.PDAResult.Fail;
  7304. }
  7305. else
  7306. {
  7307. actionResult.Status = (int)Constant.PDAResult.Success;
  7308. }
  7309. actionResult.Message = resultEntity.Message;
  7310. }
  7311. catch (Exception ex)
  7312. {
  7313. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7314. OutputLog.TraceLog(LogPriority.Error,
  7315. this.ToString(),
  7316. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7317. ex.ToString(),
  7318. LocalPath.LogExePath);
  7319. actionResult.Status = (int)Constant.PDAResult.Exception;
  7320. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7321. }
  7322. return actionResult;
  7323. }
  7324. public ActionResult SaveChangeFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int orderid)
  7325. {
  7326. ActionResult actionResult = new ActionResult();
  7327. try
  7328. {
  7329. // 验证请求头信息
  7330. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7331. // 验证失败
  7332. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7333. {
  7334. return actionResult;
  7335. }
  7336. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7337. () => PMModuleLogicDAL.SaveChangeFinishedHandoverByBarcode(barcode, orderid, sUserInfo));
  7338. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7339. if (Convert.ToInt32(resultEntity.Result) < 0)
  7340. {
  7341. actionResult.Status = (int)Constant.PDAResult.Fail;
  7342. }
  7343. else
  7344. {
  7345. actionResult.Status = (int)Constant.PDAResult.Success;
  7346. }
  7347. actionResult.Message = resultEntity.Message;
  7348. }
  7349. catch (Exception ex)
  7350. {
  7351. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7352. OutputLog.TraceLog(LogPriority.Error,
  7353. this.ToString(),
  7354. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7355. ex.ToString(),
  7356. LocalPath.LogExePath);
  7357. actionResult.Status = (int)Constant.PDAResult.Exception;
  7358. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7359. }
  7360. return actionResult;
  7361. }
  7362. #region PDA条码打印
  7363. /// <summary>
  7364. /// 获取条码打印机
  7365. /// </summary>
  7366. /// <param name="accountCode"></param>
  7367. /// <param name="userCode"></param>
  7368. /// <param name="userPassword"></param>
  7369. /// <param name="sessionKey"></param>
  7370. /// <returns></returns>
  7371. public ActionResult GetBarcodePrinter(string accountCode, string userCode, string userPassword, string sessionKey, int printType=0)
  7372. {
  7373. ActionResult actionResult = new ActionResult();
  7374. try
  7375. {
  7376. // 验证请求头信息
  7377. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7378. // 验证失败
  7379. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7380. {
  7381. return actionResult;
  7382. }
  7383. DataSet resultEntity = BarcodePrintLogic.GetBarcodePrinter(sUserInfo, printType);
  7384. actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]);
  7385. actionResult.Status = (int)Constant.PDAResult.Success;
  7386. }
  7387. catch (Exception ex)
  7388. {
  7389. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7390. OutputLog.TraceLog(LogPriority.Error,
  7391. this.ToString(),
  7392. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7393. ex.ToString(),
  7394. LocalPath.LogExePath);
  7395. actionResult.Status = (int)Constant.PDAResult.Exception;
  7396. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7397. }
  7398. return actionResult;
  7399. }
  7400. /// <summary>
  7401. /// 打印条码样式(补打)
  7402. /// </summary>
  7403. /// <param name="accountCode"></param>
  7404. /// <param name="userCode"></param>
  7405. /// <param name="userPassword"></param>
  7406. /// <param name="sessionKey"></param>
  7407. /// <returns></returns>
  7408. public ActionResult PrintBarcodeLayout(string accountCode, string userCode, string userPassword, string sessionKey,
  7409. string barcode, int copies, int printerID, int printWay=2)
  7410. {
  7411. ActionResult actionResult = new ActionResult();
  7412. try
  7413. {
  7414. // 验证请求头信息
  7415. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7416. // 验证失败
  7417. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7418. {
  7419. return actionResult;
  7420. }
  7421. //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(barcode,
  7422. // copies, printerID, sUserInfo);
  7423. ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(barcode,
  7424. copies, printerID, sUserInfo, printWay);
  7425. if (sre.Status != Constant.ServiceResultStatus.Success)
  7426. {
  7427. actionResult.Status = (int)Constant.ServiceResultStatus.Other;
  7428. actionResult.Message = sre.Message;
  7429. return actionResult;
  7430. }
  7431. actionResult.Result = JsonHelper.ToJson(sre.Result as DataTable);
  7432. actionResult.Status = (int)Constant.PDAResult.Success;
  7433. }
  7434. catch (Exception ex)
  7435. {
  7436. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7437. OutputLog.TraceLog(LogPriority.Error,
  7438. this.ToString(),
  7439. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7440. ex.ToString(),
  7441. LocalPath.LogExePath);
  7442. actionResult.Status = (int)Constant.PDAResult.Exception;
  7443. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7444. }
  7445. return actionResult;
  7446. }
  7447. #endregion PDA条码打印
  7448. #region 统计报表
  7449. /// <summary>
  7450. /// 成型结算报表
  7451. /// </summary>
  7452. /// <param name="accountCode"></param>
  7453. /// <param name="userCode"></param>
  7454. /// <param name="userPassword"></param>
  7455. /// <param name="sessionKey"></param>
  7456. /// <returns></returns>
  7457. public ActionResult GetGroutingSettlementInfo(string accountCode, string userCode, string userPassword, string sessionKey,
  7458. int currentMonth)
  7459. {
  7460. ActionResult actionResult = new ActionResult();
  7461. try
  7462. {
  7463. // 验证请求头信息
  7464. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7465. // 验证失败
  7466. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7467. {
  7468. return actionResult;
  7469. }
  7470. DateTime date = DateTime.Now;
  7471. if (currentMonth != 1)
  7472. {
  7473. date = date.AddMonths(-1);
  7474. }
  7475. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7476. () => PublicModuleLogic.GetFP00002Data(sUserInfo.AccountID, userCode, date));
  7477. if (resultEntity == null || resultEntity.Data == null)
  7478. {
  7479. actionResult.Status = (int)Constant.PDAResult.Fail;
  7480. actionResult.Message = "查询失败";
  7481. return actionResult;
  7482. }
  7483. if (resultEntity.Status == Constant.ServiceResultStatus.Other)
  7484. {
  7485. actionResult.Status = (int)Constant.PDAResult.Fail;
  7486. actionResult.Message = resultEntity.Message;
  7487. return actionResult;
  7488. }
  7489. actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables["DataM"]);
  7490. actionResult.Status = (int)Constant.PDAResult.Success;
  7491. }
  7492. catch (Exception ex)
  7493. {
  7494. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7495. OutputLog.TraceLog(LogPriority.Error,
  7496. this.ToString(),
  7497. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7498. ex.ToString(),
  7499. LocalPath.LogExePath);
  7500. actionResult.Status = (int)Constant.PDAResult.Exception;
  7501. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7502. }
  7503. return actionResult;
  7504. }
  7505. #endregion
  7506. #region 设置当期用户默认打印机配置
  7507. /// <summary>
  7508. /// 设置当期用户默认打印机配置
  7509. /// </summary>
  7510. /// <param name="accountCode"></param>
  7511. /// <param name="userCode"></param>
  7512. /// <param name="userPassword"></param>
  7513. /// <param name="sessionKey"></param>
  7514. /// <param name="printerID"></param>
  7515. /// <returns></returns>
  7516. public ActionResult SetCurrentUserPrinter(string accountCode, string userCode, string userPassword, string sessionKey,
  7517. int printerID)
  7518. {
  7519. ActionResult actionResult = new ActionResult();
  7520. try
  7521. {
  7522. // 验证请求头信息
  7523. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7524. // 验证失败
  7525. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7526. {
  7527. return actionResult;
  7528. }
  7529. ServiceResultEntity resultEntity = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7530. () => BarcodePrintLogic.SetCurrentUserPrinter(printerID, sUserInfo));
  7531. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  7532. if (resultEntity.Status == Constant.ServiceResultStatus.Other || Convert.ToInt32(resultEntity.Result) < 0)
  7533. {
  7534. actionResult.Status = (int)Constant.PDAResult.Fail;
  7535. }
  7536. else
  7537. {
  7538. actionResult.Status = (int)Constant.PDAResult.Success;
  7539. }
  7540. actionResult.Message = resultEntity.Message;
  7541. }
  7542. catch (Exception ex)
  7543. {
  7544. OutputLog.TraceLog(LogPriority.Error,
  7545. this.ToString(),
  7546. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7547. ex.ToString(),
  7548. LocalPath.LogExePath);
  7549. actionResult.Status = (int)Constant.PDAResult.Exception;
  7550. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7551. }
  7552. return actionResult;
  7553. }
  7554. /// <summary>
  7555. /// 校验产品条码是否可以进行回收
  7556. /// </summary>
  7557. /// <param name="accountCode">帐套code</param>
  7558. /// <param name="userCode">用户code</param>
  7559. /// <param name="userPassword">用户密码</param>
  7560. /// <param name="sessionKey">本次登陆密钥</param>
  7561. /// <param name="procedureID">工序ID</param>
  7562. /// <param name="barcode">条码</param>
  7563. /// <returns></returns>
  7564. /// <remarks>
  7565. /// 王鑫 2017.7.21 新建
  7566. /// </remarks>
  7567. public ActionResult CheckRecydingFlagBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode)
  7568. {
  7569. ActionResult actionResult = new ActionResult();
  7570. try
  7571. {
  7572. // 验证请求头信息
  7573. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7574. // 验证失败
  7575. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7576. {
  7577. return actionResult;
  7578. }
  7579. DataSet barcodeDataSet = ServiceInvoker.Invoke<DataSet>(this,
  7580. () => PMModuleLogic.CheckRecydingFlagBarcode(procedureID, barcode, sUserInfo));
  7581. if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO)
  7582. {
  7583. actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]);
  7584. actionResult.Status = (int)Constant.PDAResult.Success;
  7585. }
  7586. else
  7587. {
  7588. actionResult.Status = (int)Constant.PDAResult.Fail;
  7589. actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
  7590. }
  7591. }
  7592. catch (Exception ex)
  7593. {
  7594. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7595. OutputLog.TraceLog(LogPriority.Error,
  7596. this.ToString(),
  7597. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7598. ex.ToString(),
  7599. LocalPath.LogExePath);
  7600. actionResult.Status = (int)Constant.PDAResult.Exception;
  7601. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7602. }
  7603. return actionResult;
  7604. }
  7605. /// <summary>
  7606. /// 获取回收标识
  7607. /// </summary>
  7608. /// <param name="accountCode"></param>
  7609. /// <param name="userCode"></param>
  7610. /// <param name="userPassword"></param>
  7611. /// <param name="sessionKey"></param>
  7612. /// <param name="usercode">工号编码</param>
  7613. /// <returns></returns>
  7614. public ActionResult GetRecyclingflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode)
  7615. {
  7616. ActionResult actionResult = new ActionResult();
  7617. try
  7618. {
  7619. // 验证请求头信息
  7620. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7621. // 验证失败
  7622. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7623. {
  7624. return actionResult;
  7625. }
  7626. int returnValue = ServiceInvoker.Invoke<int>(this,
  7627. () => PMModuleLogic.GetRecyclingflagByBarcode(barcode, sUserInfo));
  7628. actionResult.Result = JsonHelper.ToJson(returnValue);
  7629. actionResult.Status = (int)Constant.PDAResult.Success;
  7630. }
  7631. catch (Exception ex)
  7632. {
  7633. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7634. OutputLog.TraceLog(LogPriority.Error,
  7635. this.ToString(),
  7636. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7637. ex.ToString(),
  7638. LocalPath.LogExePath);
  7639. actionResult.Status = (int)Constant.PDAResult.Exception;
  7640. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7641. }
  7642. return actionResult;
  7643. }
  7644. #endregion
  7645. #region 注浆盘点
  7646. /// <summary>
  7647. /// 获取注浆盘点单列表
  7648. /// </summary>
  7649. /// <param name="sUserInfo"></param>
  7650. /// <returns></returns>
  7651. public ActionResult GetAllGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7652. {
  7653. ActionResult actionResult = new ActionResult();
  7654. try
  7655. {
  7656. // 验证请求头信息
  7657. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7658. // 验证失败
  7659. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7660. {
  7661. return actionResult;
  7662. }
  7663. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7664. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7665. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7666. () => PDAModuleLogic.GetAllGBChecked(entity, sUserInfo));
  7667. actionResult.Result = JsonHelper.ToJson(ds);
  7668. actionResult.Status = (int)Constant.PDAResult.Success;
  7669. }
  7670. catch (Exception ex)
  7671. {
  7672. string json = JsonHelper.ToJson(entity);
  7673. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7674. OutputLog.TraceLog(LogPriority.Error,
  7675. this.ToString(),
  7676. System.Reflection.MethodBase.GetCurrentMethod().Name + "\r\n" + json,
  7677. ex.ToString(),
  7678. LocalPath.LogExePath);
  7679. actionResult.Status = (int)Constant.PDAResult.Exception;
  7680. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7681. }
  7682. return actionResult;
  7683. }
  7684. /// <summary>
  7685. /// 进行盘点操作
  7686. /// </summary>
  7687. /// <param name="accountCode"></param>
  7688. /// <param name="userCode"></param>
  7689. /// <param name="userPassword"></param>
  7690. /// <param name="sessionKey"></param>
  7691. /// <param name="InCheckedID">盘点单ID</param>
  7692. /// <param name="BarCode">产品条码</param>
  7693. /// <returns></returns>
  7694. public ActionResult UpdateGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7695. {
  7696. ActionResult actionResult = new ActionResult();
  7697. try
  7698. {
  7699. // 验证请求头信息
  7700. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7701. // 验证失败
  7702. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7703. {
  7704. return actionResult;
  7705. }
  7706. ClientRequestEntity cre = new ClientRequestEntity();
  7707. cre.Properties["CheckedID"] = CheckedID;
  7708. cre.Properties["Barcode"] = BarCode;
  7709. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7710. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.UpdateGBChecked(sUserInfo, cre));
  7711. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7712. {
  7713. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7714. actionResult.Status = (int)Constant.PDAResult.Success;
  7715. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7716. }
  7717. else
  7718. {
  7719. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7720. actionResult.Status = (int)Constant.PDAResult.Fail;
  7721. actionResult.Message = returnValue.Message;
  7722. }
  7723. }
  7724. catch (Exception ex)
  7725. {
  7726. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7727. OutputLog.TraceLog(LogPriority.Error,
  7728. this.ToString(),
  7729. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7730. ex.ToString(),
  7731. LocalPath.LogExePath);
  7732. actionResult.Status = (int)Constant.PDAResult.Exception;
  7733. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7734. }
  7735. return actionResult;
  7736. }
  7737. /// <summary>
  7738. /// 获取盘点单明细
  7739. /// </summary>
  7740. /// <param name="sUserInfo"></param>
  7741. /// <returns></returns>
  7742. public ActionResult GetUpdateGBCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7743. {
  7744. ActionResult actionResult = new ActionResult();
  7745. try
  7746. {
  7747. // 验证请求头信息
  7748. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7749. // 验证失败
  7750. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7751. {
  7752. return actionResult;
  7753. }
  7754. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7755. () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.
  7756. GetUpdateGBCheckedInfo(checkedID, sUserInfo));
  7757. actionResult.Result = JsonHelper.ToJson(ds);
  7758. actionResult.Status = (int)Constant.PDAResult.Success;
  7759. }
  7760. catch (Exception ex)
  7761. {
  7762. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7763. OutputLog.TraceLog(LogPriority.Error,
  7764. this.ToString(),
  7765. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7766. ex.ToString(),
  7767. LocalPath.LogExePath);
  7768. actionResult.Status = (int)Constant.PDAResult.Exception;
  7769. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7770. }
  7771. return actionResult;
  7772. }
  7773. #endregion
  7774. #region 模具盘点
  7775. /// <summary>
  7776. /// 获取模具盘点单列表
  7777. /// </summary>
  7778. /// <param name="sUserInfo"></param>
  7779. /// <returns></returns>
  7780. public ActionResult GetAllMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity)
  7781. {
  7782. ActionResult actionResult = new ActionResult();
  7783. try
  7784. {
  7785. // 验证请求头信息
  7786. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7787. // 验证失败
  7788. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7789. {
  7790. return actionResult;
  7791. }
  7792. entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA);
  7793. entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1);
  7794. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7795. () => PDAModuleLogic.GetAllMouldChecked(entity, sUserInfo));
  7796. actionResult.Result = JsonHelper.ToJson(ds);
  7797. actionResult.Status = (int)Constant.PDAResult.Success;
  7798. }
  7799. catch (Exception ex)
  7800. {
  7801. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7802. OutputLog.TraceLog(LogPriority.Error,
  7803. this.ToString(),
  7804. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7805. ex.ToString(),
  7806. LocalPath.LogExePath);
  7807. actionResult.Status = (int)Constant.PDAResult.Exception;
  7808. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7809. }
  7810. return actionResult;
  7811. }
  7812. /// <summary>
  7813. /// 进行盘点操作
  7814. /// </summary>
  7815. /// <param name="accountCode"></param>
  7816. /// <param name="userCode"></param>
  7817. /// <param name="userPassword"></param>
  7818. /// <param name="sessionKey"></param>
  7819. /// <param name="InCheckedID">盘点单ID</param>
  7820. /// <param name="BarCode">产品条码</param>
  7821. /// <returns></returns>
  7822. public ActionResult UpdateMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode)
  7823. {
  7824. ActionResult actionResult = new ActionResult();
  7825. try
  7826. {
  7827. // 验证请求头信息
  7828. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7829. // 验证失败
  7830. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7831. {
  7832. return actionResult;
  7833. }
  7834. ClientRequestEntity cre = new ClientRequestEntity();
  7835. cre.Properties["CheckedID"] = CheckedID;
  7836. cre.Properties["Barcode"] = BarCode;
  7837. ServiceResultEntity returnValue = ServiceInvoker.Invoke<ServiceResultEntity>(this,
  7838. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.UpdateMouldChecked(sUserInfo, cre));
  7839. if (returnValue.Status == Constant.ServiceResultStatus.Success)
  7840. {
  7841. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7842. actionResult.Status = (int)Constant.PDAResult.Success;
  7843. actionResult.Message = "产品【" + BarCode + "】盘点成功";
  7844. }
  7845. else
  7846. {
  7847. //actionResult.Result = JsonHelper.ToJson(returnValue);
  7848. actionResult.Status = (int)Constant.PDAResult.Fail;
  7849. actionResult.Message = returnValue.Message;
  7850. }
  7851. }
  7852. catch (Exception ex)
  7853. {
  7854. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7855. OutputLog.TraceLog(LogPriority.Error,
  7856. this.ToString(),
  7857. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7858. ex.ToString(),
  7859. LocalPath.LogExePath);
  7860. actionResult.Status = (int)Constant.PDAResult.Exception;
  7861. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7862. }
  7863. return actionResult;
  7864. }
  7865. /// <summary>
  7866. /// 获取盘点单明细
  7867. /// </summary>
  7868. /// <param name="sUserInfo"></param>
  7869. /// <returns></returns>
  7870. public ActionResult GetUpdateMouldCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID)
  7871. {
  7872. ActionResult actionResult = new ActionResult();
  7873. try
  7874. {
  7875. // 验证请求头信息
  7876. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7877. // 验证失败
  7878. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7879. {
  7880. return actionResult;
  7881. }
  7882. DataSet ds = ServiceInvoker.Invoke<DataSet>(this,
  7883. () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.
  7884. GetUpdateMouldCheckedInfo(checkedID, sUserInfo));
  7885. actionResult.Result = JsonHelper.ToJson(ds);
  7886. actionResult.Status = (int)Constant.PDAResult.Success;
  7887. }
  7888. catch (Exception ex)
  7889. {
  7890. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  7891. OutputLog.TraceLog(LogPriority.Error,
  7892. this.ToString(),
  7893. System.Reflection.MethodBase.GetCurrentMethod().Name,
  7894. ex.ToString(),
  7895. LocalPath.LogExePath);
  7896. actionResult.Status = (int)Constant.PDAResult.Exception;
  7897. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  7898. }
  7899. return actionResult;
  7900. }
  7901. #endregion
  7902. #region 通用接口
  7903. /// <summary>
  7904. /// PDA调用通用接口
  7905. /// </summary>
  7906. /// <param name="accountCode"></param>
  7907. /// <param name="userCode"></param>
  7908. /// <param name="userPassword"></param>
  7909. /// <param name="sessionKey"></param>
  7910. /// <param name="module"></param>
  7911. /// <param name="action"></param>
  7912. /// <param name="data"></param>
  7913. /// <returns></returns>
  7914. public ActionResult DoAction(string accountCode, string userCode, string userPassword, string sessionKey,
  7915. string module, string action, string jsonData)
  7916. {
  7917. ActionResult actionResult = null;
  7918. try
  7919. {
  7920. // 验证请求头信息
  7921. actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
  7922. // 验证失败
  7923. if (actionResult.Status != (int)Constant.PDAResult.Success)
  7924. {
  7925. return actionResult;
  7926. }
  7927. actionResult.Status = (int)Constant.PDAResult.Fail;
  7928. Dictionary<string, object> data = null;
  7929. if (!string.IsNullOrEmpty(jsonData) && jsonData[0] == '{')
  7930. {
  7931. data = JsonHelper.FromJson<Dictionary<string, object>>(jsonData);
  7932. }
  7933. #region PDA报表
  7934. if (module == "Report")
  7935. {
  7936. // 成型月度结算
  7937. if (action == "GetGroutingSettlementInfo")
  7938. {
  7939. DateTime month = DateTime.Now;
  7940. month = new DateTime(month.Year, month.Month, 1);
  7941. //month = new DateTime(2017, 6, 1);
  7942. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  7943. if (currentMonth != 1)
  7944. {
  7945. month = month.AddMonths(-1);
  7946. }
  7947. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementInfo(sUserInfo, month);
  7948. if (sre.Status == Constant.ServiceResultStatus.Success)
  7949. {
  7950. actionResult.Status = (int)Constant.PDAResult.Success;
  7951. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  7952. }
  7953. else
  7954. {
  7955. actionResult.Status = (int)Constant.PDAResult.Fail;
  7956. actionResult.Message = sre.Message;
  7957. }
  7958. return actionResult;
  7959. }
  7960. // 成型月度结算-明细
  7961. if (action == "GetGroutingSettlementDetail")
  7962. {
  7963. DateTime month = DateTime.Now;
  7964. month = new DateTime(month.Year, month.Month, 1);
  7965. //month = new DateTime(2017, 6, 1);
  7966. int currentMonth = Convert.ToInt32(data["CurrentMonth"]);
  7967. if (currentMonth != 1)
  7968. {
  7969. month = month.AddMonths(-1);
  7970. }
  7971. string goodsCode = data["GoodsCode"].ToString();
  7972. string detailDate = data["DetailDate"].ToString();
  7973. DateTime? date = null;
  7974. if (detailDate != "合计")
  7975. {
  7976. date = DateTime.Parse(detailDate);
  7977. }
  7978. ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementDetail(sUserInfo, month, goodsCode, date);
  7979. if (sre.Status == Constant.ServiceResultStatus.Success)
  7980. {
  7981. actionResult.Status = (int)Constant.PDAResult.Success;
  7982. actionResult.Result = JsonHelper.ToJson(sre.Data);
  7983. }
  7984. else
  7985. {
  7986. actionResult.Status = (int)Constant.PDAResult.Fail;
  7987. actionResult.Message = sre.Message;
  7988. }
  7989. return actionResult;
  7990. }
  7991. // 产成品交接汇总
  7992. if (action == "GetFinishedProductHandoverSum")
  7993. {
  7994. DateTime date = DateTime.Parse(data["date"].ToString());
  7995. ServiceResultEntity sre = ReportModuleLogic.GetRPT0030112NPDAData(date,
  7996. data["goodscode"] as string, sUserInfo);
  7997. if (sre.Status == Constant.ServiceResultStatus.Success)
  7998. {
  7999. actionResult.Status = (int)Constant.PDAResult.Success;
  8000. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8001. }
  8002. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  8003. {
  8004. actionResult.Status = (int)Constant.PDAResult.Success;
  8005. }
  8006. else
  8007. {
  8008. actionResult.Status = (int)Constant.PDAResult.Fail;
  8009. actionResult.Message = sre.Message;
  8010. }
  8011. return actionResult;
  8012. }
  8013. //xuwei add 2019-10-21
  8014. //统计当前工号,当日,按产品编码分组统计半检返修数据数量
  8015. if (action == "GetSemiReworkDayCount")
  8016. {
  8017. //不指定参数查询当天
  8018. string dateStr = DateTime.Now.ToString("yyyy-MM-dd");
  8019. //dateStr = "2019-10-17";
  8020. //指定参数查询特定日期
  8021. if(data.ContainsKey("SemiReworkDate")) dateStr = data["SemiReworkDate"].ToString();
  8022. ServiceResultEntity sre = ReportModuleLogic.GetSemiReworkDayCount(sUserInfo, dateStr);
  8023. if (sre.Status == Constant.ServiceResultStatus.Success)
  8024. {
  8025. actionResult.Status = (int)Constant.PDAResult.Success;
  8026. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8027. }
  8028. else
  8029. {
  8030. actionResult.Status = (int)Constant.PDAResult.Fail;
  8031. actionResult.Message = sre.Message;
  8032. }
  8033. return actionResult;
  8034. }
  8035. //xuwe end
  8036. return actionResult;
  8037. }
  8038. #endregion
  8039. #region 模具管理
  8040. if (module == "PC_Mould")
  8041. {
  8042. #region 模具新建画面数据初始化
  8043. if (action == "GetMouldAddInit")
  8044. {
  8045. ClientRequestEntity cre = new ClientRequestEntity();
  8046. cre.Properties["MouldID"] = 0;
  8047. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002LoadData(sUserInfo, cre);
  8048. if (sre.Status == Constant.ServiceResultStatus.Success)
  8049. {
  8050. actionResult.Status = (int)Constant.PDAResult.Success;
  8051. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8052. }
  8053. else
  8054. {
  8055. actionResult.Status = (int)Constant.PDAResult.Fail;
  8056. actionResult.Message = sre.Message;
  8057. }
  8058. return actionResult;
  8059. }
  8060. #endregion
  8061. #region 验证模具产品型号
  8062. if (action == "CheckGoodsCodeOnMould")
  8063. {
  8064. ClientRequestEntity cre = new ClientRequestEntity();
  8065. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8066. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002GoodsData(sUserInfo, cre);
  8067. if (sre.Status == Constant.ServiceResultStatus.Success &&
  8068. sre.Data.Tables[0].Rows.Count > 0)
  8069. {
  8070. actionResult.Status = (int)Constant.PDAResult.Success;
  8071. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8072. }
  8073. else
  8074. {
  8075. actionResult.Status = (int)Constant.PDAResult.Fail;
  8076. actionResult.Message = "无效产品型号";
  8077. }
  8078. return actionResult;
  8079. }
  8080. #endregion
  8081. #region 验证模具生产工号
  8082. if (action == "CheckUserCodeOnMould")
  8083. {
  8084. DataTable sre = PDAModuleLogic.GetUserCodeOnMould(sUserInfo, data["UserCode"].ToString());
  8085. if (sre != null && sre.Rows.Count > 0)
  8086. {
  8087. actionResult.Status = (int)Constant.PDAResult.Success;
  8088. actionResult.Result = JsonHelper.ToJson(sre);
  8089. }
  8090. else
  8091. {
  8092. actionResult.Status = (int)Constant.PDAResult.Fail;
  8093. actionResult.Message = "无效生产工号";
  8094. }
  8095. return actionResult;
  8096. }
  8097. #endregion
  8098. #region 新建保存
  8099. if (action == "SetMouldAdd" || action == "SetMouldEdit")
  8100. {
  8101. ClientRequestEntity cre = new ClientRequestEntity();
  8102. foreach (string item in data.Keys)
  8103. {
  8104. if (item == "ProductionDate")
  8105. {
  8106. cre.Properties.Add(item, Convert.ToDateTime(data[item]));
  8107. }
  8108. else
  8109. {
  8110. cre.Properties.Add(item, data[item]);
  8111. }
  8112. }
  8113. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1002Data(sUserInfo, cre);
  8114. if (sre.Status == Constant.ServiceResultStatus.Success)
  8115. {
  8116. actionResult.Status = (int)Constant.PDAResult.Success;
  8117. }
  8118. else
  8119. {
  8120. actionResult.Status = (int)Constant.PDAResult.Fail;
  8121. actionResult.Result = sre.OtherStatus;
  8122. actionResult.Message = sre.Message;
  8123. }
  8124. return actionResult;
  8125. }
  8126. #endregion
  8127. #region 模具编辑画面数据初始化
  8128. if (action == "GetMouldEditInfo")
  8129. {
  8130. DataTable sre = PDAModuleLogic.GetMouldEditInfo(sUserInfo, data["MouldBarcode"].ToString());
  8131. if (sre != null && sre.Rows.Count > 0)
  8132. {
  8133. actionResult.Status = (int)Constant.PDAResult.Success;
  8134. actionResult.Result = JsonHelper.ToJson(sre);
  8135. }
  8136. else
  8137. {
  8138. actionResult.Status = (int)Constant.PDAResult.Fail;
  8139. actionResult.Message = "无效模具条码";
  8140. }
  8141. return actionResult;
  8142. }
  8143. #endregion
  8144. #region 模具操作-画面初始化
  8145. if (action == "GetMouldOperationInit")
  8146. {
  8147. ClientRequestEntity cre = new ClientRequestEntity();
  8148. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8149. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8150. if (sre.Status == Constant.ServiceResultStatus.Success)
  8151. {
  8152. actionResult.Status = (int)Constant.PDAResult.Success;
  8153. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8154. }
  8155. else
  8156. {
  8157. actionResult.Status = (int)Constant.PDAResult.Fail;
  8158. actionResult.Result = sre.OtherStatus;
  8159. actionResult.Message = sre.Message;
  8160. }
  8161. return actionResult;
  8162. }
  8163. #endregion
  8164. #region 模具操作-验证模具条码
  8165. if (action == "CheckMouldBarcode")
  8166. {
  8167. ClientRequestEntity cre = new ClientRequestEntity();
  8168. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8169. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8170. if (sre.Status == Constant.ServiceResultStatus.Success)
  8171. {
  8172. if (sre.Data.Tables[0].Rows.Count == 0)
  8173. {
  8174. actionResult.Status = (int)Constant.PDAResult.Fail;
  8175. actionResult.Result = -1;
  8176. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8177. return actionResult;
  8178. }
  8179. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8180. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8181. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8182. #region 报损
  8183. if (mouldOperationType == 2)
  8184. {
  8185. if (mouldStatusID == 1 || mouldStatusID == 3)
  8186. {
  8187. actionResult.Status = (int)Constant.PDAResult.Success;
  8188. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8189. }
  8190. else
  8191. {
  8192. actionResult.Status = (int)Constant.PDAResult.Fail;
  8193. actionResult.Result = -2;
  8194. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8195. }
  8196. return actionResult;
  8197. }
  8198. #endregion
  8199. #region 撤销
  8200. if (mouldOperationType == 3)
  8201. {
  8202. if (mouldStatusID == 4)
  8203. {
  8204. actionResult.Status = (int)Constant.PDAResult.Success;
  8205. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8206. }
  8207. else
  8208. {
  8209. actionResult.Status = (int)Constant.PDAResult.Fail;
  8210. actionResult.Result = -2;
  8211. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行撤销报损操作";
  8212. }
  8213. return actionResult;
  8214. }
  8215. #endregion
  8216. #region 领用
  8217. if (mouldOperationType == 4)
  8218. {
  8219. if (mouldStatusID == 1)
  8220. {
  8221. actionResult.Status = (int)Constant.PDAResult.Success;
  8222. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8223. }
  8224. else
  8225. {
  8226. actionResult.Status = (int)Constant.PDAResult.Fail;
  8227. actionResult.Result = -2;
  8228. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行领用操作";
  8229. }
  8230. return actionResult;
  8231. }
  8232. #endregion
  8233. #region 回收
  8234. if (mouldOperationType == 5)
  8235. {
  8236. if (mouldStatusID == 3)
  8237. {
  8238. actionResult.Status = (int)Constant.PDAResult.Success;
  8239. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8240. }
  8241. else
  8242. {
  8243. actionResult.Status = (int)Constant.PDAResult.Fail;
  8244. actionResult.Result = -2;
  8245. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行回收操作";
  8246. }
  8247. return actionResult;
  8248. }
  8249. #endregion
  8250. #region 变更型号
  8251. if (mouldOperationType == -1)
  8252. {
  8253. if (mouldStatusID != 4)
  8254. {
  8255. actionResult.Status = (int)Constant.PDAResult.Success;
  8256. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8257. }
  8258. else
  8259. {
  8260. actionResult.Status = (int)Constant.PDAResult.Fail;
  8261. actionResult.Result = -2;
  8262. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行变更型号操作";
  8263. }
  8264. return actionResult;
  8265. }
  8266. #endregion
  8267. #region 替换条码
  8268. if (mouldOperationType == -2)
  8269. {
  8270. actionResult.Status = (int)Constant.PDAResult.Success;
  8271. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8272. return actionResult;
  8273. }
  8274. #endregion
  8275. return actionResult;
  8276. }
  8277. }
  8278. #endregion
  8279. #region 模具操作-保存
  8280. if (action == "SetMouldOperation")
  8281. {
  8282. ClientRequestEntity cre = new ClientRequestEntity();
  8283. cre.Properties["MouldIDs"] = string.Join(",", JsonHelper.FromJson<int[]>(data["MouldIDs"].ToString()));
  8284. cre.Properties["MouldOperationType"] = data["MouldOperationType"];
  8285. cre.Properties["Remarks"] = data["Remarks"];
  8286. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8287. if (mouldOperationType == (int)Constant.MouldOperationType.ChangeGoodsCode)
  8288. {
  8289. cre.Properties["GoodsID"] = data["GoodsID"];
  8290. cre.Properties["GoodsCode"] = data["GoodsCode"];
  8291. }
  8292. else if (mouldOperationType == (int)Constant.MouldOperationType.InvToScrap)
  8293. {
  8294. cre.Properties["ScrapReason"] = data["ScrapReason"];
  8295. cre.Properties["ScrapResponsibility"] = data["ScrapRemarks"];
  8296. }
  8297. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1004Data(sUserInfo, cre);
  8298. if (sre.Status == Constant.ServiceResultStatus.Success)
  8299. {
  8300. actionResult.Status = (int)Constant.PDAResult.Success;
  8301. }
  8302. else
  8303. {
  8304. actionResult.Status = (int)Constant.PDAResult.Fail;
  8305. }
  8306. return actionResult;
  8307. }
  8308. #endregion
  8309. #region 模具操作-替换条码
  8310. if (action == "ChangedMouldBarcode")
  8311. {
  8312. ClientRequestEntity cre = new ClientRequestEntity();
  8313. cre.Properties["MouldID"] = data["MouldID"];
  8314. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8315. cre.Properties["NewMouldBarcode"] = data["NewMouldBarcode"];
  8316. cre.Properties["Remarks"] = data["Remarks"];
  8317. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1003Data(sUserInfo, cre);
  8318. if (sre.Status == Constant.ServiceResultStatus.Success)
  8319. {
  8320. actionResult.Status = (int)Constant.PDAResult.Success;
  8321. }
  8322. else
  8323. {
  8324. actionResult.Status = (int)Constant.PDAResult.Fail;
  8325. actionResult.Result = sre.OtherStatus;
  8326. actionResult.Message = sre.Message;
  8327. }
  8328. return actionResult;
  8329. }
  8330. #endregion
  8331. #region 模具跟踪表
  8332. if (action == "GetMoldTracking")
  8333. {
  8334. ClientRequestEntity cre = new ClientRequestEntity();
  8335. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8336. ServiceResultEntity sre = ReportModuleLogic.GetRPT020105Data(cre, sUserInfo);
  8337. if (sre.Status == Constant.ServiceResultStatus.Success)
  8338. {
  8339. actionResult.Status = (int)Constant.PDAResult.Success;
  8340. actionResult.Result = JsonHelper.ToJson(sre.Data);
  8341. }
  8342. else
  8343. {
  8344. actionResult.Status = (int)Constant.PDAResult.Fail;
  8345. actionResult.Message = "此模具条码不存在";
  8346. }
  8347. return actionResult;
  8348. }
  8349. #endregion
  8350. return actionResult;
  8351. }
  8352. #endregion
  8353. #region 成型线模具管理
  8354. if (module == "PC_GroutingLineMould")
  8355. {
  8356. #region 获取当前用户成型线模具管理权限
  8357. if (action == "GetGMouldStatusRight")
  8358. {
  8359. DataTable right = PDAModuleLogic.GetGMouldStatusRight(sUserInfo);
  8360. actionResult.Status = (int)Constant.PDAResult.Success;
  8361. if (right != null && right.Rows.Count > 0)
  8362. {
  8363. actionResult.Result = JsonHelper.ToJson(right);
  8364. }
  8365. return actionResult;
  8366. }
  8367. #endregion
  8368. #region 获取成型线状态等信息,和成型模具信息
  8369. if (action == "GetGroutingLineMould")
  8370. {
  8371. int? groutingLineID = null;
  8372. string groutingLineCode = null;
  8373. if (data.ContainsKey("GroutingLineID"))
  8374. {
  8375. groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8376. }
  8377. else
  8378. {
  8379. groutingLineCode = data["GroutingLineCode"] + "";
  8380. }
  8381. DataSet lineInfo = PDAModuleLogic.GetGroutingLineMould(sUserInfo, groutingLineCode, groutingLineID);
  8382. if (lineInfo == null)
  8383. {
  8384. actionResult.Status = (int)Constant.PDAResult.Fail;
  8385. actionResult.Message = "成型线【" + groutingLineCode + "】不存在或是停用状态";
  8386. }
  8387. else
  8388. {
  8389. actionResult.Status = (int)Constant.PDAResult.Success;
  8390. actionResult.Result = JsonHelper.ToJson(lineInfo);
  8391. }
  8392. return actionResult;
  8393. }
  8394. #endregion
  8395. #region 模具操作-画面初始化
  8396. if (action == "GetMouldOperationInit")
  8397. {
  8398. ClientRequestEntity cre = new ClientRequestEntity();
  8399. cre.Properties["MouldOperationType"] = 2;
  8400. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre);
  8401. if (sre.Status == Constant.ServiceResultStatus.Success)
  8402. {
  8403. actionResult.Status = (int)Constant.PDAResult.Success;
  8404. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8405. }
  8406. else
  8407. {
  8408. actionResult.Status = (int)Constant.PDAResult.Fail;
  8409. actionResult.Result = sre.OtherStatus;
  8410. actionResult.Message = sre.Message;
  8411. }
  8412. return actionResult;
  8413. }
  8414. #endregion
  8415. #region 成型模具操作-画面初始化
  8416. if (action == "GetGroutingMouldOperationInit")
  8417. {
  8418. DataTable initData = PDAModuleLogic.GetGroutingMouldOperationInit(sUserInfo, 6);
  8419. if (initData != null && initData.Rows.Count > 0)
  8420. {
  8421. actionResult.Status = (int)Constant.PDAResult.Success;
  8422. Dictionary<string, string> syssetting = new Dictionary<string, string>();
  8423. foreach (DataRow item in initData.Rows)
  8424. {
  8425. syssetting.Add(item["settingcode"].ToString(), item["settingvalue"].ToString());
  8426. }
  8427. actionResult.Result = JsonHelper.ToJson(syssetting);
  8428. }
  8429. else
  8430. {
  8431. actionResult.Status = (int)Constant.PDAResult.Fail;
  8432. }
  8433. return actionResult;
  8434. }
  8435. #endregion
  8436. #region 模具操作-验证模具条码
  8437. if (action == "CheckMouldBarcode")
  8438. {
  8439. ClientRequestEntity cre = new ClientRequestEntity();
  8440. cre.Properties["MouldBarcode"] = data["MouldBarcode"];
  8441. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre);
  8442. if (sre.Status == Constant.ServiceResultStatus.Success)
  8443. {
  8444. if (sre.Data.Tables[0].Rows.Count == 0)
  8445. {
  8446. actionResult.Status = (int)Constant.PDAResult.Fail;
  8447. actionResult.Result = -1;
  8448. actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在";
  8449. return actionResult;
  8450. }
  8451. int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]);
  8452. int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]);
  8453. string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString();
  8454. #region 上线
  8455. if (mouldOperationType == 6)
  8456. {
  8457. if (mouldStatusID == 1 || mouldStatusID == 3)
  8458. {
  8459. if (data.ContainsKey("GoodsID"))
  8460. {
  8461. if (sre.Data.Tables[0].Rows[0]["GoodsID"] + "" != data["GoodsID"] + "")
  8462. {
  8463. actionResult.Status = (int)Constant.PDAResult.Fail;
  8464. actionResult.Result = -3;
  8465. actionResult.Message =
  8466. "模具【" + data["MouldBarcode"] + "】的产品型号为【" +
  8467. sre.Data.Tables[0].Rows[0]["GoodsCode"] +
  8468. "】与当前不一致";
  8469. return actionResult;
  8470. }
  8471. }
  8472. actionResult.Status = (int)Constant.PDAResult.Success;
  8473. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  8474. }
  8475. else
  8476. {
  8477. actionResult.Status = (int)Constant.PDAResult.Fail;
  8478. actionResult.Result = -2;
  8479. actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作";
  8480. }
  8481. return actionResult;
  8482. }
  8483. #endregion
  8484. return actionResult;
  8485. }
  8486. }
  8487. #endregion
  8488. #region 停用
  8489. if (action == "StopGroutingLineDetail")
  8490. {
  8491. if (data == null || !data.ContainsKey("Details"))
  8492. {
  8493. actionResult.Status = (int)Constant.PDAResult.Fail;
  8494. actionResult.Message = "参数错误";
  8495. return actionResult;
  8496. }
  8497. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8498. DataTable gTable = new DataTable();
  8499. gTable.Columns.Add("GroutingLineID", typeof(int));
  8500. gTable.Columns.Add("GroutingLineCode");
  8501. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8502. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8503. gTable.Columns.Add("GroutingMouldCode");
  8504. gTable.Columns.Add("RecordRemarks");
  8505. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8506. gTable.Columns.Add("MouldID", typeof(int));
  8507. gTable.Columns.Add("MouldCode");
  8508. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8509. string groutingLineCode = data["GroutingLineCode"] + "";
  8510. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8511. foreach (Dictionary<string, object> item in details)
  8512. {
  8513. int? mouldID = null;
  8514. if (item.ContainsKey("MouldID"))
  8515. {
  8516. mouldID = Convert.ToInt32(item["MouldID"]);
  8517. if (mouldID == 0)
  8518. {
  8519. mouldID = null;
  8520. }
  8521. }
  8522. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8523. item["GLineDetailID"], item["GLineDetailCode"],
  8524. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8525. mouldID, item["MouldCode"]);
  8526. }
  8527. int result = PCModuleLogicDAL.StopGroutingLineDetail(gTable, sUserInfo);
  8528. if (result > 0)
  8529. {
  8530. actionResult.Status = (int)Constant.PDAResult.Success;
  8531. }
  8532. else
  8533. {
  8534. actionResult.Status = (int)Constant.PDAResult.Fail;
  8535. actionResult.Result = result;
  8536. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8537. return actionResult;
  8538. }
  8539. return actionResult;
  8540. }
  8541. #endregion
  8542. #region 启用
  8543. if (action == "StartGroutingLineDetail")
  8544. {
  8545. if (data == null || !data.ContainsKey("Details"))
  8546. {
  8547. actionResult.Status = (int)Constant.PDAResult.Fail;
  8548. actionResult.Message = "参数错误";
  8549. return actionResult;
  8550. }
  8551. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8552. DataTable gTable = new DataTable();
  8553. gTable.Columns.Add("GroutingLineID", typeof(int));
  8554. gTable.Columns.Add("GroutingLineCode");
  8555. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8556. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8557. gTable.Columns.Add("GroutingMouldCode");
  8558. gTable.Columns.Add("RecordRemarks");
  8559. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8560. gTable.Columns.Add("MouldID", typeof(int));
  8561. gTable.Columns.Add("MouldCode");
  8562. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8563. string groutingLineCode = data["GroutingLineCode"] + "";
  8564. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8565. foreach (Dictionary<string, object> item in details)
  8566. {
  8567. int? mouldID = null;
  8568. if (item.ContainsKey("MouldID"))
  8569. {
  8570. mouldID = Convert.ToInt32(item["MouldID"]);
  8571. if (mouldID == 0)
  8572. {
  8573. mouldID = null;
  8574. }
  8575. }
  8576. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8577. item["GLineDetailID"], item["GLineDetailCode"],
  8578. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8579. mouldID, item["MouldCode"]);
  8580. }
  8581. int result = PCModuleLogicDAL.StartGroutingLineDetail(gTable, sUserInfo);
  8582. if (result > 0)
  8583. {
  8584. actionResult.Status = (int)Constant.PDAResult.Success;
  8585. }
  8586. else
  8587. {
  8588. actionResult.Status = (int)Constant.PDAResult.Fail;
  8589. actionResult.Result = result;
  8590. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8591. return actionResult;
  8592. }
  8593. return actionResult;
  8594. }
  8595. #endregion
  8596. #region 维修
  8597. if (action == "RepairStartGroutingLineDetail")
  8598. {
  8599. if (data == null || !data.ContainsKey("Details"))
  8600. {
  8601. actionResult.Status = (int)Constant.PDAResult.Fail;
  8602. actionResult.Message = "参数错误";
  8603. return actionResult;
  8604. }
  8605. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8606. DataTable gTable = new DataTable();
  8607. gTable.Columns.Add("GroutingLineID", typeof(int));
  8608. gTable.Columns.Add("GroutingLineCode");
  8609. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8610. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8611. gTable.Columns.Add("GroutingMouldCode");
  8612. gTable.Columns.Add("RecordRemarks");
  8613. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8614. gTable.Columns.Add("MouldID", typeof(int));
  8615. gTable.Columns.Add("MouldCode");
  8616. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8617. string groutingLineCode = data["GroutingLineCode"] + "";
  8618. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8619. foreach (Dictionary<string, object> item in details)
  8620. {
  8621. int? mouldID = null;
  8622. if (item.ContainsKey("MouldID"))
  8623. {
  8624. mouldID = Convert.ToInt32(item["MouldID"]);
  8625. if (mouldID == 0)
  8626. {
  8627. mouldID = null;
  8628. }
  8629. }
  8630. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8631. item["GLineDetailID"], item["GLineDetailCode"],
  8632. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8633. mouldID, item["MouldCode"]);
  8634. }
  8635. int result = PCModuleLogicDAL.RepairStartGroutingLineDetail(gTable, sUserInfo);
  8636. if (result > 0)
  8637. {
  8638. actionResult.Status = (int)Constant.PDAResult.Success;
  8639. }
  8640. else
  8641. {
  8642. actionResult.Status = (int)Constant.PDAResult.Fail;
  8643. actionResult.Result = result;
  8644. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8645. return actionResult;
  8646. }
  8647. return actionResult;
  8648. }
  8649. #endregion
  8650. #region 结束维修
  8651. if (action == "RepairEndGroutingLineDetail")
  8652. {
  8653. if (data == null || !data.ContainsKey("Details"))
  8654. {
  8655. actionResult.Status = (int)Constant.PDAResult.Fail;
  8656. actionResult.Message = "参数错误";
  8657. return actionResult;
  8658. }
  8659. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8660. DataTable gTable = new DataTable();
  8661. gTable.Columns.Add("GroutingLineID", typeof(int));
  8662. gTable.Columns.Add("GroutingLineCode");
  8663. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8664. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8665. gTable.Columns.Add("GroutingMouldCode");
  8666. gTable.Columns.Add("RecordRemarks");
  8667. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8668. gTable.Columns.Add("MouldID", typeof(int));
  8669. gTable.Columns.Add("MouldCode");
  8670. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8671. string groutingLineCode = data["GroutingLineCode"] + "";
  8672. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8673. foreach (Dictionary<string, object> item in details)
  8674. {
  8675. int? mouldID = null;
  8676. if (item.ContainsKey("MouldID"))
  8677. {
  8678. mouldID = Convert.ToInt32(item["MouldID"]);
  8679. if (mouldID == 0)
  8680. {
  8681. mouldID = null;
  8682. }
  8683. }
  8684. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8685. item["GLineDetailID"], item["GLineDetailCode"],
  8686. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8687. mouldID, item["MouldCode"]);
  8688. }
  8689. int result = PCModuleLogicDAL.RepairEndGroutingLineDetail(gTable, sUserInfo);
  8690. if (result > 0)
  8691. {
  8692. actionResult.Status = (int)Constant.PDAResult.Success;
  8693. }
  8694. else
  8695. {
  8696. actionResult.Status = (int)Constant.PDAResult.Fail;
  8697. actionResult.Result = result;
  8698. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8699. return actionResult;
  8700. }
  8701. return actionResult;
  8702. }
  8703. #endregion
  8704. #region 换模
  8705. if (action == "ChangeGMouldStartGroutingLineDetail")
  8706. {
  8707. if (data == null || !data.ContainsKey("Details"))
  8708. {
  8709. actionResult.Status = (int)Constant.PDAResult.Fail;
  8710. actionResult.Message = "参数错误";
  8711. return actionResult;
  8712. }
  8713. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8714. DataTable gTable = new DataTable();
  8715. gTable.Columns.Add("GroutingLineID", typeof(int));
  8716. gTable.Columns.Add("GroutingLineCode");
  8717. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8718. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8719. gTable.Columns.Add("GroutingMouldCode");
  8720. gTable.Columns.Add("RecordRemarks");
  8721. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8722. gTable.Columns.Add("MouldID", typeof(int));
  8723. gTable.Columns.Add("MouldCode");
  8724. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8725. gTable.Columns.Add("MouldStatus", typeof(int));
  8726. gTable.Columns.Add("ScrapReason", typeof(int));
  8727. gTable.Columns.Add("ScrapResponsibility");
  8728. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8729. string groutingLineCode = data["GroutingLineCode"] + "";
  8730. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8731. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8732. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8733. string scrapResponsibility = data["ScrapRemarks"] + "";
  8734. foreach (Dictionary<string, object> item in details)
  8735. {
  8736. int? mouldID = null;
  8737. if (item.ContainsKey("MouldID"))
  8738. {
  8739. mouldID = Convert.ToInt32(item["MouldID"]);
  8740. if (mouldID == 0)
  8741. {
  8742. mouldID = null;
  8743. }
  8744. }
  8745. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8746. item["GLineDetailID"], item["GLineDetailCode"],
  8747. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8748. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8749. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8750. }
  8751. int result = PCModuleLogicDAL.ChangeGMouldStartGroutingLineDetail(gTable, sUserInfo);
  8752. if (result > 0)
  8753. {
  8754. actionResult.Status = (int)Constant.PDAResult.Success;
  8755. }
  8756. else
  8757. {
  8758. actionResult.Status = (int)Constant.PDAResult.Fail;
  8759. actionResult.Result = result;
  8760. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8761. return actionResult;
  8762. }
  8763. return actionResult;
  8764. }
  8765. #endregion
  8766. #region 变产
  8767. if (action == "UpdateLineStartGroutingLineDetail")
  8768. {
  8769. if (data == null || !data.ContainsKey("Details"))
  8770. {
  8771. actionResult.Status = (int)Constant.PDAResult.Fail;
  8772. actionResult.Message = "参数错误";
  8773. return actionResult;
  8774. }
  8775. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8776. DataTable gTable = new DataTable();
  8777. gTable.Columns.Add("GroutingLineID", typeof(int));
  8778. gTable.Columns.Add("GroutingLineCode");
  8779. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8780. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8781. gTable.Columns.Add("GroutingMouldCode");
  8782. gTable.Columns.Add("RecordRemarks");
  8783. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8784. gTable.Columns.Add("MouldID", typeof(int));
  8785. gTable.Columns.Add("MouldCode");
  8786. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8787. gTable.Columns.Add("MouldStatus", typeof(int));
  8788. gTable.Columns.Add("ScrapReason", typeof(int));
  8789. gTable.Columns.Add("ScrapResponsibility");
  8790. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8791. string groutingLineCode = data["GroutingLineCode"] + "";
  8792. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8793. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8794. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8795. string scrapResponsibility = data["ScrapRemarks"] + "";
  8796. foreach (Dictionary<string, object> item in details)
  8797. {
  8798. int? mouldID = null;
  8799. if (item.ContainsKey("MouldID"))
  8800. {
  8801. mouldID = Convert.ToInt32(item["MouldID"]);
  8802. if (mouldID == 0)
  8803. {
  8804. mouldID = null;
  8805. }
  8806. }
  8807. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8808. item["GLineDetailID"], item["GLineDetailCode"],
  8809. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8810. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8811. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8812. }
  8813. int result = PCModuleLogicDAL.UpdateLineStartGroutingLineDetail(gTable, sUserInfo);
  8814. if (result > 0)
  8815. {
  8816. actionResult.Status = (int)Constant.PDAResult.Success;
  8817. }
  8818. else
  8819. {
  8820. actionResult.Status = (int)Constant.PDAResult.Fail;
  8821. actionResult.Result = result;
  8822. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8823. return actionResult;
  8824. }
  8825. return actionResult;
  8826. }
  8827. #endregion
  8828. #region 整线变产
  8829. if (action == "UpdateAllLineStartGroutingLineDetail")
  8830. {
  8831. if (data == null || !data.ContainsKey("Details"))
  8832. {
  8833. actionResult.Status = (int)Constant.PDAResult.Fail;
  8834. actionResult.Message = "参数错误";
  8835. return actionResult;
  8836. }
  8837. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8838. DataTable gTable = new DataTable();
  8839. gTable.Columns.Add("GroutingLineID", typeof(int));
  8840. gTable.Columns.Add("GroutingLineCode");
  8841. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8842. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8843. gTable.Columns.Add("GroutingMouldCode");
  8844. gTable.Columns.Add("RecordRemarks");
  8845. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8846. gTable.Columns.Add("MouldID", typeof(int));
  8847. gTable.Columns.Add("MouldCode");
  8848. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8849. gTable.Columns.Add("MouldStatus", typeof(int));
  8850. gTable.Columns.Add("ScrapReason", typeof(int));
  8851. gTable.Columns.Add("ScrapResponsibility");
  8852. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8853. string groutingLineCode = data["GroutingLineCode"] + "";
  8854. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8855. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8856. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8857. string scrapResponsibility = data["ScrapRemarks"] + "";
  8858. foreach (Dictionary<string, object> item in details)
  8859. {
  8860. int? mouldID = null;
  8861. if (item.ContainsKey("MouldID"))
  8862. {
  8863. mouldID = Convert.ToInt32(item["MouldID"]);
  8864. if (mouldID == 0)
  8865. {
  8866. mouldID = null;
  8867. }
  8868. }
  8869. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8870. item["GLineDetailID"], item["GLineDetailCode"],
  8871. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8872. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8873. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8874. }
  8875. int result = PCModuleLogicDAL.UpdateAllLineStartGroutingLineDetail(gTable, groutingLineID, lineOPTimeStamp, sUserInfo);
  8876. if (result > 0)
  8877. {
  8878. actionResult.Status = (int)Constant.PDAResult.Success;
  8879. }
  8880. else
  8881. {
  8882. actionResult.Status = (int)Constant.PDAResult.Fail;
  8883. actionResult.Result = result;
  8884. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  8885. return actionResult;
  8886. }
  8887. return actionResult;
  8888. }
  8889. #endregion
  8890. #region 卸模
  8891. if (action == "UnloadGroutingLineDetail")
  8892. {
  8893. if (data == null || !data.ContainsKey("Details"))
  8894. {
  8895. actionResult.Status = (int)Constant.PDAResult.Fail;
  8896. actionResult.Message = "参数错误";
  8897. return actionResult;
  8898. }
  8899. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  8900. DataTable gTable = new DataTable();
  8901. gTable.Columns.Add("GroutingLineID", typeof(int));
  8902. gTable.Columns.Add("GroutingLineCode");
  8903. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  8904. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  8905. gTable.Columns.Add("GroutingMouldCode");
  8906. gTable.Columns.Add("RecordRemarks");
  8907. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8908. gTable.Columns.Add("MouldID", typeof(int));
  8909. gTable.Columns.Add("MouldCode");
  8910. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8911. gTable.Columns.Add("MouldStatus", typeof(int));
  8912. gTable.Columns.Add("ScrapReason", typeof(int));
  8913. gTable.Columns.Add("ScrapResponsibility");
  8914. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8915. string groutingLineCode = data["GroutingLineCode"] + "";
  8916. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  8917. int mouldStatus = Convert.ToInt32(data["MouldStatus"]);
  8918. int scrapReason = Convert.ToInt32(data["ScrapReason"]);
  8919. string scrapResponsibility = data["ScrapRemarks"] + "";
  8920. foreach (Dictionary<string, object> item in details)
  8921. {
  8922. int? mouldID = null;
  8923. if (item.ContainsKey("MouldID"))
  8924. {
  8925. mouldID = Convert.ToInt32(item["MouldID"]);
  8926. if (mouldID == 0)
  8927. {
  8928. mouldID = null;
  8929. }
  8930. }
  8931. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  8932. item["GLineDetailID"], item["GLineDetailCode"],
  8933. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8934. mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus,
  8935. (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility);
  8936. }
  8937. int result = PCModuleLogicDAL.UnloadGroutingLineDetail(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 == "ChangeGMouldEndGroutingLineDetail")
  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("RreasonRemarks");
  8969. gTable.Columns.Add("RecordRemarks");
  8970. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  8971. gTable.Columns.Add("MouldID", typeof(int));
  8972. gTable.Columns.Add("MouldCode");
  8973. gTable.Columns.Add("MouldOutputNo", typeof(int));
  8974. gTable.Columns.Add("GoodsID", typeof(int));
  8975. gTable.Columns.Add("GoodsCode");
  8976. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  8977. gTable.Columns.Add("GroutingCount", typeof(int));
  8978. gTable.Columns.Add("MouldSource");
  8979. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  8980. string groutingLineCode = data["GroutingLineCode"] + "";
  8981. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  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"], item["DetailRemarks"],
  8995. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  8996. mouldID, item["MouldCode"], item["MouldOutputNo"],
  8997. item["GoodsID"], item["GoodsCode"],
  8998. item["StandardGroutingCount"], item["GroutingCount"],
  8999. (mouldID == null ? "0" : "1"));
  9000. }
  9001. ServiceResultEntity result = PCModuleLogicDAL.ChangeGMouldEndGroutingLineDetail(gTable, sUserInfo);
  9002. if (result.Status == Constant.ServiceResultStatus.Success)
  9003. {
  9004. actionResult.Status = (int)Constant.PDAResult.Success;
  9005. }
  9006. else if (result.OtherStatus == -100)
  9007. {
  9008. actionResult.Status = (int)Constant.PDAResult.Fail;
  9009. actionResult.Result = -100;
  9010. actionResult.Message = result.Message;
  9011. return actionResult;
  9012. }
  9013. else
  9014. {
  9015. actionResult.Status = (int)Constant.PDAResult.Fail;
  9016. actionResult.Result = -500;
  9017. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9018. return actionResult;
  9019. }
  9020. return actionResult;
  9021. }
  9022. #endregion
  9023. #region 结束变产
  9024. if (action == "UpdateLineEndGroutingLineDetail")
  9025. {
  9026. if (data == null || !data.ContainsKey("Details"))
  9027. {
  9028. actionResult.Status = (int)Constant.PDAResult.Fail;
  9029. actionResult.Message = "参数错误";
  9030. return actionResult;
  9031. }
  9032. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9033. DataTable gTable = new DataTable();
  9034. gTable.Columns.Add("GroutingLineID", typeof(int));
  9035. gTable.Columns.Add("GroutingLineCode");
  9036. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9037. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9038. gTable.Columns.Add("GroutingMouldCode");
  9039. gTable.Columns.Add("RreasonRemarks");
  9040. gTable.Columns.Add("RecordRemarks");
  9041. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9042. gTable.Columns.Add("MouldID", typeof(int));
  9043. gTable.Columns.Add("MouldCode");
  9044. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9045. gTable.Columns.Add("GoodsID", typeof(int));
  9046. gTable.Columns.Add("GoodsCode");
  9047. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9048. gTable.Columns.Add("GroutingCount", typeof(int));
  9049. gTable.Columns.Add("MouldSource");
  9050. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9051. string groutingLineCode = data["GroutingLineCode"] + "";
  9052. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9053. foreach (Dictionary<string, object> item in details)
  9054. {
  9055. int? mouldID = null;
  9056. if (item.ContainsKey("MouldID"))
  9057. {
  9058. mouldID = Convert.ToInt32(item["MouldID"]);
  9059. if (mouldID == 0)
  9060. {
  9061. mouldID = null;
  9062. }
  9063. }
  9064. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9065. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9066. item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]),
  9067. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9068. item["GoodsID"], item["GoodsCode"],
  9069. item["StandardGroutingCount"], item["GroutingCount"],
  9070. (mouldID == null ? "0" : "1"));
  9071. }
  9072. ServiceResultEntity result = PCModuleLogicDAL.UpdateLineEndGroutingLineDetail(gTable, 0, sUserInfo);
  9073. if (result.Status == Constant.ServiceResultStatus.Success)
  9074. {
  9075. actionResult.Status = (int)Constant.PDAResult.Success;
  9076. }
  9077. else if (result.OtherStatus == -100)
  9078. {
  9079. actionResult.Status = (int)Constant.PDAResult.Fail;
  9080. actionResult.Result = -100;
  9081. actionResult.Message = result.Message;
  9082. return actionResult;
  9083. }
  9084. else
  9085. {
  9086. actionResult.Status = (int)Constant.PDAResult.Fail;
  9087. actionResult.Result = -500;
  9088. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9089. return actionResult;
  9090. }
  9091. return actionResult;
  9092. }
  9093. #endregion
  9094. #region 结束整线变产
  9095. if (action == "UpdateAllLineEndGroutingLineDetail")
  9096. {
  9097. if (data == null || !data.ContainsKey("Details"))
  9098. {
  9099. actionResult.Status = (int)Constant.PDAResult.Fail;
  9100. actionResult.Message = "参数错误";
  9101. return actionResult;
  9102. }
  9103. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9104. DataTable gTable = new DataTable();
  9105. gTable.Columns.Add("GroutingLineID", typeof(int));
  9106. gTable.Columns.Add("GroutingLineCode");
  9107. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9108. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9109. gTable.Columns.Add("GroutingMouldCode");
  9110. gTable.Columns.Add("Remarks");
  9111. gTable.Columns.Add("RecordRemarks");
  9112. //gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9113. gTable.Columns.Add("MouldID", typeof(int));
  9114. gTable.Columns.Add("MouldCode");
  9115. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9116. gTable.Columns.Add("GoodsID", typeof(int));
  9117. gTable.Columns.Add("GoodsCode");
  9118. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9119. gTable.Columns.Add("GroutingCount", typeof(int));
  9120. gTable.Columns.Add("MouldSource");
  9121. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9122. string groutingLineCode = data["GroutingLineCode"] + "";
  9123. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9124. foreach (Dictionary<string, object> item in details)
  9125. {
  9126. int? mouldID = null;
  9127. if (item.ContainsKey("MouldID"))
  9128. {
  9129. mouldID = Convert.ToInt32(item["MouldID"]);
  9130. if (mouldID == 0)
  9131. {
  9132. mouldID = null;
  9133. }
  9134. }
  9135. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9136. item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"],
  9137. item["RecordRemarks"], //Convert.ToDateTime(item["OPTimeStamp"]),
  9138. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9139. item["GoodsID"], item["GoodsCode"],
  9140. item["StandardGroutingCount"], item["GroutingCount"],
  9141. (mouldID == null ? "0" : "1"));
  9142. }
  9143. ServiceResultEntity result = PCModuleLogicDAL.UpdateAllLineEndGroutingLineDetail(gTable, null, groutingLineID, lineOPTimeStamp, sUserInfo);
  9144. if (result.Status == Constant.ServiceResultStatus.Success)
  9145. {
  9146. actionResult.Status = (int)Constant.PDAResult.Success;
  9147. }
  9148. else if (result.OtherStatus == -100)
  9149. {
  9150. actionResult.Status = (int)Constant.PDAResult.Fail;
  9151. actionResult.Result = -100;
  9152. actionResult.Message = result.Message;
  9153. return actionResult;
  9154. }
  9155. else
  9156. {
  9157. actionResult.Status = (int)Constant.PDAResult.Fail;
  9158. actionResult.Result = -500;
  9159. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9160. return actionResult;
  9161. }
  9162. return actionResult;
  9163. }
  9164. #endregion
  9165. #region 上模
  9166. if (action == "UpdateGroutingLine_AddMould")
  9167. {
  9168. if (data == null || !data.ContainsKey("Details"))
  9169. {
  9170. actionResult.Status = (int)Constant.PDAResult.Fail;
  9171. actionResult.Message = "参数错误";
  9172. return actionResult;
  9173. }
  9174. Dictionary<string, object>[] details = JsonHelper.FromJson<Dictionary<string, object>[]>(data["Details"].ToString());
  9175. DataTable gTable = new DataTable();
  9176. gTable.Columns.Add("GroutingLineID", typeof(int));
  9177. gTable.Columns.Add("GroutingLineCode");
  9178. gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime));
  9179. gTable.Columns.Add("GroutingLineDetailID", typeof(int));
  9180. gTable.Columns.Add("GroutingMouldCode");
  9181. gTable.Columns.Add("Remarks");
  9182. gTable.Columns.Add("RecordRemarks");
  9183. gTable.Columns.Add("OPTimeStamp", typeof(DateTime));
  9184. gTable.Columns.Add("MouldID", typeof(int));
  9185. gTable.Columns.Add("MouldCode");
  9186. gTable.Columns.Add("MouldOutputNo", typeof(int));
  9187. gTable.Columns.Add("GoodsID", typeof(int));
  9188. gTable.Columns.Add("GoodsCode");
  9189. gTable.Columns.Add("StandardGroutingCount", typeof(int));
  9190. gTable.Columns.Add("GroutingCount", typeof(int));
  9191. gTable.Columns.Add("MouldSource");
  9192. int groutingLineID = Convert.ToInt32(data["GroutingLineID"]);
  9193. string groutingLineCode = data["GroutingLineCode"] + "";
  9194. DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]);
  9195. foreach (Dictionary<string, object> item in details)
  9196. {
  9197. int? mouldID = null;
  9198. if (item.ContainsKey("MouldID"))
  9199. {
  9200. mouldID = Convert.ToInt32(item["MouldID"]);
  9201. if (mouldID == 0)
  9202. {
  9203. mouldID = null;
  9204. }
  9205. }
  9206. int gldID = Convert.ToInt32(item["GLineDetailID"]);
  9207. gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp,
  9208. gldID, item["GLineDetailCode"],
  9209. item["DetailRemarks"], item["RecordRemarks"],
  9210. (gldID > 0 ? (object)Convert.ToDateTime(item["OPTimeStamp"]) : null),
  9211. mouldID, item["MouldCode"], item["MouldOutputNo"],
  9212. item["GoodsID"], item["GoodsCode"],
  9213. item["StandardGroutingCount"], item["GroutingCount"],
  9214. (mouldID == null ? "0" : "1"));
  9215. }
  9216. ServiceResultEntity result = PCModuleLogicDAL.UpdateGroutingLine_AddMould(groutingLineID, groutingLineCode, lineOPTimeStamp, gTable, sUserInfo);
  9217. if (result.Status == Constant.ServiceResultStatus.Success)
  9218. {
  9219. actionResult.Status = (int)Constant.PDAResult.Success;
  9220. }
  9221. else if (result.OtherStatus == -2 || result.OtherStatus == -100)
  9222. {
  9223. actionResult.Status = (int)Constant.PDAResult.Fail;
  9224. actionResult.Result = result.OtherStatus;
  9225. actionResult.Message = result.Message;
  9226. return actionResult;
  9227. }
  9228. else
  9229. {
  9230. actionResult.Status = (int)Constant.PDAResult.Fail;
  9231. actionResult.Result = -500;
  9232. actionResult.Message = "成型线状态已被更改,请刷新成型线数据";
  9233. return actionResult;
  9234. }
  9235. return actionResult;
  9236. }
  9237. #endregion
  9238. return actionResult;
  9239. }
  9240. #endregion
  9241. #region 包装装板限制
  9242. if (module == "FinishedLoadingCar")
  9243. {
  9244. if (action == "GetSetting")
  9245. {
  9246. ClientRequestEntity cre = new ClientRequestEntity();
  9247. cre.Properties["GoodsID"] = data["GoodsID"];
  9248. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFinishedLoadingCarSetting(sUserInfo, cre);
  9249. if (sre.Status == Constant.ServiceResultStatus.Success)
  9250. {
  9251. actionResult.Status = (int)Constant.PDAResult.Success;
  9252. foreach (DataRow item in sre.Data.Tables[0].Rows)
  9253. {
  9254. if (item["settingcode"].ToString() == "S_PM_011")
  9255. {
  9256. cre.Properties["S_PM_011"] = item["settingvalue"];
  9257. }
  9258. else if (item["settingcode"].ToString() == "S_PM_012")
  9259. {
  9260. cre.Properties["S_PM_012"] = item["settingvalue"];
  9261. }
  9262. else if (item["settingcode"].ToString() == "S_PM_013")
  9263. {
  9264. cre.Properties["S_PM_013"] = item["settingvalue"];
  9265. }
  9266. }
  9267. cre.Properties["PlatelitNum"] = sre.Result;
  9268. actionResult.Result = JsonHelper.ToJson(cre.Properties);
  9269. }
  9270. else
  9271. {
  9272. actionResult.Status = (int)Constant.PDAResult.Fail;
  9273. actionResult.Message = "";
  9274. }
  9275. return actionResult;
  9276. }
  9277. }
  9278. #endregion
  9279. #region 成型报损
  9280. if (module == "GroutingScrapProduct")
  9281. {
  9282. // 查询注浆日报明细表
  9283. if ("GetGroutingDailyDetail" == action)
  9284. {
  9285. ClientRequestEntity cre = new ClientRequestEntity();
  9286. cre.NameSpace = module;
  9287. cre.Name = action;
  9288. if (!string.IsNullOrEmpty(jsonData))
  9289. {
  9290. cre.Properties["BarCode"] = data["BarCode"];
  9291. }
  9292. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingDailyDetail(cre, sUserInfo);
  9293. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9294. actionResult.Status = (int)Constant.PDAResult.Success;
  9295. if (sre == null || sre.Data == null || sre.Data.Tables.Count == 0
  9296. || sre.Data.Tables[0].Rows.Count == 0)
  9297. {
  9298. actionResult.Message = "未查询到该产品信息,请确认该产品是否已经进行注浆!";
  9299. actionResult.Status = (int)Constant.PDAResult.Fail;
  9300. }
  9301. else
  9302. {
  9303. DataRow _barCodeRow = sre.Data.Tables[0].Rows[0];
  9304. // 判断是否进行了注浆
  9305. if ("0".Equals(_barCodeRow["GroutingFlag"]))
  9306. {
  9307. actionResult.Message = "该产品还未进行注浆!";
  9308. actionResult.Status = (int)Constant.PDAResult.Fail;
  9309. }
  9310. // 判断是否进行了交坯
  9311. if ("1".Equals(_barCodeRow["DeliverFlag"]))
  9312. {
  9313. actionResult.Message = "该产品已经交坯!";
  9314. actionResult.Status = (int)Constant.PDAResult.Fail;
  9315. }
  9316. // 判断是否已经报损
  9317. if ("1".Equals(_barCodeRow["ScrapFlag"]))
  9318. {
  9319. actionResult.Message = "该产品已经报损!";
  9320. actionResult.Status = (int)Constant.PDAResult.Fail;
  9321. }
  9322. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9323. }
  9324. }
  9325. // 获取成型报损原因
  9326. else if ("GetScrapReasonData" == action)
  9327. {
  9328. ClientRequestEntity cre = new ClientRequestEntity();
  9329. cre.NameSpace = module;
  9330. cre.Name = action;
  9331. ServiceResultEntity sre = SystemModuleLogic.GetScrapReasonData(cre, sUserInfo);
  9332. actionResult.Status = (int)Constant.PDAResult.Success;
  9333. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9334. }
  9335. // 保存成型报损
  9336. else if ("SaveGroutingScrapProduct" == action)
  9337. {
  9338. ClientRequestEntity cre = new ClientRequestEntity();
  9339. cre.NameSpace = module;
  9340. cre.Name = action;
  9341. if (!string.IsNullOrEmpty(jsonData))
  9342. {
  9343. // DataSet returnData = JsonHelper.FromJson<DataSet>(jsonData);
  9344. DataTable dt = JsonHelper.FromJson<DataTable>(data["Table"] + "");
  9345. DataTable dtResponsible = JsonHelper.FromJson<DataTable>(data["Table1"] + "");
  9346. if (dt != null && dt.Rows.Count > 0)
  9347. {
  9348. // 总单信息
  9349. DataRow properties = dt.Rows[0];
  9350. cre.Properties["BarCode"] = properties["BarCode"]; // 产品条码
  9351. cre.Properties["GoodsID"] = properties["GoodsID"]; // 产品ID
  9352. cre.Properties["GoodsCode"] = properties["GoodsCode"]; // 产品编码
  9353. cre.Properties["GoodsName"] = properties["GoodsName"]; // 产品名称
  9354. cre.Properties["GroutingDailyID"] = properties["GroutingDailyID"]; // 注浆日报ID
  9355. cre.Properties["GroutingDailyDetailID"] = properties["GroutingDailyDetailID"]; // 注浆日报明细ID
  9356. cre.Properties["GroutingDate"] = properties["GroutingDate"]; // 注浆日期
  9357. cre.Properties["GroutingLineID"] = properties["GroutingLineID"]; // 成型生产线ID
  9358. cre.Properties["GroutingLineCode"] = properties["GroutingLineCode"]; // 成型生产线编码
  9359. cre.Properties["GroutingLineName"] = properties["GroutingLineName"]; // 成型生产线名称
  9360. cre.Properties["GMouldTypeID"] = properties["GMouldTypeID"]; // 成型线类型ID
  9361. cre.Properties["GroutingLineDetailID"] = properties["GroutingLineDetailID"]; // 成型生产线明细ID
  9362. cre.Properties["GroutingMouldCode"] = properties["GroutingMouldCode"]; // 注浆模具编号
  9363. cre.Properties["MouldCode"] = properties["MouldCode"]; // 模具编号
  9364. cre.Properties["GroutingUserID"] = properties["GroutingUserID"]; // 注浆工号ID
  9365. cre.Properties["GroutingUserCode"] = properties["GroutingUserCode"]; // 注浆工号编码
  9366. cre.Properties["GroutingNum"] = properties["GroutingNum"]; // 注浆次数
  9367. cre.Properties["ScrapType"] = properties["ScrapType"]; // 损坯类型
  9368. cre.Properties["ScrapDate"] = properties["ScrapDate"]; // 报损日期
  9369. cre.Properties["ScrapRreasonID"] = properties["ScrapRreasonID"]; // 报损日期
  9370. cre.Properties["ResponUserID"] = properties["ResponUserID"]; // 损坯工号
  9371. cre.Properties["ResponUserCode"] = properties["ResponUserCode"];
  9372. cre.Properties["Remarks"] = properties["Remarks"]; // 备注
  9373. cre.Properties["AuditStatus"] = properties["AuditStatus"]; // 审批状态
  9374. // 责任员工
  9375. cre.Data = new DataSet();
  9376. //DataTable returnTable = returnData.Tables[1].Copy();
  9377. cre.Data.Tables.Add(dtResponsible);
  9378. }
  9379. }
  9380. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveGroutingScrapProduct(cre, sUserInfo);
  9381. if (sre.Status == Constant.ServiceResultStatus.Success)
  9382. {
  9383. actionResult.Status = (int)Constant.PDAResult.Success;
  9384. actionResult.Result = sre.Result;
  9385. }
  9386. else
  9387. {
  9388. actionResult.Status = (int)Constant.PDAResult.Fail;
  9389. actionResult.Result = sre.OtherStatus;
  9390. actionResult.Message = sre.Message;
  9391. }
  9392. }
  9393. // 获取成型报损信息 用于撤销使用
  9394. else if ("GetGroutingScrapProduct" == action)
  9395. {
  9396. ClientRequestEntity cre = new ClientRequestEntity();
  9397. cre.NameSpace = module;
  9398. cre.Name = action;
  9399. if (!string.IsNullOrEmpty(jsonData))
  9400. {
  9401. cre.Properties["BarCode"] = data["BarCode"];
  9402. }
  9403. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrapProduct(cre, sUserInfo);
  9404. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9405. actionResult.Status = (int)Constant.PDAResult.Success;
  9406. }
  9407. //xuwei add 2020-03-23
  9408. //获取成型报损信息 用于撤销使用 支持 浆日报直接报损
  9409. else if ("GetGroutingScrap" == action)
  9410. {
  9411. ClientRequestEntity cre = new ClientRequestEntity();
  9412. cre.NameSpace = module;
  9413. cre.Name = action;
  9414. if (!string.IsNullOrEmpty(jsonData))
  9415. {
  9416. cre.Properties["BarCode"] = data["BarCode"];
  9417. }
  9418. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrap(cre, sUserInfo);
  9419. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9420. actionResult.Status = (int)Constant.PDAResult.Success;
  9421. }
  9422. // 撤销成型报损
  9423. else if ("ReverseGroutingScrapProduct" == action)
  9424. {
  9425. ClientRequestEntity cre = new ClientRequestEntity();
  9426. cre.NameSpace = module;
  9427. cre.Name = action;
  9428. if (!string.IsNullOrEmpty(jsonData))
  9429. {
  9430. cre.Properties["BarCode"] = data["BarCode"];
  9431. }
  9432. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.ReverseGroutingScrapProduct(cre, sUserInfo);
  9433. if (sre.Status == Constant.ServiceResultStatus.Success)
  9434. {
  9435. actionResult.Status = (int)Constant.PDAResult.Success;
  9436. actionResult.Result = sre.Result;
  9437. }
  9438. else
  9439. {
  9440. actionResult.Status = (int)Constant.PDAResult.Fail;
  9441. actionResult.Result = sre.OtherStatus;
  9442. actionResult.Message = sre.Message;
  9443. }
  9444. }
  9445. }
  9446. #endregion
  9447. #region 产品挂起
  9448. if (module == "ProductSuspend")
  9449. {
  9450. // 获取可以挂起的工序(干补、装车、入窑、出窑)工序不能挂起
  9451. if (action == "GetSuspendProcedure")
  9452. {
  9453. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProcedure(sUserInfo);
  9454. if (sre.Status == Constant.ServiceResultStatus.Success)
  9455. {
  9456. actionResult.Status = (int)Constant.PDAResult.Success;
  9457. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9458. }
  9459. else
  9460. {
  9461. actionResult.Status = (int)Constant.PDAResult.Fail;
  9462. actionResult.Message = sre.Message;
  9463. }
  9464. return actionResult;
  9465. }
  9466. // 验证挂起条码
  9467. if (action == "CheckSuspendBarcode")
  9468. {
  9469. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckSuspendBarcode(sUserInfo, data["barcode"] + "");
  9470. if (sre.Status == Constant.ServiceResultStatus.Success)
  9471. {
  9472. actionResult.Status = (int)Constant.PDAResult.Success;
  9473. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9474. }
  9475. else
  9476. {
  9477. actionResult.Status = (int)Constant.PDAResult.Fail;
  9478. actionResult.Message = sre.Message;
  9479. }
  9480. return actionResult;
  9481. }
  9482. // 挂起条码
  9483. if (action == "SaveSuspendProduct")
  9484. {
  9485. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9486. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9487. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveSuspendProduct(sUserInfo, pids, gids, data["remarks"] + "");
  9488. if (sre.Status == Constant.ServiceResultStatus.Success)
  9489. {
  9490. actionResult.Status = (int)Constant.PDAResult.Success;
  9491. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9492. }
  9493. else
  9494. {
  9495. actionResult.Status = (int)Constant.PDAResult.Fail;
  9496. actionResult.Message = sre.Message;
  9497. }
  9498. return actionResult;
  9499. }
  9500. // 撤销挂起条码
  9501. if (action == "DeleteSuspendProduct")
  9502. {
  9503. int[] gids = JsonHelper.FromJson<int[]>(data["groutingdailydetailids"] + "");
  9504. int[] pids = JsonHelper.FromJson<int[]>(data["procedureids"] + "");
  9505. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.DeleteSuspendProduct(sUserInfo, pids, gids);
  9506. if (sre.Status == Constant.ServiceResultStatus.Success)
  9507. {
  9508. actionResult.Status = (int)Constant.PDAResult.Success;
  9509. //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9510. }
  9511. else
  9512. {
  9513. actionResult.Status = (int)Constant.PDAResult.Fail;
  9514. actionResult.Message = sre.Message;
  9515. }
  9516. return actionResult;
  9517. }
  9518. // 查询挂起条码
  9519. if (action == "GetSuspendProduct")
  9520. {
  9521. ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProduct(sUserInfo, data["barcode"] + "");
  9522. if (sre.Status == Constant.ServiceResultStatus.Success)
  9523. {
  9524. if (sre.Data.Tables[0].Rows.Count == 0)
  9525. {
  9526. actionResult.Status = (int)Constant.PDAResult.Fail;
  9527. actionResult.Message = "此条码没有可撤销的挂起信息";
  9528. }
  9529. else
  9530. {
  9531. actionResult.Status = (int)Constant.PDAResult.Success;
  9532. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9533. }
  9534. }
  9535. else
  9536. {
  9537. actionResult.Status = (int)Constant.PDAResult.Fail;
  9538. actionResult.Message = sre.Message;
  9539. }
  9540. return actionResult;
  9541. }
  9542. }
  9543. #endregion
  9544. #region 品保抽查
  9545. if (module == "QASpotCheck")
  9546. {
  9547. if (action == "GetAllQASpotCheck")
  9548. {
  9549. ClientRequestEntity cre = new ClientRequestEntity();
  9550. cre.NameSpace = module;
  9551. cre.Name = action;
  9552. if (data != null && data.Count > 0)
  9553. {
  9554. foreach (string item in data.Keys)
  9555. {
  9556. if (item.StartsWith("checktime"))
  9557. {
  9558. cre.Properties.Add(item, DateTime.ParseExact(data[item] + "", "yyyy-MM-dd", null));
  9559. }
  9560. else
  9561. {
  9562. cre.Properties.Add(item, data[item]);
  9563. }
  9564. }
  9565. }
  9566. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetAllQASpotCheck(sUserInfo, cre));
  9567. if (sre.Status == Constant.ServiceResultStatus.Success)
  9568. {
  9569. actionResult.Status = (int)Constant.PDAResult.Success;
  9570. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9571. }
  9572. else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults)
  9573. {
  9574. actionResult.Status = (int)Constant.PDAResult.Success;
  9575. }
  9576. else
  9577. {
  9578. actionResult.Status = (int)Constant.PDAResult.Fail;
  9579. actionResult.Message = sre.Message;
  9580. }
  9581. return actionResult;
  9582. }
  9583. if (action == "AutoSaveQASpotCheck")
  9584. {
  9585. string barcode = data["barcode"] + "";
  9586. string remarks = data["remarks"] + "";
  9587. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.AutoSaveQASpotCheck(sUserInfo, barcode, remarks));
  9588. if (sre.Status == Constant.ServiceResultStatus.Success)
  9589. {
  9590. actionResult.Status = (int)Constant.PDAResult.Success;
  9591. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9592. }
  9593. else
  9594. {
  9595. actionResult.Status = (int)Constant.PDAResult.Fail;
  9596. actionResult.Message = sre.Message;
  9597. }
  9598. return actionResult;
  9599. }
  9600. if (action == "CheckQASpotCheck")
  9601. {
  9602. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckQASpotCheck(sUserInfo, jsonData));
  9603. if (sre.Status == Constant.ServiceResultStatus.Success)
  9604. {
  9605. actionResult.Status = (int)Constant.PDAResult.Success;
  9606. actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]);
  9607. }
  9608. else
  9609. {
  9610. actionResult.Status = (int)Constant.PDAResult.Fail;
  9611. actionResult.Message = sre.Message;
  9612. }
  9613. return actionResult;
  9614. }
  9615. if (action == "SaveQASpotCheck")
  9616. {
  9617. data["CheckTime"] = DateTime.ParseExact(data["CheckTime"] + "", "yyyy-MM-dd HH:mm:ss", null);
  9618. ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveQASpotCheck(sUserInfo, data));
  9619. if (sre.Status == Constant.ServiceResultStatus.Success)
  9620. {
  9621. actionResult.Status = (int)Constant.PDAResult.Success;
  9622. }
  9623. else
  9624. {
  9625. actionResult.Status = (int)Constant.PDAResult.Fail;
  9626. actionResult.Message = sre.Message;
  9627. }
  9628. return actionResult;
  9629. }
  9630. return null;
  9631. }
  9632. #endregion
  9633. #region 产成品交接
  9634. if (module == "FinishedProduct")
  9635. {
  9636. // 设定商标
  9637. if (action == "GetFinishedBarcode")
  9638. {
  9639. string barcode = data["barcode"].ToString();
  9640. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 2);
  9641. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9642. if (Convert.ToInt32(resultEntity.Result) < 0)
  9643. {
  9644. actionResult.Status = (int)Constant.PDAResult.Fail;
  9645. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9646. actionResult.Message = resultEntity.Message;
  9647. }
  9648. else
  9649. {
  9650. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9651. actionResult.Status = (int)Constant.PDAResult.Success;
  9652. actionResult.Message = resultEntity.Message;
  9653. }
  9654. return actionResult;
  9655. }
  9656. if (action == "GetHandoveredBarcode")
  9657. {
  9658. string barcode = data["barcode"].ToString();
  9659. ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 1);
  9660. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9661. if (Convert.ToInt32(resultEntity.Result) < 0)
  9662. {
  9663. actionResult.Status = (int)Constant.PDAResult.Fail;
  9664. actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0
  9665. actionResult.Message = resultEntity.Message;
  9666. }
  9667. else
  9668. {
  9669. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9670. actionResult.Status = (int)Constant.PDAResult.Success;
  9671. actionResult.Message = resultEntity.Message;
  9672. }
  9673. return actionResult;
  9674. }
  9675. if (action == "SetFinishedLogo")
  9676. {
  9677. int logoid = Convert.ToInt32(data["logoid"]);
  9678. string[] barcodes = data["barcodes"].ToString().Split(',');
  9679. int result = PMModuleLogicDAL.SetFinishedLogo(barcodes, logoid, sUserInfo);
  9680. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9681. if (result < 0)
  9682. {
  9683. actionResult.Status = (int)Constant.PDAResult.Fail;
  9684. }
  9685. else
  9686. {
  9687. actionResult.Status = (int)Constant.PDAResult.Success;
  9688. }
  9689. return actionResult;
  9690. }
  9691. if (action == "SetHandoveredOrder")
  9692. {
  9693. int orderID = Convert.ToInt32(data["orderID"]);
  9694. string[] barcodes = data["barcodes"].ToString().Split(',');
  9695. int result = PMModuleLogicDAL.SetHandoveredOrder(barcodes, orderID, sUserInfo);
  9696. //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9697. if (result < 0)
  9698. {
  9699. actionResult.Status = (int)Constant.PDAResult.Fail;
  9700. }
  9701. else
  9702. {
  9703. actionResult.Status = (int)Constant.PDAResult.Success;
  9704. }
  9705. return actionResult;
  9706. }
  9707. }
  9708. #endregion
  9709. #region 产成品装车
  9710. /*
  9711. if (module == "FinishedLoading")
  9712. {
  9713. // 设定商标
  9714. if (action == "GetMaxLoadingNo")
  9715. {
  9716. int no = Service.PMModuleService.PMModuleLogic.GetMaxLoadingNo(sUserInfo);
  9717. actionResult.Status = (int)Constant.PDAResult.Success;
  9718. actionResult.Result = no;
  9719. return actionResult;
  9720. }
  9721. if (action == "CheckFinishedLaodingBarcode")
  9722. {
  9723. string barcode = data["barcode"].ToString();
  9724. ServiceResultEntity resultEntity = Service.PMModuleService.PMModuleLogic.CheckFinishedLaodingBarcode(sUserInfo, barcode);
  9725. if (resultEntity.Status == Constant.ServiceResultStatus.Success)
  9726. {
  9727. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9728. actionResult.Status = (int)Constant.PDAResult.Success;
  9729. actionResult.Message = resultEntity.Message;
  9730. }
  9731. else
  9732. {
  9733. actionResult.Status = (int)Constant.PDAResult.Fail;
  9734. actionResult.Result = resultEntity.OtherStatus;
  9735. actionResult.Message = resultEntity.Message;
  9736. }
  9737. return actionResult;
  9738. }
  9739. if (action == "SaveFinishedLoading")
  9740. {
  9741. int loadingNo = Convert.ToInt32(data["loadingNo"]);
  9742. string carLicense = data["carLicense"] + "";
  9743. int palletNum = Convert.ToInt32(data["palletNum"]);
  9744. int goodsNum = Convert.ToInt32(data["goodsNum"]);
  9745. string remarks = data["remarks"] + "";
  9746. Dictionary<string, object>[] details =
  9747. JsonHelper.FromJson<Dictionary<string, object>[]>(data["details"] + "");
  9748. //"[{\"A\":1,\"B\":\"V\"},{\"A\":2,\"B\":\"V1\"}]"
  9749. ServiceResultEntity result = Service.PMModuleService.PMModuleLogic.SaveFinishedLoading(sUserInfo,
  9750. loadingNo, carLicense, palletNum, goodsNum, remarks, details);
  9751. if (result.Status == Constant.ServiceResultStatus.Success)
  9752. {
  9753. actionResult.Status = (int)Constant.PDAResult.Success;
  9754. actionResult.Message = result.Message;
  9755. }
  9756. else
  9757. {
  9758. actionResult.Status = (int)Constant.PDAResult.Fail;
  9759. actionResult.Result = result.OtherStatus;
  9760. actionResult.Message = result.Message;
  9761. }
  9762. return actionResult;
  9763. }
  9764. }
  9765. */
  9766. #endregion
  9767. #region 产成品质量改判
  9768. if (module == "FinishedProductTamper")
  9769. {
  9770. // 获取产成品信息及缺陷数据
  9771. if (action == "GetDefectData")
  9772. {
  9773. string barcode = data["barcode"].ToString();
  9774. ServiceResultEntity sre = PDAModuleLogic.GetDefectData(barcode, sUserInfo);
  9775. if (sre.Status == Constant.ServiceResultStatus.Success)
  9776. {
  9777. actionResult.Status = (int)Constant.PDAResult.Success;
  9778. actionResult.Result = JsonHelper.ToJson(sre.Result);
  9779. actionResult.Message = sre.Message;
  9780. }
  9781. else
  9782. {
  9783. actionResult.Status = (int)Constant.PDAResult.Fail;
  9784. actionResult.Result = sre.OtherStatus;
  9785. actionResult.Message = sre.Message;
  9786. }
  9787. return actionResult;
  9788. }
  9789. // 获取产成品信息及缺陷数据
  9790. if (action == "SaveDefectData")
  9791. {
  9792. ProductionDataEntity productionDataEntity = JsonHelper.FromJson<ProductionDataEntity>(data["ProductionDataEntity"] + "");
  9793. ServiceResultEntity sre = PDAModuleLogic.SaveDefectData(productionDataEntity, sUserInfo);
  9794. if (sre.Status == Constant.ServiceResultStatus.Success)
  9795. {
  9796. actionResult.Status = (int)Constant.PDAResult.Success;
  9797. actionResult.Message = sre.Message;
  9798. }
  9799. else
  9800. {
  9801. actionResult.Status = (int)Constant.PDAResult.Fail;
  9802. actionResult.Message = sre.Message;
  9803. }
  9804. return actionResult;
  9805. }
  9806. // 通过条码查出责任工序(成品改判用)
  9807. if (action == "GetDutyProcedureByBarCodeForTamper")
  9808. {
  9809. string barcode = data["barcode"] + "";
  9810. int defectid = int.Parse(data["defectid"] + "");
  9811. ServiceResultEntity sre = PDAModuleLogic.GetDutyProcedureByBarCodeForTamper(barcode, defectid, sUserInfo.AccountID);
  9812. if (sre.Status == Constant.ServiceResultStatus.Success)
  9813. {
  9814. actionResult.Status = (int)Constant.PDAResult.Success;
  9815. actionResult.Result = JsonHelper.ToJson(sre.Data);
  9816. actionResult.Message = sre.Message;
  9817. }
  9818. else
  9819. {
  9820. actionResult.Status = (int)Constant.PDAResult.Fail;
  9821. actionResult.Result = sre.OtherStatus;
  9822. actionResult.Message = sre.Message;
  9823. }
  9824. return actionResult;
  9825. }
  9826. }
  9827. #endregion
  9828. #region PDA独立功能
  9829. #region 水效标识
  9830. if (module == "WaterEffect")
  9831. {
  9832. // 获取产成品信息及水效标识
  9833. if (action == "GetGoodsByBarCode")
  9834. {
  9835. string barcode = data["barcode"].ToString();
  9836. ServiceResultEntity sre = PDAModuleLogic.GetGoodsByBarCode(barcode, sUserInfo);
  9837. if (sre.Status == Constant.ServiceResultStatus.Success)
  9838. {
  9839. actionResult.Status = (int)Constant.PDAResult.Success;
  9840. actionResult.Result = JsonHelper.ToJson(sre.Result);
  9841. actionResult.Message = sre.Message;
  9842. }
  9843. else
  9844. {
  9845. actionResult.Status = (int)Constant.PDAResult.Fail;
  9846. actionResult.Result = sre.OtherStatus;
  9847. actionResult.Message = sre.Message;
  9848. }
  9849. return actionResult;
  9850. }
  9851. }
  9852. #endregion
  9853. #region 盖板型号
  9854. if (module == "SeatCoverType")
  9855. {
  9856. // 获取产成品信息及水效标识
  9857. if (action == "SendGoodsCodeToPLC")
  9858. {
  9859. string barcode = data["barcode"].ToString();
  9860. int sre = PLCModuleLogic.SendGoodsCodeToPLCBySeatCover(barcode, sUserInfo);
  9861. if (sre == 0)
  9862. {
  9863. actionResult.Status = (int)Constant.PDAResult.Success;
  9864. }
  9865. else
  9866. {
  9867. actionResult.Status = (int)Constant.PDAResult.Fail;
  9868. actionResult.Result = sre;
  9869. switch (sre)
  9870. {
  9871. case 1:
  9872. case 2:
  9873. actionResult.Message = "无效条码";
  9874. break;
  9875. case 3:
  9876. actionResult.Message = "此产品型号没有设置盖板标识码";
  9877. break;
  9878. case 4:
  9879. actionResult.Message = "当前用户没有设置PLC参数";
  9880. break;
  9881. case 5:
  9882. actionResult.Message = "PLC参数设置不全";
  9883. break;
  9884. default:
  9885. actionResult.Message = "PLC通信异常";
  9886. break;
  9887. }
  9888. }
  9889. return actionResult;
  9890. }
  9891. }
  9892. #endregion
  9893. #region PDA PLC 相关功能
  9894. if (module == "PDA_FUN_PLC")
  9895. {
  9896. // PDA扫码发送到PLCServer
  9897. if (action == "SendBarcodeToPLCServer")
  9898. {
  9899. string barcode = data["barcode"].ToString();
  9900. int sre = PLCModuleLogic.SendBarcodeToPLCServer(barcode, sUserInfo);
  9901. if (sre == 0)
  9902. {
  9903. actionResult.Status = (int)Constant.PDAResult.Success;
  9904. }
  9905. else
  9906. {
  9907. actionResult.Status = (int)Constant.PDAResult.Fail;
  9908. actionResult.Result = sre;
  9909. switch (sre)
  9910. {
  9911. case 1:
  9912. case 2:
  9913. actionResult.Message = "无效条码";
  9914. break;
  9915. case 3:
  9916. actionResult.Message = "PLC通信异常";
  9917. break;
  9918. case 4:
  9919. actionResult.Message = "当前用户没有设置PLC参数";
  9920. break;
  9921. case 5:
  9922. actionResult.Message = "PLC参数设置不全";
  9923. break;
  9924. default:
  9925. actionResult.Message = "PLC通信异常";
  9926. break;
  9927. }
  9928. }
  9929. return actionResult;
  9930. }
  9931. }
  9932. #endregion
  9933. #endregion
  9934. #region 半检返修
  9935. if (module == "SemiRework")
  9936. {
  9937. // 验证半检返修条码
  9938. if (action == "CheckSemiReworkBarcode")
  9939. {
  9940. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9941. PMModuleLogic.CheckSemiReworkBarcode(jsonData);
  9942. actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result));
  9943. if (Convert.ToInt32(resultEntity.Result) < 0)
  9944. {
  9945. actionResult.Status = (int)Constant.PDAResult.Fail;
  9946. }
  9947. else
  9948. {
  9949. actionResult.Status = (int)Constant.PDAResult.Success;
  9950. }
  9951. actionResult.Message = resultEntity.Message;
  9952. return actionResult;
  9953. }
  9954. // 可以返修的工序
  9955. if (action == "GetSemiReworkProcedure")
  9956. {
  9957. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9958. PMModuleLogic.GetSemiReworkProcedure(jsonData, sUserInfo);
  9959. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9960. actionResult.Status = (int)Constant.PDAResult.Success;
  9961. return actionResult;
  9962. }
  9963. // 根据条码获取经过的工序,用于责任工序
  9964. if (action == "GetSemiReworkPassProcedure")
  9965. {
  9966. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9967. PMModuleLogic.GetSemiReworkPassProcedure(jsonData);
  9968. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9969. actionResult.Status = (int)Constant.PDAResult.Success;
  9970. return actionResult;
  9971. }
  9972. // 根据所选生产工序(生产数据ID)查询责任员工
  9973. if (action == "GetSemiReworkDefectStaffByProductionDataID")
  9974. {
  9975. int productionDataID = Convert.ToInt32(jsonData);
  9976. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9977. PMModuleLogic.GetSemiReworkDefectStaffByProductionDataID(productionDataID);
  9978. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9979. actionResult.Status = (int)Constant.PDAResult.Success;
  9980. return actionResult;
  9981. }
  9982. // 根据所选工号,查出缺陷责任员工
  9983. if (action == "GetSemiReworkDefectStaffByUserID")
  9984. {
  9985. int userID = Convert.ToInt32(jsonData);
  9986. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9987. PMModuleLogic.GetSemiReworkDefectStaffByUserID(userID);
  9988. actionResult.Result = JsonHelper.ToJson(resultEntity.Data);
  9989. actionResult.Status = (int)Constant.PDAResult.Success;
  9990. return actionResult;
  9991. }
  9992. // 新建半检返修
  9993. if (action == "AddSemiRework")
  9994. {
  9995. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"]+"");
  9996. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  9997. PMModuleLogic.AddSemiRework(entity, sUserInfo);
  9998. actionResult.Result = resultEntity.Result;
  9999. actionResult.Message = resultEntity.Message;
  10000. if (Convert.ToInt32(resultEntity.Result) > 0)
  10001. {
  10002. actionResult.Status = (int)Constant.PDAResult.Success;
  10003. }
  10004. else
  10005. {
  10006. actionResult.Status = (int)Constant.PDAResult.Fail;
  10007. }
  10008. return actionResult;
  10009. }
  10010. // 编辑半检返修
  10011. if (action == "EditSemiRework")
  10012. {
  10013. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  10014. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10015. PMModuleLogic.EditSemiRework(entity, sUserInfo);
  10016. actionResult.Result = resultEntity.Result;
  10017. actionResult.Message = resultEntity.Message;
  10018. if (Convert.ToInt32(resultEntity.Result) > 0)
  10019. {
  10020. actionResult.Status = (int)Constant.PDAResult.Success;
  10021. }
  10022. else
  10023. {
  10024. actionResult.Status = (int)Constant.PDAResult.Fail;
  10025. }
  10026. return actionResult;
  10027. }
  10028. // 撤销半检返修
  10029. if (action == "CancelSemiRework")
  10030. {
  10031. SemiReworkEntity entity = JsonHelper.FromJson<SemiReworkEntity>(data["SemiReworkEntity"] + "");
  10032. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10033. PMModuleLogic.CancelSemiRework(entity, sUserInfo);
  10034. actionResult.Result = resultEntity.Result;
  10035. actionResult.Message = resultEntity.Message;
  10036. if (Convert.ToInt32(resultEntity.Result) > 0)
  10037. {
  10038. actionResult.Status = (int)Constant.PDAResult.Success;
  10039. }
  10040. else
  10041. {
  10042. actionResult.Status = (int)Constant.PDAResult.Fail;
  10043. }
  10044. return actionResult;
  10045. }
  10046. // 获取半检返修数据(PDA编辑用)
  10047. if (action == "GetSemiReworkByID")
  10048. {
  10049. int id = Convert.ToInt32(jsonData);
  10050. ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService.
  10051. PMModuleLogic.GetSemiReworkByID(id,sUserInfo.UserCode);
  10052. DataTable data1 = resultEntity.Data.Tables[0];
  10053. DataTable data2 = resultEntity.Data.Tables[1];
  10054. DataTable data3 = resultEntity.Data.Tables[2];
  10055. if (data1.Rows.Count == 0)
  10056. {
  10057. actionResult.Status = (int)Constant.PDAResult.Fail;
  10058. actionResult.Message = "半检返修信息不存在";
  10059. return actionResult;
  10060. }
  10061. SemiReworkEntity srEntity = new SemiReworkEntity();
  10062. srEntity.SemiReworkID = id;
  10063. srEntity.BarCode = data1.Rows[0]["BarCode"] + "";
  10064. srEntity.ReworkProcedureID = Convert.ToInt32(data1.Rows[0]["ReworkProcedureID"]);
  10065. srEntity.Remarks = data1.Rows[0]["Remarks"] + "";
  10066. srEntity.SemiReworkDefects = new List<SemiReworkDefectEntity>();
  10067. foreach (DataRow row2 in data2.Rows)
  10068. {
  10069. SemiReworkDefectEntity defectEntity = new SemiReworkDefectEntity();
  10070. srEntity.SemiReworkDefects.Add(defectEntity);
  10071. defectEntity.SemiReworkDefectID = Convert.ToInt32(row2["SemiReworkDefectID"]);
  10072. defectEntity.SemiReworkID = id;
  10073. defectEntity.DefectID = Convert.ToInt32(row2["DefectID"]);
  10074. defectEntity.DefectCode = row2["DefectCode"] + "";
  10075. defectEntity.DefectName = row2["DefectName"] + "";
  10076. defectEntity.DefectPositionID = Convert.ToInt32(row2["DefectPositionID"]);
  10077. defectEntity.DefectPositionCode = row2["DefectPositionCode"] + "";
  10078. defectEntity.DefectPositionName = row2["DefectPositionName"] + "";
  10079. defectEntity.ScrapResponFlag = row2["ScrapResponFlag"] + "";
  10080. defectEntity.DefectProductionDataID = row2["DefectProductionDataID"].ToNullableInt32();
  10081. defectEntity.DefectProcedureID = row2["DefectProcedureID"].ToNullableInt32();
  10082. defectEntity.DefectProcedureCode = row2["DefectProcedureCode"] + "";
  10083. defectEntity.DefectProcedureName = row2["DefectProcedureName"] + "";
  10084. defectEntity.Remarks = row2["Remarks"] + "";
  10085. defectEntity.DefectUserID = Convert.ToInt32(row2["DefectUserID"]);
  10086. defectEntity.DefectUserCode = row2["DefectUserCode"] + "";
  10087. defectEntity.DefectUserName = row2["DefectUserName"] + "";
  10088. defectEntity.DefectResponsibles = new List<SemiReworkRPSEntity>();
  10089. defectEntity.ValueFlag = Convert.ToInt32(row2["ValueFlag"]);
  10090. DataRow[] row3s = data3.Select("SemiReworkDefectID=" + defectEntity.SemiReworkDefectID);
  10091. if (row3s.Length == 0)
  10092. {
  10093. continue;
  10094. }
  10095. foreach (DataRow row3 in row3s)
  10096. {
  10097. SemiReworkRPSEntity semiReworkRPS = new SemiReworkRPSEntity();
  10098. defectEntity.DefectResponsibles.Add(semiReworkRPS);
  10099. semiReworkRPS.SemiReworkDefectID = Convert.ToInt32(row3["SemiReworkDefectID"]);
  10100. semiReworkRPS.StaffID = Convert.ToInt32(row3["StaffID"]);
  10101. semiReworkRPS.StaffName = row3["StaffName"] + "";
  10102. semiReworkRPS.StaffCode = row3["StaffCode"] + "";
  10103. semiReworkRPS.SemiReworkID = Convert.ToInt32(row3["SemiReworkID"]);
  10104. semiReworkRPS.UserID = Convert.ToInt32(row3["UserID"]);
  10105. semiReworkRPS.UserCode = row3["UserCode"] + "";
  10106. semiReworkRPS.UJobsID = Convert.ToInt32(row3["UJobsID"]);
  10107. semiReworkRPS.SJobsID = Convert.ToInt32(row3["SJobsID"]);
  10108. }
  10109. }
  10110. //xuwei note 总单用于显示,信息较全
  10111. actionResult.Message = JsonHelper.ToJson(data1);
  10112. //xuwei note 总单信息不全,但有明细,用于回传保存
  10113. actionResult.Result = JsonHelper.ToJson(srEntity);
  10114. actionResult.Status = (int)Constant.PDAResult.Success;
  10115. }
  10116. }
  10117. #endregion
  10118. #region 窑车漏扫补件
  10119. if (module == "F_PM_0504")
  10120. {
  10121. // 验证窑车编码是否存在
  10122. if (action == "CheckKilnCar")
  10123. {
  10124. ClientRequestEntity cre = new ClientRequestEntity();
  10125. cre.Properties["kilncarcode"] = data["KilnCarCode"];
  10126. cre.Properties["procedureID"] = data["ProcedureID"];
  10127. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCar(cre, sUserInfo);
  10128. if (sre.Status == Constant.ServiceResultStatus.Success)
  10129. {
  10130. actionResult.Status = (int)Constant.PDAResult.Success;
  10131. actionResult.Result = sre.Result;
  10132. }
  10133. else
  10134. {
  10135. actionResult.Status = (int)Constant.PDAResult.Fail;
  10136. actionResult.Message = sre.Message;
  10137. }
  10138. return actionResult;
  10139. }
  10140. // 验证窑车烧成批次号是否存在 和 是否能补漏扫
  10141. if (action == "CheckKilnCarBatchNo")
  10142. {
  10143. ClientRequestEntity cre = new ClientRequestEntity();
  10144. cre.Properties["KilnID"] = data["KilnID"];
  10145. cre.Properties["KilnCarID"] = data["KilnCarID"];
  10146. cre.Properties["ProcedureID"] = data["ProcedureID"];
  10147. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  10148. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCarBatchNo(cre, sUserInfo);
  10149. if (sre.Status == Constant.ServiceResultStatus.Success)
  10150. {
  10151. actionResult.Status = (int)Constant.PDAResult.Success;
  10152. }
  10153. else
  10154. {
  10155. actionResult.Status = (int)Constant.PDAResult.Fail;
  10156. actionResult.Message = sre.Message;
  10157. }
  10158. return actionResult;
  10159. }
  10160. // 窑车漏扫补件
  10161. if (action == "SetKilnCarMissing")
  10162. {
  10163. ClientRequestEntity cre = new ClientRequestEntity();
  10164. cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
  10165. string carData = data["CarData"] + "";
  10166. DataTable dataTable = JsonHelper.FromJson<DataTable>(carData);
  10167. cre.Data = new DataSet();
  10168. cre.Data.Tables.Add(dataTable);
  10169. ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.SetKilnCarMissing(cre, sUserInfo);
  10170. if (sre.Status == Constant.ServiceResultStatus.Success)
  10171. {
  10172. actionResult.Status = (int)Constant.PDAResult.Success;
  10173. }
  10174. else
  10175. {
  10176. actionResult.Status = (int)Constant.PDAResult.Fail;
  10177. actionResult.Message = sre.Message;
  10178. }
  10179. return actionResult;
  10180. }
  10181. }
  10182. #endregion
  10183. #region 试验留瓷标记
  10184. if (module == "RetainBarcode")
  10185. {
  10186. #region 留瓷
  10187. if (action == "CheckRetainBarcode")
  10188. {
  10189. string barcode = data["Barcode"] + "";
  10190. ServiceResultEntity sre = PDAModuleLogic.CheckRetainBarcode(barcode, sUserInfo, "1");
  10191. if (sre.OtherStatus >= 0)
  10192. {
  10193. actionResult.Status = (int)Constant.PDAResult.Success;
  10194. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10195. }
  10196. else
  10197. {
  10198. actionResult.Status = (int)Constant.PDAResult.Fail;
  10199. actionResult.Result = sre.OtherStatus;
  10200. actionResult.Message = sre.Message;
  10201. }
  10202. return actionResult;
  10203. }
  10204. else if (action == "SaveRetainFlag")
  10205. {
  10206. string[] barcodes = JsonHelper.FromJson<string[]>(data["Barcodes"] + "");
  10207. ServiceResultEntity sre = PDAModuleLogic.SaveRetainFlag(barcodes, "1");
  10208. if (sre.OtherStatus > 0)
  10209. {
  10210. actionResult.Status = (int)Constant.PDAResult.Success;
  10211. }
  10212. else
  10213. {
  10214. actionResult.Status = (int)Constant.PDAResult.Fail;
  10215. actionResult.Message = sre.Message;
  10216. }
  10217. return actionResult;
  10218. }
  10219. #endregion
  10220. #region 撤销留瓷
  10221. if (action == "CheckBackRetainBarcode")
  10222. {
  10223. string barcode = data["Barcode"] + "";
  10224. ServiceResultEntity sre = PDAModuleLogic.CheckRetainBarcode(barcode, sUserInfo, "0");
  10225. if (sre.OtherStatus >= 0)
  10226. {
  10227. actionResult.Status = (int)Constant.PDAResult.Success;
  10228. actionResult.Result = JsonHelper.ToJson(sre.Data);
  10229. }
  10230. else
  10231. {
  10232. actionResult.Status = (int)Constant.PDAResult.Fail;
  10233. actionResult.Result = sre.OtherStatus;
  10234. actionResult.Message = sre.Message;
  10235. }
  10236. return actionResult;
  10237. }
  10238. else if (action == "SaveBackRetainFlag")
  10239. {
  10240. string[] barcodes = JsonHelper.FromJson<string[]>(data["Barcodes"] + "");
  10241. ServiceResultEntity sre = PDAModuleLogic.SaveRetainFlag(barcodes, "0");
  10242. if (sre.OtherStatus > 0)
  10243. {
  10244. actionResult.Status = (int)Constant.PDAResult.Success;
  10245. }
  10246. else
  10247. {
  10248. actionResult.Status = (int)Constant.PDAResult.Fail;
  10249. actionResult.Message = sre.Message;
  10250. }
  10251. return actionResult;
  10252. }
  10253. #endregion
  10254. }
  10255. #endregion
  10256. return actionResult;
  10257. }
  10258. catch (Exception ex)
  10259. {
  10260. //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
  10261. OutputLog.TraceLog(LogPriority.Error,
  10262. this.ToString(),
  10263. System.Reflection.MethodBase.GetCurrentMethod().Name + System.Environment.NewLine +
  10264. JsonHelper.ToJson(sUserInfo) + System.Environment.NewLine +
  10265. " module:" + module + " action:" + action + " json:" + jsonData,
  10266. ex.ToString(),
  10267. LocalPath.LogExePath);
  10268. actionResult.Status = (int)Constant.PDAResult.Exception;
  10269. actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
  10270. }
  10271. return actionResult;
  10272. }
  10273. #endregion
  10274. }
  10275. }