12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644 |
- package com.cockpit.service;
- import java.io.File;
- import java.io.FileOutputStream;
- import java.io.IOException;
- import java.io.OutputStream;
- import java.io.UnsupportedEncodingException;
- import java.sql.Date;
- import java.text.ParseException;
- import java.text.SimpleDateFormat;
- import java.util.ArrayList;
- import java.util.Collections;
- import java.util.HashMap;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Map;
- import java.util.Set;
- import java.util.UUID;
- import javax.servlet.http.HttpServletRequest;
- import javax.ws.rs.GET;
- import javax.ws.rs.POST;
- import javax.ws.rs.Path;
- import javax.ws.rs.ProduceMime;
- import javax.ws.rs.core.Context;
- import net.sf.json.JSONArray;
- import net.sf.json.JSONException;
- import net.sf.json.JSONObject;
- import org.slf4j.LoggerFactory;
- import sun.misc.BASE64Decoder;
- import com.cockpit.dao.CockpitToolDao;
- import com.cockpit.dao.EarlyWarningResonseDao;
- import com.cockpit.dao.EmergencyDao;
- import com.cockpit.dao.EmergencyResourceDao;
- import com.cockpit.dao.EmergencyResponseDao;
- import com.cockpit.dao.OtherDao;
- import com.cockpit.dao.Tran;
- import com.cockpit.dao.TyphoonDao;
- import com.cockpit.util.CockpitUtil;
- import com.cockpit.util.ConfigManager;
- import com.cockpit.vo.Posi;
- import com.cockpit.vo.Progream;
- import com.cockpit.vo.SaveType;
- import com.cockpit.vo.SimulateTyphoon;
- import com.cockpit.vo.SimulateTyphoonInfo;
- import com.cockpit.vo.Yjzyincident;
- import com.formaction.Utils;
- import com.persistence.service.PersistenceFactory;
- import com.persistence.service.SysPersistence;
- import com.persistence.service.exception.PersistenceException;
- import com.sinosoft.am.org.dept.indept.busi.OrgInDeptBean;
- import com.sinosoft.am.org.dept.indept.vo.OrgInDeptVo;
- import com.sinosoft.cm.common.StringUtils;
- import com.sinosoft.cm.vo.Result;
- import com.sinosoft.common.util.JsonPluginsUtil;
- import com.sinosoft.nwyj.integration.hessian.GpsTaskWebService;
- import com.sysmodel.datamodel.xmlmodel.ModelFactory;
- import com.sysmodel.datamodel.xmlmodel.able.SysModel;
- /**
- * 驾驶舱服务类
- * @author zhumingyue
- *
- */
- @Path("/CockpitService/")
- public class CockpitService{
-
- @Context
- private org.apache.cxf.jaxrs.ext.MessageContext mc;
- private CockpitToolDao ctDao = new CockpitToolDao() ;
- private CockpitUtil cutil = new CockpitUtil();
- private EarlyWarningResonseDao ewerDao = new EarlyWarningResonseDao() ;//应急预警与响应
- private EmergencyResourceDao erDao = new EmergencyResourceDao() ;
- private EmergencyDao emerDao = new EmergencyDao() ;
- private TyphoonDao typhDao = new TyphoonDao();
- private OtherDao otherDao = new OtherDao();
- private Tran tran = new Tran();
- private GpsTaskWebService gpsTaskWebService=new GpsTaskWebService();
- private static final org.slf4j.Logger log = LoggerFactory.getLogger(CockpitService.class);
-
- //=====================================================应急预警与响应start======================================
- /**
- * 应急预警图标信息查询显示
- * @param params
- * @return
- */
- @POST
- @ProduceMime("application/")
- @Path("/getEwMarker/")
- public String getEwMarker(String params){
- log.info(params);
- String companyStr = Utils.getParameter("RELEASE_UNIT", params) ;//发布单位
- String warningNameStr = Utils.getParameter("BM_EMC_WarningName", params) ;//事件类别(预警类别)
- String levelStr = Utils.getParameter("LEVEL",params) ;//预警级别
- String beginTime = Utils.getParameter("BEGINTIME", params) ; //开始时间
- String endTime = Utils.getParameter("ENDTIME", params) ; //截止时间
- String skew = Utils.getParameter("skew", params) ;//偏移
-
-
- String flg = Utils.getParameter("FLG", params) ;
- String init = "new_index = '1' and " ;
-
- if(this.verifyParams(flg)){
- init = "" ;
- }
-
- if(this.verifyParams(companyStr) && this.verifyParams(levelStr) && this.verifyParams(skew)){
- double skewing = Double.parseDouble(skew);
- // String sql = "select a.FD_OBJECTID, a.EARLY_WARNING_NAME, a.CURRENT_EW_LEVEL, a.IS_ALERT, POS_X, POS_Y " +
- // "from (select t1.FD_OBJECTID,t1.release_unit, t1.EARLY_WARNING_NAME, " +
- // "t1.CURRENT_EW_LEVEL, t1.IS_ALERT,t1.is_send,t1.RELEASE_RELIEVE_DATE,ROW_NUMBER() " +
- // "over(partition by RELEASE_UNIT order by RELEASE_RELIEVE_DATE desc) as new_index " +
- // "from ECM_EM_PUBLISH_ALERT_NOTICE as t1 where t1.IS_ALERT = '0' and t1.is_del='0') as a " +
- // "left join ECM_CM_CITYCOORDIATE as b on a.RELEASE_UNIT = b.DEPT_ID " +
- // "where new_index = '1' and a.IS_SEND = '5' and a.IS_ALERT = '0' and b.DISPLAY_POSITION = '1' " ;
-
-
-
- // if(this.verifyParams(warningNameStr))
- // sql += this.getOneSqlWhereLike("EARLY_WARNING_NAME", warningNameStr) ;
- //
-
- String sql = "SELECT FD_OBJECTID, ICON_NAME, EARLY_WARNING_NAME, RELEASE_UNIT, DEPT_NAME, CURRENT_LEVEL, " +
- "RELEASE_RELIEVE_DATE, IS_ALERT, PLAN_TYPE_ID, POS_X, POS_Y FROM GIS_MARKER WHERE IS_ALERT = '0' " ;
- sql += this.getOneSqlWhere("RELEASE_UNIT", companyStr) ;
- sql += this.getOneSqlWhere("CURRENT_LEVEL", levelStr) ;
- if(this.verifyParams(beginTime) && this.verifyParams(endTime))
- sql += "and (RELEASE_RELIEVE_DATE BETWEEN '" + beginTime + " 00:00:00' AND '" + endTime +
- " 23:59:59')" ;
- // return isNullData(ewerDao.getEwrMarkerInfo(sql)) ;//得到全部
- return isNullData(ewerDao.getEwrMarkerInfoByOnlyDept(sql, skewing));//一个单位只得到一个
-
- }
- return null ;
- }
-
- /**
- * 应急预警/响应图标信息查询显示
- * @param params
- * @return
- */
- @POST
- @ProduceMime("application/")
- @Path("/getEwErMarker/")
- public String getEwErMarker(String params){
- log.info(params);
-
- String userName = Utils.getParameter("USER_NAME", params);
- String userId = Utils.getParameter("USER_ID", params);
- String companyStr = Utils.getParameter("RELEASE_UNIT", params) ;//发布单位
- String wulevel = Utils.getParameter("WULEVEL", params);//预警的单位级别
- String rulevel = Utils.getParameter("RULEVEL", params);//预警的单位级别
-
- String searchUnit = Utils.getParameter("SEARCH_UNIT", params);//查询单位
- String levelStr = Utils.getParameter("LEVEL",params) ;//预警级别
- String beginTime = Utils.getParameter("BEGINTIME", params) ; //开始时间
- String endTime = Utils.getParameter("ENDTIME", params) ; //截止时间
- String skew = Utils.getParameter("SKEW", params) ;//偏移
-
-
- if(this.verifyParams(userName) && this.verifyParams(userId) && this.verifyParams(companyStr) &&
- this.verifyParams(skew) && this.verifyParams(wulevel) && this.verifyParams(rulevel)){
- double skewing = Double.parseDouble(skew);
- String sql = "SELECT * FROM ( " +
- "SELECT DISTINCT T1.CURRENT_EW_LEVEL CURRENT_LEVEL, T5.NAME ICON_NAME, T4.POS_X, T4.POS_Y, " +
- "T4.BPOS_X, T4.BPOS_Y, T1.FD_OBJECTID , T1.RELEASE_UNIT, T3.DEPT_NAME, T3.WSDX, " +
- "T1.EARLY_WARNING_NAME, T1.EARLY_WARNING_ID, T1.WETHER_EW_ADJUST, T1.PREV_EW_ID, " +
- "T1.PREV_EW_LEVEL, T1.MEET_EMERGENCIES_PLAN, T1.RELEASE_RELIEVE_DATE, T1.SENT_TIME, " +
- "T1.RELIEVE_DATE, T1.WRITE_DEPT, T1.WRITER, T1.WRITER_ID, T1.WRITE_TIME, T1.IS_DEL, " +
- "T1.CHECK_STATUS, T1.WARNING_RESPONSE_STATUS, T1.IS_SEND, T1.IS_LAST_ID, T1.IS_ALERT, " +
- "T1.PREV_ER_LEVEL, T1.IS_RELIEVE, T1.DISPOSE_PERSON, T1.EVENT_ID, T1.IS_SEEN " +
- "FROM ECM_EM_PUBLISH_ALERT_NOTICE T1 LEFT JOIN ECM_EM_TREATED_HUMAN T2 ON " +
- "T1.FD_OBJECTID=T2.BUSINESS_ID LEFT JOIN SYS_DEPARTMENT_WSDX_VIEW T3 ON " +
- "T1.RELEASE_UNIT = T3.DEPT_ID LEFT JOIN ECM_CM_CITYCOORDIATE T4 ON T3.DEPT_ID = T4.DEPT_ID " +
- "LEFT JOIN ECM_CM_GISICON T5 ON (T1.PLAN_TYPE_ID = T5.PLAN_TYPE_ID AND " +
- "T1.IS_ALERT = T5.IS_ALERT AND T1.CURRENT_EW_LEVEL = T5.TYPE)" +
- "WHERE T1.IS_DEL=0 AND IS_SEND !=6 AND T1.IS_ALERT=0 AND T4.IS_DEL = '0' " +
- "AND T4.DISPLAY_POSITION = '0' AND (( RELEASE_UNIT IN ( SELECT DEPT_ID FROM " +
- "SYS_DEPARTMENT_WSDX_VIEW WHERE PARENT_ID= '"+companyStr+"' ) AND IS_SEND =5 ) OR ( '" +
- companyStr+"' IN ( " +
- "SELECT DEPT_ID FROM SYS_DEPARTMENT_WSDX_VIEW WHERE SYS_DEPARTMENT_WSDX_VIEW.PARENT_ID = " +
- "T1.RELEASE_UNIT ) AND IS_SEND =5 )OR ( ( EARLY_WARNING_AREA_ID LIKE '%" + companyStr + "%' " +
- "OR WRITE_DEPT ='"+companyStr+"' ) AND IS_SEND =5 ) OR ( WRITE_DEPT='" + companyStr +
- "' AND WRITER='"+userName+"' OR ( release_unit='"+companyStr+"' AND T2.PERSON_ID='" + userId +
- "' ) AND T2.IS_DEL=0 AND IS_SEND IN('1', '3', '4') ) OR ( RELEASE_UNIT='" + companyStr +
- "' AND IS_SEND =5 )) AND WSDX IN ("+wulevel+") " +
- "union all( " +
- "SELECT DISTINCT T1.CURRENT_ER_LEVEL CURRENT_LEVEL, T5.NAME ICON_NAME, T4.POS_X, T4.POS_Y, " +
- "T4.BPOS_X, T4.BPOS_Y, T1.FD_OBJECTID , T1.RELEASE_UNIT, T3.DEPT_NAME, T3.WSDX, " +
- "T1.EARLY_WARNING_NAME, T1.EARLY_WARNING_ID, T1.WETHER_EW_ADJUST, T1.PREV_EW_ID, " +
- "T1.PREV_EW_LEVEL, T1.MEET_EMERGENCIES_PLAN, T1.RELEASE_RELIEVE_DATE, T1.SENT_TIME, " +
- "T1.RELIEVE_DATE, T1.WRITE_DEPT, T1.WRITER, T1.WRITER_ID, T1.WRITE_TIME, T1.IS_DEL, " +
- "T1.CHECK_STATUS, T1.WARNING_RESPONSE_STATUS, T1.IS_SEND, T1.IS_LAST_ID, " +
- "T1.IS_ALERT, T1.PREV_ER_LEVEL, T1.IS_RELIEVE, T1.DISPOSE_PERSON, T1.EVENT_ID, T1.IS_SEEN " +
- "FROM ECM_EM_PUBLISH_ALERT_NOTICE T1 LEFT JOIN ECM_EM_TREATED_HUMAN T2 ON " +
- "T1.FD_OBJECTID=T2.BUSINESS_ID LEFT JOIN SYS_DEPARTMENT_WSDX_VIEW T3 ON " +
- "T1.RELEASE_UNIT = T3.DEPT_ID LEFT JOIN ECM_CM_CITYCOORDIATE T4 ON T3.DEPT_ID = T4.DEPT_ID " +
- "LEFT JOIN ECM_CM_GISICON T5 ON (T1.IS_ALERT = T5.IS_ALERT AND T1.CURRENT_ER_LEVEL = T5.TYPE) " +
- "WHERE T1.IS_DEL=0 AND IS_SEND !=6 AND T1.IS_ALERT=1 AND T4.IS_DEL = '0' AND " +
- "T4.DISPLAY_POSITION = '0' AND (( RELEASE_UNIT IN (SELECT DEPT_ID FROM SYS_DEPARTMENT_WSDX_VIEW " +
- "WHERE PARENT_ID='"+companyStr+"' ) AND IS_SEND =5 ) OR ( '"+companyStr+"' IN ( SELECT DEPT_ID FROM " +
- "SYS_DEPARTMENT_WSDX_VIEW WHERE SYS_DEPARTMENT_WSDX_VIEW.PARENT_ID = T1.RELEASE_UNIT ) AND IS_SEND = 5 " +
- ")OR ( (EARLY_WARNING_AREA_ID LIKE '%"+companyStr+"%' OR WRITE_DEPT ='"+companyStr+"') AND IS_SEND =5) " +
- "OR ( WRITE_DEPT='"+companyStr+"' AND WRITER='"+userName+"') OR ( release_unit ='"+companyStr+"' " +
- "AND T2.PERSON_ID='"+userId+"' AND T2.IS_DEL=0 AND IS_SEND IN('1', '3', '4') )OR ( " +
- "RELEASE_UNIT='"+companyStr+"' AND IS_SEND =5 )) AND WSDX IN ("+rulevel+") ) " +
- "ORDER BY WRITE_TIME DESC) WHERE 1=1 " ;
-
- if(this.verifyParams(searchUnit)){
- // System.out.println(searchUnit);
- sql += cutil.getOneSqlWhere("RELEASE_UNIT", searchUnit);
- }
- if(this.verifyParams(levelStr)){
- // System.out.println(levelStr);
- sql += cutil.getOneSqlWhere("CURRENT_LEVEL", levelStr);
- }
- if(this.verifyParams(beginTime) && this.verifyParams(endTime)){
- sql += "and (WRITE_TIME BETWEEN '" + beginTime + "' AND '" + endTime + "')" ;
- }
- // System.out.println(sql);
-
- return isNullData(ewerDao.getEwrBWMarkerInfo(sql, skewing));//一个单位只得到一个
- }
-
- return null;
-
- }
-
- /**
- * 查询图例
- * @param params
- * @return
- */
- @POST
- @ProduceMime("application/json")
- @Path("/getLegend")
- public String getLegend(String params){
- log.info("params");
- String fd_id = Utils.getParameter("fdId", params);
- if(this.verifyParams(fd_id)){
- String sql = "select NAME,CHINA from ECM_CM_GISICON where LAYEROUT = ?" ;
- return otherDao.getLegend(sql,fd_id);
- }
- return null ;
- }
-
- /**
- * 应急响应图标信息查询显示
- * @param params
- * @return
- */
- @POST
- @ProduceMime("application/json")
- @Path("/getErMarker")
- public String getErMarker(String params){
- log.info(params);
- String companyStr = Utils.getParameter("RELEASE_UNIT", params) ;//发布单位
- String warningNameStr = Utils.getParameter("BM_EMC_WarningName", params) ;//事件类别(预警类别)
- String levelStr = Utils.getParameter("LEVEL",params) ;//预警级别
- String beginTime = Utils.getParameter("BEGINTIME", params) ; //开始时间
- String endTime = Utils.getParameter("ENDTIME", params) ; //截止时间
- String skew = Utils.getParameter("skew", params);//偏移
-
- String flg = Utils.getParameter("FLG", params) ;
- String init = "new_index = '1' and " ;
-
- if(this.verifyParams(flg)){
- init = "" ;
- }
- if(this.verifyParams(companyStr) && this.verifyParams(levelStr) && this.verifyParams(skew)){
- // String sql = "select a.FD_OBJECTID, a.EARLY_WARNING_NAME, a.CURRENT_ER_LEVEL, a.IS_ALERT, POS_X, POS_Y " +
- // "from (select t1.fd_objectid,t1.release_unit,t1.early_warning_name,t1.current_er_level, " +
- // "t1.is_alert,t1.is_send,t1.RELEASE_RELIEVE_DATE,ROW_NUMBER() " +
- // "over(partition by RELEASE_UNIT order by RELEASE_RELIEVE_DATE desc) as new_index " +
- // "from ECM_EM_PUBLISH_ALERT_NOTICE as t1 where t1.IS_ALERT = '1' and t1.is_del='0') as a " +
- // "left join ECM_CM_CITYCOORDIATE as b on a.RELEASE_UNIT = b.DEPT_ID " +
- // "where new_index = 1 and a.IS_SEND = '5' and a.IS_ALERT = '1' and b.DISPLAY_POSITION = '2' " ;
-
- // String sql = "select a.FD_OBJECTID, a.EARLY_WARNING_NAME, d.DEPT_NAME, a.CURRENT_ER_LEVEL, a.IS_ALERT, " +
- // "POS_X, POS_Y, name from (select t1.fd_objectid,t1.release_unit, t1.early_warning_name, " +
- // "t1.current_er_level,t1.is_alert,t1.is_send,t1.RELEASE_RELIEVE_DATE,t1.PLAN_TYPE_ID, " +
- // "t1.RELEASE_UNIT,ROW_NUMBER() over( partition by RELEASE_UNIT order by " +
- // "RELEASE_RELIEVE_DATE desc)as new_index from ECM_EM_PUBLISH_ALERT_NOTICE as t1 " +
- // "where t1.IS_ALERT = '1' and t1.is_del='0') as a left join ECM_CM_CITYCOORDIATE " +
- // "as b on a.RELEASE_UNIT = b.DEPT_ID left join ECM_CM_GISICON as c on " +
- // "(a.is_alert = c.is_alert and a.current_er_level = c.type) left join SYS_DEPARTMENT " +
- // /*"as d on a.RELEASE_UNIT = d.dept_id where new_index = 1 and a.IS_SEND = '5' " +*/
- // "as d on a.RELEASE_UNIT = d.dept_id where " + init + "a.IS_SEND = '5' " +
- // "and a.IS_ALERT = '1' and b.DISPLAY_POSITION = '2' ";
- //
- //
- // if(this.verifyParams(warningNameStr))
- // sql += this.getOneSqlWhereLike("EARLY_WARNING_NAME", warningNameStr) ;
-
- double skewing = Double.parseDouble(skew);
-
- String sql = "SELECT FD_OBJECTID, ICON_NAME, EARLY_WARNING_NAME, RELEASE_UNIT, DEPT_NAME, CURRENT_LEVEL, " +
- "RELEASE_RELIEVE_DATE, IS_ALERT, PLAN_TYPE_ID, POS_X, POS_Y FROM GIS_MARKER WHERE IS_ALERT = '1' " ;
- sql += this.getOneSqlWhere("RELEASE_UNIT", companyStr) ;
- sql += this.getOneSqlWhere("CURRENT_LEVEL", levelStr) ;
- if(this.verifyParams(beginTime) && this.verifyParams(endTime))
- sql += "and (RELEASE_RELIEVE_DATE BETWEEN '" + beginTime + " 00:00:00' AND '" + endTime +
- " 23:59:59')" ;
- sql += " ORDER BY RELEASE_RELIEVE_DATE DESC ";
-
- // return isNullData(ewerDao.getEwrMarkerInfo(sql)) ;//得到全部
- return isNullData(ewerDao.getEwrMarkerInfoByOnlyDept(sql, skewing));//一个单位只得到一个
- }
-
- return null ;
- }
-
- // /**
- // * 应急预警图标信息查询显示(网省级)
- // * @param params
- // * @return
- // */
- // @POST
- // @ProduceMime("application/")
- // @Path("/getEwMarkerByProvince/")
- // public String getEwMarkerByProvince(String params){
- //
- // log.info(params);
- // String companyStr = Utils.getParameter("RELEASE_UNIT", params) ;//发布单位
- // String warningNameStr = Utils.getParameter("BM_EMC_WarningName", params) ;//事件类别(预警类别)
- // String levelStr = Utils.getParameter("LEVEL",params) ;//预警级别
- // String beginTime = Utils.getParameter("BEGINTIME", params) ; //开始时间
- // String endTime = Utils.getParameter("ENDTIME", params) ; //截止时间
- //
- //
- // String sql = "select a.FD_OBJECTID, a.EARLY_WARNING_NAME, a.CURRENT_EW_LEVEL, a.IS_ALERT, POS_X, POS_Y " +
- // "from (select t1.FD_OBJECTID,t1.release_unit, t1.EARLY_WARNING_NAME, " +
- // "t1.CURRENT_EW_LEVEL, t1.IS_ALERT,t1.is_send,t1.RELEASE_RELIEVE_DATE,ROW_NUMBER() " +
- // "over(partition by RELEASE_UNIT order by RELEASE_RELIEVE_DATE desc) as new_index " +
- // "from ECM_EM_PUBLISH_ALERT_NOTICE as t1 left join SYS_DEPARTMENT as t2 " +
- // "on t1.release_unit = t2.dept_id where t1.IS_ALERT = '0' and t1.is_del='0' " +
- // "and t2.parent_id = '1' and t2.parent_id = '0' and t2.dept_code is not null and t2.dept_code != '002') as a " +
- // "left join ECM_CM_CITYCOORDIATE as b on a.RELEASE_UNIT = b.DEPT_ID " +
- // "where new_index = '1' and a.IS_SEND = '5' and a.IS_ALERT = '0' and b.DISPLAY_POSITION = '1' " ;
- //
- // if(this.verifyParams(companyStr))
- // sql += this.getOneSqlWhere("RELEASE_UNIT", companyStr) ;
- // if(this.verifyParams(warningNameStr))
- // sql += this.getOneSqlWhereLike("EARLY_WARNING_NAME", warningNameStr) ;
- // if(this.verifyParams(levelStr))
- // sql += this.getOneSqlWhere("CURRENT_EW_LEVEL", levelStr) ;
- // if(this.verifyParams(beginTime) && this.verifyParams(endTime))
- // sql += "and RELEASE_RELIEVE_DATE BETWEEN '" + beginTime + "' AND '" + endTime + "'" ;
- //
- // System.out.println("查询应急预警图标(网省级)SQL:" + sql);
- // return isNullData(ewerDao.getEwrMarkerInfo(sql, "CURRENT_EW_LEVEL")) ;
- //
- // }
- //
- //
- //
- //
- // /**
- // * 应急响应图标信息查询显示(网省级)
- // * @param params
- // * @return
- // */
- // @POST
- // @ProduceMime("application/json")
- // @Path("/getErMarkerByProvince")
- // public String getErMarkerByProvince(String params){
- // log.info(params);
- // String companyStr = Utils.getParameter("RELEASE_UNIT", params) ;//发布单位
- // String warningNameStr = Utils.getParameter("BM_EMC_WarningName", params) ;//事件类别(预警类别)
- // String levelStr = Utils.getParameter("LEVEL",params) ;//预警级别
- // String beginTime = Utils.getParameter("BEGINTIME", params) ; //开始时间
- // String endTime = Utils.getParameter("ENDTIME", params) ; //截止时间
- //
- // String sql = "select a.FD_OBJECTID, a.EARLY_WARNING_NAME, a.CURRENT_ER_LEVEL, a.IS_ALERT, POS_X, POS_Y " +
- // "from (select t1.fd_objectid,t1.release_unit,t1.early_warning_name,t1.current_er_level, " +
- // "t1.is_alert,t1.is_send,t1.RELEASE_RELIEVE_DATE,ROW_NUMBER() " +
- // "over(partition by RELEASE_UNIT order by RELEASE_RELIEVE_DATE desc) as new_index " +
- // "from ECM_EM_PUBLISH_ALERT_NOTICE as t1 left join SYS_DEPARTMENT as t2 " +
- // "on t1.release_unit = t2.dept_id where t1.IS_ALERT = '1' and t1.is_del='0' " +
- // "and (t2.parent_id = '1' or t2.parent_id = '0') and t2.dept_code is not null and t2.dept_code != '002') as a " +
- // "left join ECM_CM_CITYCOORDIATE as b on a.RELEASE_UNIT = b.DEPT_ID " +
- // "where new_index = 1 and a.IS_SEND = '5' and a.IS_ALERT = '1' and b.DISPLAY_POSITION = '2' " ;
- //
- // if(this.verifyParams(companyStr))
- // sql += this.getOneSqlWhere("RELEASE_UNIT", companyStr) ;
- // if(this.verifyParams(warningNameStr))
- // sql += this.getOneSqlWhereLike("EARLY_WARNING_NAME", warningNameStr) ;
- // if(this.verifyParams(levelStr))
- // sql += this.getOneSqlWhere("CURRENT_ER_LEVEL", levelStr) ;
- // if(this.verifyParams(beginTime) && this.verifyParams(endTime))
- // sql += "and RELEASE_RELIEVE_DATE BETWEEN '" + beginTime + "' AND '" + endTime + "'" ;
- //
- // System.out.println("查询应急响应图标(网省级)SQL:" + sql);
- // return isNullData(ewerDao.getEwrMarkerInfo(sql,"CURRENT_ER_LEVEL")) ;
- //
- // }
- //
- // /**
- // * 应急预警图标信息查询显示(地市级)
- // * @param params
- // * @return
- // */
- // @POST
- // @ProduceMime("application/")
- // @Path("/getEwMarkerByPrefecture/")
- // public String getEwMarkerByPrefecture(String params){
- //
- // log.info(params);
- // String companyStr = Utils.getParameter("RELEASE_UNIT", params) ;//发布单位
- // String warningNameStr = Utils.getParameter("BM_EMC_WarningName", params) ;//事件类别(预警类别)
- // String levelStr = Utils.getParameter("LEVEL",params) ;//预警级别
- // String beginTime = Utils.getParameter("BEGINTIME", params) ; //开始时间
- // String endTime = Utils.getParameter("ENDTIME", params) ; //截止时间
- //
- //
- // String sql = "select a.FD_OBJECTID, a.EARLY_WARNING_NAME, a.CURRENT_EW_LEVEL, a.IS_ALERT, POS_X, POS_Y " +
- // "from (select t1.FD_OBJECTID,t1.release_unit, t1.EARLY_WARNING_NAME, " +
- // "t1.CURRENT_EW_LEVEL, t1.IS_ALERT,t1.is_send,t1.RELEASE_RELIEVE_DATE,ROW_NUMBER() " +
- // "over(partition by RELEASE_UNIT order by RELEASE_RELIEVE_DATE desc) as new_index " +
- // "from ECM_EM_PUBLISH_ALERT_NOTICE as t1 left join SYS_DEPARTMENT as t2 " +
- // "on t1.release_unit = t2.dept_id where t1.IS_ALERT = '0' and t1.is_del='0' " +
- // " and t2.parent_id != '1' and t2.parent_id != '0') as a " +
- // "left join ECM_CM_CITYCOORDIATE as b on a.RELEASE_UNIT = b.DEPT_ID " +
- // "where new_index = '1' and a.IS_SEND = '5' and a.IS_ALERT = '0' and b.DISPLAY_POSITION = '1' " ;
- //
- // if(this.verifyParams(companyStr))
- // sql += this.getOneSqlWhere("RELEASE_UNIT", companyStr) ;
- // if(this.verifyParams(warningNameStr))
- // sql += this.getOneSqlWhereLike("EARLY_WARNING_NAME", warningNameStr) ;
- // if(this.verifyParams(levelStr))
- // sql += this.getOneSqlWhere("CURRENT_EW_LEVEL", levelStr) ;
- // if(this.verifyParams(beginTime) && this.verifyParams(endTime))
- // sql += "and RELEASE_RELIEVE_DATE BETWEEN '" + beginTime + "' AND '" + endTime + "'" ;
- //
- // System.out.println("查询应急预警图标(地市级)SQL:" + sql);
- // return isNullData(ewerDao.getEwrMarkerInfo(sql, "CURRENT_EW_LEVEL")) ;
- //
- // }
- //
- // /**
- // * 应急响应图标信息查询显示(地市级)
- // * @param params
- // * @return
- // */
- // @POST
- // @ProduceMime("application/json")
- // @Path("/getErMarkerPrefecture/")
- // public String getErMarkerPrefecture(String params){
- // log.info(params);
- // String companyStr = Utils.getParameter("RELEASE_UNIT", params) ;//发布单位
- // String warningNameStr = Utils.getParameter("BM_EMC_WarningName", params) ;//事件类别(预警类别)
- // String levelStr = Utils.getParameter("LEVEL",params) ;//预警级别
- // String beginTime = Utils.getParameter("BEGINTIME", params) ; //开始时间
- // String endTime = Utils.getParameter("ENDTIME", params) ; //截止时间
- //
- // String sql = "select a.FD_OBJECTID, a.EARLY_WARNING_NAME, a.CURRENT_ER_LEVEL, a.IS_ALERT, POS_X, POS_Y " +
- // "from (select t1.fd_objectid,t1.release_unit,t1.early_warning_name,t1.current_er_level, " +
- // "t1.is_alert,t1.is_send,t1.RELEASE_RELIEVE_DATE,ROW_NUMBER() " +
- // "over(partition by RELEASE_UNIT order by RELEASE_RELIEVE_DATE desc) as new_index " +
- // "from ECM_EM_PUBLISH_ALERT_NOTICE as t1 left join SYS_DEPARTMENT as t2 " +
- // "on t1.release_unit = t2.dept_id where t1.IS_ALERT = '1' and t1.is_del='0' " +
- // "and t2.parent_id != '1' and t2.parent_id != '0') as a " +
- // "left join ECM_CM_CITYCOORDIATE as b on a.RELEASE_UNIT = b.DEPT_ID " +
- // "where new_index = 1 and a.IS_SEND = '5' and a.IS_ALERT = '1' and b.DISPLAY_POSITION = '2' " ;
- //
- // if(this.verifyParams(companyStr))
- // sql += this.getOneSqlWhere("RELEASE_UNIT", companyStr) ;
- // if(this.verifyParams(warningNameStr))
- // sql += this.getOneSqlWhereLike("EARLY_WARNING_NAME", warningNameStr) ;
- // if(this.verifyParams(levelStr))
- // sql += this.getOneSqlWhere("CURRENT_ER_LEVEL", levelStr) ;
- // if(this.verifyParams(beginTime) && this.verifyParams(endTime))
- // sql += "and RELEASE_RELIEVE_DATE BETWEEN '" + beginTime + "' AND '" + endTime + "'" ;
- //
- // System.out.println("查询应急响应图标(地市级)SQL:" + sql);
- // return isNullData(ewerDao.getEwrMarkerInfo(sql,"CURRENT_ER_LEVEL")) ;
- //
- // }
- //
- //======================康国前=======================================//
-
- /**
- * 预警与响应统计
- * @param params
- * @return
- */
- @POST
- @ProduceMime("application/json/")
- @Path("/getEmergencyResponseStatistics/")
- public String getEmergencyResponseStatistics(String params){
- String result = "{}";
- EmergencyResponseDao erDao = new EmergencyResponseDao();
-
- try {
- String comp = Utils.getParameter("comp", params) ;
- List<Map<String, String>> list = erDao.getEmergencyResponseStatistics(comp);
-
- result=StringUtils.resultToJSON(Result.STATE_SUCCESS, list.size(), StringUtils.listToJson(StringUtils.listToJson(list)));
- } catch (Exception e) {
- log.info(e.getMessage());
- result=StringUtils.resultToJSON(Result.STATE_FAILURE, 0, "查询失败");
- }finally{
- log.info("getDetailInfo返回前台数据=="+result);
- return result;
- }
-
- }
-
- /**
- * 预警或响应详细
- * @param params
- * @return
- */
- @POST
- @ProduceMime("application/json/")
- @Path("/queryCompDitaildata/")
- public String queryCompDitaildata(String params){
- String result = "{}";
- EmergencyResponseDao erDao = new EmergencyResponseDao();
-
- try {
- String comp = Utils.getParameter("comp", params) ;
- String is_alert = Utils.getParameter("is_alert", params) ;
- String is_huizong = Utils.getParameter("is_huizong", params) ;
- String culum = Utils.getParameter("culum", params) ;
- String level = Utils.getParameter("level", params) ;
- if(is_huizong != null&&"true".equals(is_huizong)){
- comp = " ( RELEASE_UNIT = '"+comp+"' or RELEASE_UNIT in ( select dept_id from sys_department where parent_id = '"+comp+"' )) ";
- }else{
- comp = " RELEASE_UNIT = '"+comp+"' ";
- }
- List<Map<String, String>> list = erDao.queryCompDitaildata(comp,is_alert,culum,level);
-
- result=StringUtils.resultToJSON(Result.STATE_SUCCESS, list.size(), StringUtils.listToJson(StringUtils.listToJson(list)));
- } catch (Exception e) {
- log.info(e.getMessage());
- result=StringUtils.resultToJSON(Result.STATE_FAILURE, 0, "查询失败");
- }finally{
- log.info("getDetailInfo返回前台数据=="+result);
- return result;
- }
-
- }
- //=============================================================//
-
- //===================================================应急预警与响应end======================================
-
-
-
-
-
- //===================================================应急资源start===============================================
- /**
- * 仓库图标位置(经纬度)查询显示
- * @param params
- * @return
- */
- @POST
- @ProduceMime("application/json/")
- @Path("/queryMareHouse/")
- public String queryMareHouse(String params){
- log.info(params);
- String hb = Utils.getParameter("hb", params);
- String ht = Utils.getParameter("ht", params);
- String hl = Utils.getParameter("hl", params);
- String gt = Utils.getParameter("gt", params);
-
- String sql = null ;
-
- if(this.verifyParams(hb) && this.verifyParams(ht)){
-
- sql = "SELECT OBJECT_ID CODE, WAREHOUSE_NAME NAME,LATITUDE LAT,LONGITUDE LON, " +
- "BELONGING_DEPARTMENT DEPT_NAME, CASE WAREHOUSE_BELONGING WHEN 'A' THEN '中国南方电网' " +
- "WHEN 'G' THEN '供应商' WHEN 'S' THEN '现场施工单位' END HB , CASE WAREHOUSE_TYPE " +
- "WHEN '1' THEN '室内' WHEN '2' THEN '露天' WHEN '3' THEN '组合仓库' END HT, CASE WAREHOUSE_LEVEL " +
- "WHEN '1' THEN '一级混合储备仓库' WHEN '11' THEN '一级报废物资仓库' " +
- "WHEN '12' THEN '一级智能计量仓库' WHEN '13' THEN '一级普通计量仓库' WHEN '14' THEN '区域物流平台' " +
- "WHEN '2' THEN '二级混合仓库' WHEN '3' THEN '急救包' WHEN '4' THEN '待定级' END HL, " +
- "CASE WAREHOUSE_TYPE WHEN '1' THEN 'indoor_house' WHEN '2' THEN 'outdoors_house' WHEN '3' " +
- "THEN 'comb_house' END ICON, " +
- "STORAGE_MATERIAL_TYPE GT, AREA_COVERED AC, ARCHITEC_AREA AA, DETAILED_ADDRESS ADDR, " +
- "WAREHOUSE_PRINCIPAL MAN FROM NWYJ_SERVICE.MM_WAREHOUSEINFO WHERE " +
- "WAREHOUSE_BELONGING = '" + hb + "' AND WAREHOUSE_TYPE = '" + ht + "' " ;
- }else{
- return null;
- }
-
- if(this.verifyParams(hl)){ sql += this.getOneSqlWhere("WAREHOUSE_LEVEL", hl); }
-
- if(this.verifyParams(gt)){ sql += this.getOneSqlWhereLike("STORAGE_MATERIAL_TYPE", gt); }
-
- return erDao.getMareHouse(sql) ;
-
- }
-
- /**
- * 仓库信息查询显示(根据ID查询)
- * @param params
- * @return
- */
- @POST
- @ProduceMime("application/json/")
- @Path("/queryMareHouseById/")
- public String queryMareHouseById(String params){
- log.info(params);
- String fd_id = Utils.getParameter("fd_id", params);
-
- String sql = null ;
- if(this.verifyParams(fd_id)){
- sql = "SELECT * , CASE WAREHOUSE_BELONGING WHEN 'A' THEN '中国南方电网' " +
- "WHEN 'G' THEN '供应商' WHEN 'S' THEN '现场施工单位' END WAREHOUSE_BELONGING_SHOW, " +
- "CASE WAREHOUSE_TYPE WHEN '1' THEN '室内' WHEN '2' THEN '露天' WHEN '3' " +
- "THEN '组合仓库' END WAREHOUSE_TYPE_SHOW, CASE WAREHOUSE_LEVEL WHEN '1' " +
- "THEN '一级混合储备仓库' WHEN '11' THEN '一级报废物资仓库' WHEN '12' THEN " +
- "'一级智能计量仓库' WHEN '13' THEN '一级普通计量仓库' WHEN '14' THEN '区域物流平台' " +
- "WHEN '2' THEN '二级混合仓库' WHEN '3' THEN '急救包' WHEN '4' THEN '待定级' " +
- "END WAREHOUSE_LEVEL_SHOW FROM NWYJ_SERVICE.MM_WAREHOUSEINFO " +
- "WHERE OBJECT_ID = ? " ;
- log.info("仓库信息查询显示(根据ID查询)SQL === " + sql + "; params: " + fd_id);
- return erDao.getMareHouseById(sql, fd_id) ;
-
- }else{
- return null;
- }
-
- }
-
- /**
- * 应急资源标注部门查询
- * @param params
- * @return
- */
- @POST
- @ProduceMime("application/json/")
- @Path("/querySubDept/")
- public String querySubDept(String params) {
- log.info(params) ;
- String comp = Utils.getParameter("unitId", params) ;
-
- String sql = "" ;
- StringBuffer sb = new StringBuffer() ;
- sb.append("{") ;
- if(verifyParams(comp)){
- int flg = this.wsdxDept(comp) ;//得到当前部门的标识12345网省地县其它
-
- List<String> deptList = new ArrayList<String>() ;
- if(flg == 1){
- deptList.add(comp);
- //得到省级Sql
- sql = "SELECT DEPT_ID FROM SYS_DEPARTMENT WHERE IS_DEL = '0' AND PARENT_ID IN (" +
- "SELECT DEPT_ID FROM SYS_DEPARTMENT WHERE PARENT_ID = '0' AND IS_DEL = '0' " +
- "AND DEPT_ID ='" + comp + "') ORDER BY SORT" ;
- deptList = erDao.subDeptIDs(sql) ;
-
- sb.append(this.getErMarkerJson("prov", deptList)) ;
-
- //得到市级SQL
- sql = "SELECT DEPT_ID FROM SYS_DEPARTMENT WHERE IS_DEL = '0' AND PARENT_ID IN (" +
- "SELECT DEPT_ID FROM SYS_DEPARTMENT WHERE IS_DEL = '0' AND PARENT_ID IN (" +
- "SELECT DEPT_ID FROM SYS_DEPARTMENT WHERE PARENT_ID = '0' AND IS_DEL = '0' AND DEPT_ID = '" + comp +
- "'))AND DEPT_NAME LIKE '%供电局%' AND DEPT_ID IS NOT NULL ORDER BY SORT " ;
-
- deptList = erDao.subDeptIDs(sql) ;
-
- //得到县级SQL
- sql = "SELECT DEPT_ID FROM SYS_DEPARTMENT WHERE IS_DEL = '0' AND PARENT_ID IN (" +
- "SELECT DEPT_ID FROM SYS_DEPARTMENT WHERE IS_DEL = '0' AND PARENT_ID IN (" +
- "SELECT DEPT_ID FROM SYS_DEPARTMENT WHERE IS_DEL = '0' AND PARENT_ID IN (" +
- "SELECT DEPT_ID FROM SYS_DEPARTMENT WHERE PARENT_ID = '0' AND IS_DEL = '0' AND DEPT_ID = '" + comp + "' )" +
- ")AND DEPT_NAME LIKE '%供电局%')AND DEPT_NAME LIKE '%供电局%' ORDER BY SORT " ;
- deptList.addAll(erDao.subDeptIDs(sql)) ;
-
- sb.append(this.getErMarkerJson("pref", deptList)) ;
-
- sb.deleteCharAt(sb.length()-1) ;
- sb.append("}") ;
-
- } else if(flg == 2){
-
- sb.append("\"prov\":[\"" + comp + "\"],") ;
-
- sql = "SELECT DEPT_ID FROM SYS_DEPARTMENT WHERE PARENT_ID = '" + comp + "'" +
- "AND DEPT_NAME LIKE '%供电局%' ORDER BY SORT " ;
- deptList = erDao.subDeptIDs(sql) ;
-
- sql = "SELECT DEPT_ID FROM SYS_DEPARTMENT WHERE IS_DEL = '0' AND PARENT_ID IN (" +
- "SELECT DEPT_ID FROM SYS_DEPARTMENT WHERE PARENT_ID = '" + comp + "'" +
- "AND DEPT_NAME LIKE '%供电局%')AND DEPT_NAME LIKE '%供电局%' AND DEPT_ID IS NOT NULL ORDER BY SORT " ;
- deptList.addAll(erDao.subDeptIDs(sql));
-
- sb.append(this.getErMarkerJson("pref", deptList)) ;
- sb.deleteCharAt(sb.length()-1) ;
- sb.append("}") ;
-
-
- } else if(flg == 3){
-
- deptList.add(comp) ;
- sql = "SELECT DEPT_ID FROM SYS_DEPARTMENT WHERE IS_DEL = '0' AND PARENT_ID = '" + comp + "'" +
- "AND DEPT_NAME LIKE '%供电局%'" ;
- deptList.addAll(erDao.subDeptIDs(sql));
- sb.append(this.getErMarkerJson("pref", deptList)) ;
- sb.deleteCharAt(sb.length()-1) ;
- sb.append("}") ;
- } else {
- sb.append("\"pref\":[\"" + comp + "\"]}") ;
- }
- }
- log.info("部门查询SQL:"+sql);
- log.info("部门查询结果:"+sb.toString());
- // System.out.println(sb.toString());
- return sb.toString() ;
- }
-
- /**
- * 应急资源标注(三个圈)查询显示
- * @param params
- * @return
- */
- @POST
- @ProduceMime("application/json/")
- @Path("/queryErMarker/")
- public String queryErMarker(String params) {
- log.info(params) ;
- String classid = Utils.getParameter("classid", params) ;
- String comp = Utils.getParameter("unitId", params) ;
- String startDate = Utils.getParameter("startDate", params) ;
- String endDate = Utils.getParameter("endDate", params) ;
-
- StringBuffer sqlNative = new StringBuffer() ;
- StringBuffer sqlOther = new StringBuffer() ;
-
- Map<String, String> nativeSum = new HashMap<String, String>();
- Map<String, String> otherSum = new HashMap<String, String>() ;
- Map<String, String> xy = new HashMap<String, String>() ;
- String type = "" ;
- StringBuffer res = new StringBuffer() ;
-
- sqlOther.append("select sum(EQUIPMENT_NUMBER) as sum , dept as comp_id from (" +
- "select EQUIPMENT_NUMBER, dept from ECM_EM_EQUIPMENT_ALLOCATION " +
- "where is_del = '0' and IS_RELEASE = '1'") ;
-
-
- //查询发电机本地可调用资源
- if(verifyParams(classid) && classid.equals("266") && verifyParams(comp)){
-
- sqlNative.append("select sum(num) as sum ,comp_id from EMC_AM_GENERATOR " +
- "where is_del = '0' and IS_USED = '1'" + this.getOneSqlWhere("comp_id", comp) +
- "group by comp_id" ) ;
- nativeSum = erDao.queryNativeGene(sqlNative.toString()) ;//本地资源数map
-
-
- //外部调用
- sqlOther.append(this.getOneSqlWhere("dept", comp) +
- "and DEPARTURE_TIME BETWEEN '" + startDate + "' AND '" + endDate + "' " +
- "and EQUIPMENT_NAME like '%发电机%' " +
- ") as a group by dept") ;
- otherSum = erDao.queryNativeGene(sqlOther.toString()) ;//外地资源数map
-
- String xySql = "select DEPT_ID, POS_X, POS_Y from ECM_CM_CITYCOORDIATE where 1=1 " + this.getOneSqlWhere("DEPT_ID", comp) ;
- xy = erDao.queryXYM(xySql) ;//得到部门
- type = "GENERATOR" ;
-
- }
-
- //查询发电车本地可调用资源以及城市坐标
- if(verifyParams(classid) && classid.equals("265") && verifyParams(comp)){
-
- sqlNative.append("select sum(car_num) as sum ,comp_id from EMC_AM_GENERATOR_CAR " +
- "where is_del = '0' and IS_USED = '1'" + this.getOneSqlWhere("comp_id", comp) +
- "group by comp_id" ) ;
- nativeSum = erDao.queryNativeGene(sqlNative.toString()) ;//本地资源数map
-
- //外部调用
- sqlOther.append(this.getOneSqlWhere("dept", comp) +
- "and DEPARTURE_TIME BETWEEN '" + startDate + "' AND '" + endDate +
- "' and EQUIPMENT_NAME like '%发电车%' ) as a group by dept") ;
-
- otherSum = erDao.queryNativeGene(sqlOther.toString()) ;//外地资源数map
-
- String xySql = "select DEPT_ID, POS_X, POS_Y from ECM_CM_CITYCOORDIATE where 1=1 " + this.getOneSqlWhere("DEPT_ID", comp) ;
- xy = erDao.queryXYM(xySql) ;//得到部门
- type = "CAR" ;
- }
-
- //查询应急人员调用资源以及城市坐标(按人数)
- if(verifyParams(classid) && classid.equals("261") && verifyParams(comp)){
- // select sum(TEAM_MEMBER_NUMBER) as sum ,team_comp_id from ECM_AM_EMERGENCY_TEAM
- // where is_del = '0' and TEAM_STAT = '3'
- // group by team_comp_id ;
- sqlNative.append("select sum(TEAM_MEMBER_NUMBER) as sum ,team_comp_id as comp_id from ECM_AM_EMERGENCY_TEAM " +
- "where is_del = '0' and TEAM_STAT = '3'" + this.getOneSqlWhere("team_comp_id", comp) +
- "group by team_comp_id" ) ;
- nativeSum = erDao.queryNativeGene(sqlNative.toString()) ;//本地资源数map
-
- //外部调用
- String so = "select sum(POPULATION) as sum , UNIT as comp_id from ( "+
- "select POPULATION, UNIT from ECM_EM_TEAM_UNIT "+
- "where is_del = '0' and CURRENT_STATE = '132' "+ this.getOneSqlWhere("UNIT", comp) +
- "and START_TIME BETWEEN '" + startDate + "' AND '" + endDate + "' "+
- ") as a group by UNIT " ;
-
- otherSum = erDao.queryNativeGene(so) ;//外地资源数map
-
- String xySql = "select DEPT_ID, POS_X, POS_Y from ECM_CM_CITYCOORDIATE where 1=1 " + this.getOneSqlWhere("DEPT_ID", comp) ;
- xy = erDao.queryXYM(xySql) ;//得到部门
- type = "TEAM" ;
- }
-
- Set<String> keySet = nativeSum.keySet() ;
- res.append("[") ;
- for(String key : keySet){
- if(otherSum.get(key)==null){
- res.append("{" + xy.get(key) + ",\"native\":" + nativeSum.get(key) +
- ",\"other\":0,\"insufficiency\":0,\"unit\":\"" + key + "\",\"startDate\":\"" + startDate +
- "\",\"endDate\":\"" + endDate + "\",\"type\":\"" + type + "\"},") ;
- } else {
- res.append("{" + xy.get(key) + ",\"native\":" + nativeSum.get(key) +
- ",\"other\":" + otherSum.get(key) + ",\"insufficiency\":0,\"unit\":\"" + key +
- "\",\"startDate\":\"" + startDate + "\",\"endDate\":\"" + endDate +
- "\",\"type\":\"" + type + "\"},") ;
- }
-
- }
- res.deleteCharAt(res.length() - 1) ;
- res.append("]") ;
- return isNullData(res.toString()) ;
-
- }
-
- //用户手绘图形查询(图形类)
- @POST
- @ProduceMime("application/json/")
- @Path("/queryDrawByUser/")
- public String queryDrawByUser(String params){
- log.info(params) ;
- String inicId = Utils.getParameter("inicId", params) ;
- String type = Utils.getParameter("type", params) ;
- String userId = Utils.getParameter("userId", params) ;
- if(this.verifyParams(inicId) && this.verifyParams(type)){
- String sql = "select t1.fd_objectid fd_id, longitude,latitude,radius,describeinfo,teamid, " +
- "row_number() over(partition by figureid order by num) as num " +
- "from ECM_CM_SAVETYPE as t1 left join ECM_CM_PROGREAMSAVE as t2 " +
- "on t1.fd_objectid = t2.figureid where t1.is_del = '0' and t2.is_del='0' " +
- "and innectid = ? and drowtype = ? and t1.user_id = ? " ;
- String res = erDao.queryDrawByUser(sql, inicId, type, userId) ;
- return res.length() < 15 ? null : res ;
-
- }
-
- return null ;
- }
-
-
- //用户手绘图形查询(图标类)
- @POST
- @ProduceMime("application/json/")
- @Path("/queryDrawByUserMarker/")
- public String queryDrawByUserMarker(String params){
- log.info(params) ;
- String inicId = Utils.getParameter("inicId", params) ;
- String type = Utils.getParameter("type", params) ;
- String userId = Utils.getParameter("userId", params) ;
- if(this.verifyParams(inicId) && this.verifyParams(type)){
- String sql = "select t1.fd_objectid fd_id, longitude,latitude,radius,describeinfo,teamid,name, " +
- "row_number() over(partition by figureid order by num) as num " +
- "from ECM_CM_SAVETYPE as t1 left join ECM_CM_PROGREAMSAVE as t2 " +
- "on t1.fd_objectid = t2.figureid left join ECM_CM_GISICON " +
- "as t3 on t1.DROWTYPE = t3.TYPE where t1.is_del = '0' and t2.is_del='0' " +
- "and innectid = ? and drowtype = ? and t1.user_id = ? " ;
- return erDao.queryDrawByUserMarker(sql, inicId, type, userId) ;
-
- }
-
- return null ;
- }
-
-
- // //用户手绘图形按图层保存以图层为单位进行整体保存
- // @POST
- // @ProduceMime("application/")
- // @Path("/createDrawByUser/")
- // public String createDrawByUser(String params){
- // log.info(params) ;
- // String inicId = Utils.getParameter("inicId", params) ;
- // String info = Utils.getParameter("info", params) ;
- // System.out.println("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" + info);
- // if(this.verifyParams(inicId) && this.verifyParams(info)){
- // return erDao.createDrawByUser(inicId, info) ;
- // }
- //
- // return null ;
- // }
- // //用户导入图层信息
- // @POST
- // @ProduceMime("application/json/")
- // @Path("/importDrawByUser/")
- // public String importDrawByUser(){
- // String sql = "select drawinfo from ECM_CM_DRAWINFOBYUSER " ;
- // String aa = erDao.importDrawByUser(sql) ;
- // System.out.println(aa);
- // return aa ;
- // }
- /**
- * 应急资源标注(三个圈)查询显示网省级
- * @param params
- * @return
- *//*
- @POST
- @ProduceMime("application/json/")
- @Path("/queryErMarkerProvince/")
- public String queryErMarkerProvince(String params) {
- log.info(params) ;
- String classid = Utils.getParameter("classid", params) ;
- String comp = Utils.getParameter("unitId", params) ;
- String startDate = Utils.getParameter("startDate", params) ;
- String endDate = Utils.getParameter("endDate", params) ;
-
- StringBuffer sqlNative = new StringBuffer() ;
- StringBuffer sqlOther = new StringBuffer() ;
-
- Map<String, String> nativeSum = new HashMap<String, String>();
- Map<String, String> otherSum = new HashMap<String, String>() ;
- Map<String, String> xy = new HashMap<String, String>() ;
- StringBuffer res = new StringBuffer() ;
- System.out.println("******************classid:"+classid+";comp:"+comp+";startDate:"+startDate+";endDate:"+endDate);
- sqlOther.append("select sum(EQUIPMENT_NUMBER) as sum , dept as comp_id from (" +
- "select EQUIPMENT_NUMBER, dept from ECM_EM_EQUIPMENT_ALLOCATION as t1 " +
- "left join SYS_DEPARTMENT as t2 on t1.dept = t2.dept_id " +
- "where t1.is_del = '0' and IS_RELEASE = '1' and( t2.parent_id = '1' or t2.parent_id = '0' ) " +
- "and t2.dept_code is not null and t2.dept_code != '002'") ;
-
- //查询发电机本地可调用资源
- if(verifyParams(classid) && classid.equals("266") && verifyParams(comp)){
-
- sqlNative.append("select sum(num) as sum ,comp_id from EMC_AM_GENERATOR " +
- "as t1 left join SYS_DEPARTMENT as t2 on t1.comp_id = t2.dept_id" +
- "where t1.is_del = '0' and IS_USED = '1'" +
- "and( t2.parent_id = '1' or t2.parent_id = '0' ) and t2.dept_code is not null " +
- "and t2.dept_code != '002' " + this.getOneSqlWhere("comp_id", comp) +
- "group by comp_id" ) ;
- System.out.println("本地发电机Sql(网省级): " + sqlNative.toString()) ;
- nativeSum = erDao.queryNativeGene(sqlNative.toString()) ;//本地资源数map
-
-
- //外部调用
- sqlOther.append(this.getOneSqlWhere("dept", comp) +
- "and DEPARTURE_TIME BETWEEN '" + startDate + "' AND '" + endDate + "' " +
- "and EQUIPMENT_NAME like '%发电机%' " +
- ") as a group by dept") ;
- System.out.println("外部调用发电机Sql: " + sqlOther.toString());
- otherSum = erDao.queryNativeGene(sqlOther.toString()) ;//外地资源数map
-
-
- }
-
- //查询发电车本地可调用资源以及城市坐标
- if(verifyParams(classid) && classid.equals("265") && verifyParams(comp)){
-
- sqlNative.append("select sum(car_num) as sum ,comp_id from EMC_AM_GENERATOR_CAR as t1 " +
- "left join SYS_DEPARTMENT as t2 on t1.comp_id = t2.dept_id " +
- "where t1.is_del = '0' and IS_USED = '1' and( t2.parent_id = '1' or t2.parent_id = '0' ) " +
- "and t2.dept_code is not null and t2.dept_code != '002' " + this.getOneSqlWhere("comp_id", comp) +
- "group by comp_id" ) ;
- System.out.println("本地发电车SQL(网省级): "+sqlNative.toString());
- nativeSum = erDao.queryNativeGene(sqlNative.toString()) ;//本地资源数map
-
- //外部调用
- sqlOther.append(this.getOneSqlWhere("dept", comp) +
- "and DEPARTURE_TIME BETWEEN '" + startDate + "' AND '" + endDate +
- "' and EQUIPMENT_NAME like '%发电车%' ) as a group by dept") ;
-
- System.out.println("外部调用 发电车SQL(网省级): "+sqlOther.toString());
- otherSum = erDao.queryNativeGene(sqlOther.toString()) ;//外地资源数map
-
- String xySql = "select DEPT_ID, POS_X, POS_Y from ECM_CM_CITYCOORDIATE where 1=1 " + this.getOneSqlWhere("DEPT_ID", comp) ;
-
- xy = erDao.queryXYM(xySql) ;//得到部门
- }
-
-
- Set<String> keySet = nativeSum.keySet() ;
- res.append("[") ;
- for(String key : keySet){
- if(otherSum.get(key)==null){
- res.append("{" + xy.get(key) + ",\"native\":" + nativeSum.get(key) +
- ",\"other\":0,\"insufficiency\":0},") ;
- } else {
- res.append("{" + xy.get(key) + ",\"native\":" + nativeSum.get(key) +
- ",\"other\":" + otherSum.get(key) + ",\"insufficiency\":0},") ;
- }
-
- }
- res.deleteCharAt(res.length() - 1) ;
- res.append("]") ;
-
- System.out.println("网省级应急资源标注结果: " + res.toString());
- return isNullData(res.toString()) ;
-
- }
-
-
- *//**
- * 应急资源标注(三个圈)查询显示地市级
- * @param params
- * @return
- *//*
- @POST
- @ProduceMime("application/json/")
- @Path("/queryErMarkerPrefecture/")
- public String queryErMarkerPrefecture(String params) {
- log.info(params) ;
- String classid = Utils.getParameter("classid", params) ;
- String comp = Utils.getParameter("unitId", params) ;
- String startDate = Utils.getParameter("startDate", params) ;
- String endDate = Utils.getParameter("endDate", params) ;
-
- StringBuffer sqlNative = new StringBuffer() ;
- StringBuffer sqlOther = new StringBuffer() ;
-
- Map<String, String> nativeSum = new HashMap<String, String>();
- Map<String, String> otherSum = new HashMap<String, String>() ;
- Map<String, String> xy = new HashMap<String, String>() ;
- StringBuffer res = new StringBuffer() ;
-
- sqlOther.append("select sum(EQUIPMENT_NUMBER) as sum , dept as comp_id from (" +
- "select EQUIPMENT_NUMBER, dept from ECM_EM_EQUIPMENT_ALLOCATION as t1 " +
- "left join SYS_DEPARTMENT as t2 on t1.dept = t2.dept_id " +
- "where t1.is_del = '0' and IS_RELEASE = '1' and t2.parent_id != '1' and t2.parent_id != '0'") ;
-
- //查询发电机本地可调用资源
- if(verifyParams(classid) && classid.equals("266") && verifyParams(comp)){
-
- sqlNative.append("select sum(num) as sum ,comp_id from EMC_AM_GENERATOR as t1 " +
- "left join SYS_DEPARTMENT as t2 on t1.comp_id = t2.dept_id " +
- "where t1.is_del = '0' and IS_USED = '1' and t2.parent_id != '1' and t2.parent_id != '0' " +
- this.getOneSqlWhere("comp_id", comp) + "group by comp_id" ) ;
-
- System.out.println("本地发电机Sql: " + sqlNative.toString()) ;
- nativeSum = erDao.queryNativeGene(sqlNative.toString()) ;//本地资源数map
-
-
- //外部调用
- sqlOther.append(this.getOneSqlWhere("dept", comp) +
- "and DEPARTURE_TIME BETWEEN '" + startDate + "' AND '" + endDate + "' " +
- "and EQUIPMENT_NAME like '%发电机%' " +
- ") as a group by dept") ;
- System.out.println("外部调用发电机Sql: " + sqlOther.toString());
- otherSum = erDao.queryNativeGene(sqlOther.toString()) ;//外地资源数map
-
-
- }
-
- //查询发电车本地可调用资源以及城市坐标
- if(verifyParams(classid) && classid.equals("265") && verifyParams(comp)){
-
- sqlNative.append("select sum(car_num) as sum ,comp_id from EMC_AM_GENERATOR_CAR as t1 " +
- "left join SYS_DEPARTMENT as t2 on t1.comp_id = t2.dept_id " +
- "where t1.is_del = '0' and IS_USED = '1' and t2.parent_id != '1' " +
- "and t2.parent_id != '0' " + this.getOneSqlWhere("comp_id", comp) + "group by comp_id" ) ;
-
- System.out.println("本地发电车SQL"+sqlNative.toString());
- nativeSum = erDao.queryNativeGene(sqlNative.toString()) ;//本地资源数map
-
- //外部调用
- sqlOther.append(this.getOneSqlWhere("dept", comp) +
- "and DEPARTURE_TIME BETWEEN '" + startDate + "' AND '" + endDate +
- "' and EQUIPMENT_NAME like '%发电车%' ) as a group by dept") ;
-
- System.out.println("外部调用 发电车SQL"+sqlOther.toString());
- otherSum = erDao.queryNativeGene(sqlOther.toString()) ;//外地资源数map
-
- String xySql = "select DEPT_ID, POS_X, POS_Y from ECM_CM_CITYCOORDIATE where 1=1 " + this.getOneSqlWhere("DEPT_ID", comp) ;
-
- xy = erDao.queryXYM(xySql) ;//得到部门
- }
-
-
- Set<String> keySet = nativeSum.keySet() ;
- res.append("[") ;
- for(String key : keySet){
- if(otherSum.get(key)==null){
- res.append("{" + xy.get(key) + ",\"native\":" + nativeSum.get(key) +
- ",\"other\":0,\"insufficiency\":0},") ;
- } else {
- res.append("{" + xy.get(key) + ",\"native\":" + nativeSum.get(key) +
- ",\"other\":" + otherSum.get(key) + ",\"insufficiency\":0},") ;
- }
-
- }
- res.deleteCharAt(res.length() - 1) ;
- res.append("]") ;
-
- System.out.println("地市级应急资源标注SQL结果: " + res.toString());
- return isNullData(res.toString()) ;
-
- }
- */
-
- /**
- * 添加一组应急资源自定义图形参数信息ECM_CM_SAVETYPE
- * @param params
- * @return
- * @throws Exception
- */
- @POST
- @ProduceMime("/application/")
- @Path("/addDrawType/")
- public String addDrawType(String params){
- log.info(params) ;
- String data = Utils.getParameter("DATA", params) ;
-
- try{
- if(verifyParams(data)){
-
- params = java.net.URLDecoder.decode(data, "utf-8") ;
-
- List<SaveType> list = new ArrayList<SaveType>() ;
- list = JsonPluginsUtil.jsonToBeanList(params, SaveType.class) ;
- String fd_ids = erDao.createDrawType(list) ;
- return fd_ids ;
- }
- } catch (Exception e){ e.printStackTrace(); }
-
- return null ;
-
- }
-
-
- /**
- * 添加一组用户自定义图形坐标ECM_CM_PROGREAMSAVE
- * @param params
- * @return
- * @throws Exception
- */
- @POST
- @ProduceMime("/application/json/")
- @Path("/addDrawXY/")
- public String addDrawXY(String params){
- log.info(params) ;
- String data = Utils.getParameter("DATA", params) ;
-
- try{
- if(verifyParams(data)){
-
- params = java.net.URLDecoder.decode(data, "utf-8");
- List<Progream> list = new ArrayList<Progream>() ;
- list = JsonPluginsUtil.jsonToBeanList(params, Progream.class);
- String fd_ids = erDao.createProgream(list) ;
- return fd_ids ;
- }
- }catch(Exception e){ e.printStackTrace(); }
-
- return null ;
- }
-
- /**
- * 应急资源图层自定义图形坐标保存(批量)
- * @param params
- * @return
- * @throws Exception
- */
- @POST
- @ProduceMime("application/")
- @Path("/createDraw/")
- public String createDraw(String params){
- log.info(params);
- try{
- if(verifyParams(params)){
-
- params = java.net.URLDecoder.decode(params, "utf-8");
-
- List<Yjzyincident> list = new ArrayList<Yjzyincident>() ;
- list = JsonPluginsUtil.jsonToBeanList(params, Yjzyincident.class);
- String fd_ids = erDao.createDraw(list) ;
- return fd_ids ;
-
- }
- }
- catch (UnsupportedEncodingException e){ e.printStackTrace(); }
- catch (Exception e){ e.printStackTrace(); }
-
- return null ;
-
- }
-
- /**
- * 查询应急队伍所执行应急事件实时传入的坐标路径
- * @param params
- * @return
- */
- @POST
- @ProduceMime("application/json")
- @Path("/queryTameLine/")
- public String queryTameLine(String params){
- log.info(params);
- String inci = Utils.getParameter("inci", params) ;
- String teamid = Utils.getParameter("teamid", params) ;
- String beginTime = Utils.getParameter("beginTime", params) ; //开始时间
- String endTime = Utils.getParameter("endTime", params) ; //截止时间
-
- if(verifyParams(teamid)){
-
- // String sqlToteam = "select team_id, team_name, incidentname, longitude, latitude, team_time, row_number() over " +
- // "(partition by team_id order by team_time) as num from SYS_APP_TEAMER as t1 " +
- // "left join ECM_AM_EMERGENCY_TEAM as t2 on t1.team_id = t2.fd_objectid " +
- // "left join ECM_CM_YJZYINCIDENT as t3 on t1.inicid = t3.fd_objectid " +
- // "where t1.is_del = '0' " + this.getOneSqlWhere("team_id", teamid) ;
- String sqlToteam = "select team_id, team_name, early_warning_name incidentname, t1.longitude, t1.latitude, team_time, row_number() over " +
- "(partition by team_id order by team_time) as num from SYS_APP_TEAMER as t1 " +
- "left join ECM_AM_EMERGENCY_TEAM as t2 on t1.team_id = t2.fd_objectid " +
- "left join ECM_EM_PUBLISH_ALERT_NOTICE as t3 on t1.inicid = t3.fd_objectid " +
- "where t1.is_del = '0' " + this.getOneSqlWhere("team_id", teamid) ;
-
- if(this.verifyParams(beginTime) && this.verifyParams(endTime))
- sqlToteam += "and team_time BETWEEN '" + beginTime + "' AND '" + endTime + "'" ;
-
- return erDao.queryTameLine(sqlToteam) ;
-
- }else if (verifyParams(inci)){
- // String sqlToInci = "select team_id, team_name, incidentname, longitude, latitude, team_time, row_number() over " +
- // "(partition by team_id order by team_time) as num from SYS_APP_TEAMER as t1 " +
- // "left join ECM_AM_EMERGENCY_TEAM as t2 on t1.team_id = t2.fd_objectid " +
- // "left join ECM_CM_YJZYINCIDENT as t3 on t1.inicid = t3.fd_objectid " +
- // "where t1.is_del = '0' " + this.getOneSqlWhere("inicid", inci) ;
- String sqlToInci = "select team_id, team_name, early_warning_name t1.incidentname, t1.longitude, latitude, team_time, row_number() over " +
- "(partition by team_id order by team_time) as num from SYS_APP_TEAMER as t1 " +
- "left join ECM_AM_EMERGENCY_TEAM as t2 on t1.team_id = t2.fd_objectid " +
- "left join ECM_EM_PUBLISH_ALERT_NOTICE as t3 on t1.inicid = t3.fd_objectid " +
- "where t1.is_del = '0' " + this.getOneSqlWhere("inicid", inci) ;
- if(this.verifyParams(beginTime) && this.verifyParams(endTime))
- sqlToInci += "and team_time BETWEEN '" + beginTime + "' AND '" + endTime + "'" ;
-
- return erDao.queryTameLine(sqlToInci) ;
-
- }
- return null ;
- }
-
-
- /**
- * 查询应急队伍所执行应急事件实时传入的坐标路径
- * @param params
- * @return
- */
- @POST
- @ProduceMime("application/json")
- @Path("/queryTameLineById/")
- public String queryTameLineById(String params){
- log.info(params);
- String teamid = Utils.getParameter("teamid", params) ;
- String beginTime = Utils.getParameter("beginTime", params) ; //开始时间
- String endTime = Utils.getParameter("endTime", params) ; //截止时间
-
- if(verifyParams(teamid)){
- Map<String, Posi> smap ;
- Map<String, Posi> emap ;
- //1.队伍开始
- String StartSql = "SELECT LOCATION_TIME, FD_ID FROM (SELECT LOCATION_TIME, BUSINISS_ID FD_ID, " +
- "ROW_NUMBER() OVER(PARTITION BY BUSINISS_ID ORDER BY LOCATION_TIME DESC) " +
- "AS SORT FROM SYS_APP_USER_LOCATION WHERE IS_END = 'start' ) " +
- "WHERE SORT = '1' AND FD_ID IN ('" + teamid + "')" ;
- smap = erDao.getStartTimeByTeam(StartSql) ;
-
- //2.队伍结束
- String endSql = "SELECT LOCATION_TIME, FD_ID FROM (SELECT LOCATION_TIME, BUSINISS_ID FD_ID, " +
- "ROW_NUMBER() OVER(PARTITION BY BUSINISS_ID ORDER BY LOCATION_TIME DESC) " +
- "AS SORT FROM SYS_APP_USER_LOCATION WHERE IS_END = 'end' ) " +
- "WHERE SORT = '1' AND FD_ID IN ('" + teamid + "')" ;
- emap = erDao.getEndTimeByTeam(endSql) ;
- //3.得到队伍时间段
- List<Posi> list = erDao.getTimeByTeam(smap,emap);
-
- String sql = "(SELECT LOCATION_TIME, T1.LONGITUDE LON, T1.LATITUDE LAT, BUSINISS_ID FD_ID, " +
- "ISNULL(POPULATION,'0') MENNUM, T4.FD_OBJECTID INICID, CASE MAJOR WHEN '124' " +
- "THEN '输电' WHEN '125' THEN '变电' WHEN '126' THEN '配电' WHEN '127' THEN '通信' " +
- "WHEN '128' THEN '网络信息' WHEN '129' THEN '试验' WHEN '130' THEN '其他' ELSE '' " +
- "END MAJOR, ISNULL(STATR_PLACE,'没有查到该队伍调拨信息') STATRPLACE, ISNULL(DEST, " +
- "'没有查到该队伍调拨信息') DEST, ISNULL(TASK_NAME,'没有查到该队伍调拨信息') TNAME, " +
- "ISNULL(TEAM_NAME,'') NAME, ROW_NUMBER() OVER(PARTITION BY BUSINISS_ID ORDER BY " +
- "LOCATION_TIME) AS SORT FROM SYS_APP_USER_LOCATION T1 LEFT JOIN ECM_AM_EMERGENCY_TEAM " +
- "T2 ON T1.BUSINISS_ID = T2.FD_OBJECTID LEFT JOIN NWYJ.ECM_EM_TEAM_UNIT T3 ON " +
- "T1.BUSINISS_ID = T3.TEAM_NEAM LEFT JOIN ECM_EM_TEAM_WRR T4 ON T3.DEMAND_ID = " +
- "T4.FD_OBJECTID WHERE T1.IS_DEL = '0' AND T2.IS_DEL = '0' " ;
- String asql = "" ;
- for(Posi posi:list){
- String blu = "AND BUSINISS_ID = '" + posi.getFD_ID() + "' " +
- "AND LOCATION_TIME BETWEEN '" + posi.getStartDate() + "' AND '" +
- posi.getEndDate() + "' )UNION ALL";
- asql += sql + blu;
- }
- asql = asql.substring(0,asql.length()-9);
- return erDao.queryTameLineById(asql) ;
- }
- return null ;
- }
-
-
- //根据图形ID逻辑删除图形(两张表)
- @POST
- @ProduceMime("application/")
- @Path("/delDrawUserDefined/")
- public String delDrawUserDefined(String params) {
- log.info(params);
- if(verifyParams(params)){
- if( erDao.delUserDefinedToType(this.trunList(params))&&
- erDao.delUserDefinedToProgreamsave(this.trunList(params)) ){
-
- return "true" ;
- }
- return null ;
- }
- return null ;
- }
-
- //===================================================应急资源end===============================================
-
- /* @POST
- @ProduceMime("application/json/")
- @Path("/queryEr/")
- public String queryEr(String params){
- log.info(params);
- String dept_id = Utils.getParameter("deptId", params) ;
- if(this.verifyParams(dept_id)){
- int flg = this.userDeptLevel(dept_id) ;
-
- }
- return null ;
- }*/
-
-
- /*//应急队伍坐标获取 未完成
- @POST
- @ProduceMime("application/json/")
- @Path("/queryEmTeam/")
- public String queryEmTeam(String params){
- String sql = "" ;
- String result = "" ;
- return isNullData(result) ;
- }*/
-
-
- /*//应急资源图层添加事件的名称校验查询返回1为存在,0为不存在
- @POST
- @ProduceMime("/application/")
- @Path("/verifyIncidentName/")
- public String verifyIncidentName(String params){
- log.info(params) ;
- String condition = Utils.getParameter("Condi", params) ;
-
- if(verifyParams(condition)){
- return erDao.existIncidentName(condition) ;
- }
-
- return "1" ;
- }
- */
- /*//应急资源图层添加事件
- @POST
- @ProduceMime("/application/")
- @Path("/addIncidentName/")
- public String addIncidentName(String params){
- log.info(params) ;
- String condition = Utils.getParameter("Condi", params) ;
- String fd_id = "" ;
- if(verifyParams(condition)){
- SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
- String date = df.format(new Date()) ;
- System.out.println(date);
-
- //1.先添加事件,并得到FD_OBJECTID
- String incidentSql = "insert into ECM_CM_YJZYINCIDENT values (?,?,'0','" + date + "')" ;
- fd_id = erDao.addIncident(incidentSql, condition) ;
- if(fd_id.equals(null))
- return null ;
- }
-
- return fd_id ;
- }*/
-
-
-
-
- //应急资源自定义图形查询
- @POST
- @ProduceMime("/application/json/")
- @Path("/getDrawInfo/")
- public String getDrawInfo(String params){
- log.info(params) ;
- String innectId = Utils.getParameter("INNECTID", params) ;
-
- if(verifyParams(innectId)){
- String getDrawsSql = "select b.fd_objectid,b.drowtype from ECM_CM_YJZYINCIDENT as a " +
- "left join ECM_CM_SAVETYPE as b " +
- "on b.innectid = a.fd_objectid where a.fd_objectid='" + innectId + "' and a.is_del='0'" ;
-
- String getXYSql ;
- StringBuffer sb = new StringBuffer() ;
- sb.append("[") ;
-
- Map<String,String> draws = erDao.getDrawsSql(getDrawsSql) ;
- Set<String> set = draws.keySet();
- for(Iterator<String> iter = set.iterator(); iter.hasNext();){
-
- String key = (String)iter.next();
- String value = (String)draws.get(key);
-
- getXYSql = "select longitude, latitude from ECM_CM_PROGREAMSAVE " +
- "where is_del = '0' AND FIGUREID ='" + key + "' order by num " ;
-
- sb.append("{\"type\":\"" + value + "\",\"point\":" + erDao.getDrawXY(getXYSql) + "},") ;
- }
-
- sb.deleteCharAt(sb.length() - 1) ;
- sb.append("]") ;
- return isNullData(sb.toString()) ;
- }
- return null ;
- }
-
-
- //应急资源自定义图形坐标查询从启动转换为添加
- @POST
- @ProduceMime("/application/json/")
- @Path("/getDrawPoints/")
- public String getDrawPoints(String params){
- log.info(params) ;
- String ids = Utils.getParameter("ids", params) ;
- if(verifyParams(ids)){
- String sql = "select figureid,longitude,latitude,num,row_number()over(partition by figureid order by num) " +
- "from ECM_CM_PROGREAMSAVE " +
- "where is_del='0' " + getOneSqlWhere("figureid",ids) ;
- StringBuffer sb = new StringBuffer() ;
-
- Map<String,String> draws = erDao.getDrawPoints(sql) ;
- Set<String> set = draws.keySet() ;
- sb.append("[") ;
- for(Iterator<String> iter = set.iterator(); iter.hasNext();){
- String key = (String)iter.next() ;
- String value = (String)draws.get(key) ;
- sb.append("{\"fid\":\"" + key + "\",\"point\":" + value + "},") ;
- }
- sb.deleteCharAt(sb.length()-1) ;
- sb.append("]") ;
- return this.isNullData(sb.toString()) ;
-
- }
- return null ;
- }
-
-
-
-
- /**
- * 查询事件类型
- * @return
- */
- @POST
- @ProduceMime("application/")
- @Path("/queryIncidentType/")
- public String queryIncidentType(){
- String sql = "select plan_name from ECM_AM_YJYASERVER where plan_type='103' and is_del='0'" ;
- return isNullData(ctDao.queryIncidentType(sql)) ;
- }
-
-
- //根据应急事件或应急队伍查询出其最新位置坐标,应急资源定位功能用
- @POST
- @ProduceMime("application/json")
- @Path("/queryYJTameMarkerInfo/")
- public String queryYJTameMarkerInfo(String params){
- log.info(params) ;
- String inci = Utils.getParameter("inci", params) ;
- String teamid = Utils.getParameter("teamid", params) ;
- String sort = Utils.getParameter("sort", params) ;
- if(this.verifyParams(sort) && sort.equalsIgnoreCase("asc")){
- sort = "ASC" ;
- } else {
- sort = "DESC" ;
- }
- if(verifyParams(teamid)){
-
- // String sqlToteam = "select team_id, team_name, longitude, latitude, inicid, incidentname from ( " +
- // "select team_id, team_name, longitude, latitude, inicid, incidentname, row_number() " +
- // "over(partition by team_id order by t1.team_time " + sort + ") as sort " +
- // "from SYS_APP_TEAMER as t1 left join ECM_AM_EMERGENCY_TEAM as t2 " +
- // "on t1.team_id = t2.fd_objectid left join ECM_CM_YJZYINCIDENT as t3 " +
- // "on t1.inicid = t3.fd_objectid " +
- // "where t1.is_del = '0' " + this.getOneSqlWhere("team_id", teamid) +
- // ") where sort = 1" ;
-
- String sqlToteam = "select team_id, team_name, longitude, latitude, inicid,early_warning_name " +
- "incidentname from ( select team_id, team_name, t1.longitude, t1.latitude, inicid, " +
- "early_warning_name, row_number() over(partition by team_id order by t1.team_time " + sort + ") as sort " +
- "from SYS_APP_TEAMER as t1 left join ECM_AM_EMERGENCY_TEAM as t2 " +
- "on t1.team_id = t2.fd_objectid left join ECM_EM_PUBLISH_ALERT_NOTICE as t3 " +
- "on t1.inicid = t3.fd_objectid " +
- "where t1.is_del = '0' " + this.getOneSqlWhere("team_id", teamid) +
- ") where sort = 1" ;
-
- return erDao.queryYjTameMarker(sqlToteam) ;
-
- }else if (verifyParams(inci)){
- // String sqlToInci = "select team_id, team_name, longitude, latitude, inicid, incidentname from ( " +
- // "select team_id, team_name, longitude, latitude, inicid, incidentname, " +
- // "row_number() over(partition by team_id order by t1.team_time " + sort + ") as sort " +
- // "from SYS_APP_TEAMER as t1 left join ECM_AM_EMERGENCY_TEAM as t2 " +
- // "on t1.team_id = t2.fd_objectid left join ECM_CM_YJZYINCIDENT as t3 " +
- // "on t1.inicid = t3.fd_objectid " +
- // "where t1.is_del = '0' " + this.getOneSqlWhere("inicid", inci) +
- // ") where sort = 1" ;
- String sqlToInci = "select team_id, team_name, longitude, latitude, inicid, early_warning_name incidentname " +
- "from ( select team_id, team_name, t1.longitude, t1.latitude, inicid, early_warning_name, " +
- "row_number() over(partition by team_id order by t1.team_time " + sort + ") as sort " +
- "from SYS_APP_TEAMER as t1 left join ECM_AM_EMERGENCY_TEAM as t2 " +
- "on t1.team_id = t2.fd_objectid left join ECM_EM_PUBLISH_ALERT_NOTICE as t3 " +
- "on t1.inicid = t3.fd_objectid " +
- "where t1.is_del = '0' " + this.getOneSqlWhere("inicid", inci) +
- ") where sort = 1" ;
-
- return this.isNullData(erDao.queryYjTameMarker(sqlToInci)) ;
-
- }
-
- return null ;
- }
-
- @POST
- @ProduceMime("application/json")
- @Path("/fixedPosition/")
- public String fixedPosition(String params){
- log.info(params) ;
- String teamid = Utils.getParameter("teamid", params) ;
- String sort = Utils.getParameter("sort", params) ;
- if(this.verifyParams(sort) && sort.equalsIgnoreCase("asc")){
- sort = "ASC" ;
- } else {
- sort = "DESC" ;
- }
- String sql = "SELECT * FROM(SELECT T1.LONGITUDE LON, T1.LATITUDE LAT, BUSINISS_ID FD_ID, " +
- "T4.FD_OBJECTID INICID, ISNULL(POPULATION,'0') MENNUM, CASE MAJOR WHEN '124' " +
- "THEN '输电' WHEN '125' THEN '变电' WHEN '126' THEN '配电' WHEN '127' THEN '通信' " +
- "WHEN '128' THEN '网络信息' WHEN '129' THEN '试验' WHEN '130' THEN '其他' ELSE '' " +
- "END MAJOR, ISNULL(STATR_PLACE,'没有查到该队伍调拨信息') STATRPLACE, ISNULL(DEST, " +
- "'没有查到该队伍调拨信息') DEST, ISNULL(TASK_NAME,'没有查到该队伍调拨信息') TNAME, " +
- "ISNULL(TEAM_NAME,'') NAME, ROW_NUMBER() OVER(PARTITION BY " +
- "BUSINISS_ID ORDER BY LOCATION_TIME " + sort + ") AS SORT FROM SYS_APP_USER_LOCATION T1 " +
- "LEFT JOIN ECM_AM_EMERGENCY_TEAM T2 ON T1.BUSINISS_ID = T2.FD_OBJECTID LEFT JOIN " +
- "NWYJ.ECM_EM_TEAM_UNIT T3 ON T1.BUSINISS_ID = T3.TEAM_NEAM LEFT JOIN ECM_EM_TEAM_WRR " +
- "T4 ON T3.DEMAND_ID = T4.FD_OBJECTID WHERE T1.IS_DEL = '0' AND T2.IS_DEL = '0' " +
- ") WHERE SORT = '1' " ;
- if(this.verifyParams(teamid)){
- sql += "AND FD_ID IN ('" + teamid + "')";
- return erDao.queryTameMarker(sql) ;
- }
-
- return null;
- }
-
- //查询应急队伍所执行应急事件实时传入的坐标
- @POST
- @ProduceMime("application/json")
- @Path("/queryTameXY/")
- public String queryTameXY(String params){
- log.info(params);
- String inci = Utils.getParameter("inci", params) ;
- if(verifyParams(inci)){
-
- String sql = "select a.longitude, a.latitude, row_number() over " +
- "(partition by team_id order by a.team_time) from SYS_APP_TEAMER as a " +
- "left join ECM_AM_EMERGENCY_TEAM as b on a.team_id = b.fd_objectid " +
- "where a.is_del = '0' " + this.getOneSqlWhere("inicid", inci) ;
- return this.isNullData(erDao.queryTameXY(sql)) ;
- }
- return null ;
- }
-
-
-
-
-
- //查询城市坐标
- @POST
- @ProduceMime("application/json")
- @Path("/queryCityXY")
- public String queryCityXY(String params){
- log.info(params);
- String cityStr = Utils.getParameter("city", params);
-
- StringBuffer sql = new StringBuffer() ;
- sql.append("select POS_X, POS_Y from ECM_CM_CITYCOORDIATE where 1=1 ") ;
- if(verifyParams(cityStr)){
- sql.append(this.getOneSqlWhere("DEPT_ID", cityStr)) ;
-
- return isNullData(erDao.queryXY(sql.toString())) ;
- }
- return null ;
- }
-
-
-
- /**
- * 查询突发事件
- * @return
- */
- @POST
- @ProduceMime("application/json")
- @Path("/queryNewEmergency")
- public String queryNewEmergency(){
-
- String sql = "select top 1 t1.FD_OBJECTID as FD_ID,EVENT_NAME,LEVEL,AREA,DEPT_NAME,WRITE_TIME from ECM_EM_EVENT_MANAGER as t1 " +
- "left join SYS_DEPARTMENT as t2 on dept_id=WRITE_DEPT where t1.is_del='0' order by WRITE_TIME desc " ;
-
- return emerDao.queryEmergency(sql) ;
- }
-
- //查询应急新闻
- @POST
- @ProduceMime("application/json")
- @Path("/queryNews")
- public String queryNews(){
- String sql = "select fd_objectid,new_title,new_url,new_updatetime from emc_am_news where is_del='0' order by new_updatetime desc " ;
- return emerDao.queryNews(sql) ;
- }
-
- /**
- * 计算页码
- * @param countPage 页码总数
- * @param listNum 每页显示条数
- * @return
- */
- /* public int computePageNum(double countPage,double listNum){
- return (int)Math.ceil(countPage/listNum);
- }*/
-
- //查询应急视频总数
- @POST
- @ProduceMime("application/json")
- @Path("/pageCountByVideo")
- public String pageCountByVideo(String params){
- log.info(params);
- int listNum = Integer.parseInt(Utils.getParameter("listNum", params));
- // String sql = "select count(1) pageCount from ecm_am_we_input t1 left join sys_comm_fileimg t2 on t1.fd_objectid = t2.mainid where t1.is_del='0' and t1.type=26 and t1.PCORAPP='1' and t2.is_del='0' and filepath is not null " ;
- String sql = "select count(1) pageCount from ecm_am_we_input t1 left join sys_comm_fileimg t2 on " +
- "t1.fd_objectid = t2.mainid where t1.is_del='0' and t1.type=26 and t2.is_del='0' " ;
- double pc = emerDao.pageCount(sql);
- return "{\"countList\":" + pc + ",\"countPage\":"+(int)Math.ceil(pc/listNum) + "}";
- }
-
- //查询应急视频
- @POST
- @ProduceMime("application/json")
- @Path("queryVideo")
- public String queryVideo(String params){
- log.info(params) ;
- String begin = Utils.getParameter("begin", params) ;
- String end = Utils.getParameter("end", params) ;
- String condition = Utils.getParameter("condition", params) ;
-
- if(verifyParams(condition)){
- condition = "%" + condition + "%" ;
- } else {
- condition = "%%" ;
- }
-
- String sql = "select fd_objectid,dept_name,oper_name,oper_time,description,fileext,name,rn from( " +
- "select t2.fd_objectid,dept_name,oper_name,oper_time,description,fileext,t2.SAVENAME NAME, " +
- "row_number() over(order by oper_time desc) as rn " +
- "from ecm_am_we_input t1 left join sys_comm_fileimg t2 on t1.fd_objectid = t2.mainid " +
- "left join sys_department t3 on t1.oper_dept = t3.dept_id where t1.is_del='0' " +
- "and t1.type=26 and t2.is_del='0' and (oper_name like ? or t3.dept_name like ?) " +
- ") where rn between ? and ? " ;
- return this.isNullData(emerDao.listVideo(sql,condition,begin, end)) ;
- }
-
- //条件查询应急视频
- @POST
- @ProduceMime("application/json")
- @Path("searchByCondition")
- public String searchByCondition(String params){
- log.info(params);
- int listNum = Integer.parseInt(Utils.getParameter("listNum", params));
- String condition = "%" + Utils.getParameter("condition", params) + "%";
- double pc = -1.0 ;
- String sql = "select count(1) pageCount from ecm_am_we_input t1 left join sys_comm_fileimg t2 " +
- "on t1.fd_objectid = t2.mainid left join sys_department t3 on t1.oper_dept = t3.dept_id " +
- "where t1.is_del='0' and t1.type=26 and t2.is_del='0' " ;
- if(verifyParams(condition)){
- sql += "and (oper_name like ? or " +
- "t3.dept_name like ?) " ;
- pc = emerDao.pageCountByCondition(sql, condition);
- }else{
- pc = emerDao.pageCount(sql) ;
- }
-
- if(pc > 0){
- return "{\"countList\":" + pc + ",\"countPage\":"+(int)Math.ceil(pc/listNum) + "}";
- }
- return "{\"countList\":0,\"countPage\":1}";
- }
-
- //根据部门ID查询人资ID
- @POST
- @ProduceMime("application/")
- @Path("getSaphrorgID")
- public String getSaphrorgID(String params){
- log.info(params);
- String unitID = Utils.getParameter("unitID", params);
- String resu = "" ;
- if(verifyParams(unitID)){
- String sql = "select saphrorgid from SYS_DEPARTMENT where saphrorgid is not null " + getOneSqlWhere("dept_id", unitID);
- resu = ctDao.getSaphrorgID(sql) ;
- }
- return resu ;
- }
- //================================================页面下拉框类显示用查询/工具查询===============================================
-
- /**
- * 查询当前用户部门的等级
- * @param params
- * @return int 1:网级 2:省级 3:市级 4:其它
- */
- /*public int userDeptLevel(String deptId){
- //查询出是否为网级公司
- StringBuffer sb = new StringBuffer() ;
- sb.append("select dept_id from SYS_DEPARTMENT where parent_id = '0' and dept_code is not null " +
- "and dept_code != '002' and dept_id = '" + deptId + "'" ) ;
- //如果是网级则返回true
- if(erDao.isProvInteDept(sb.toString())){
- return 1 ;//网级
- } else {
- sb.delete(0, sb.length()) ;
-
- // sb.append("select dept_id, dept_name from SYS_DEPARTMENT where parent_id = 'BBD3C37F68094363AABC3CAD5FEE0AF8' and dept_code is not null " +
- // "and dept_id = '" + deptId + "'" ) ;
-
- sb.append("select dept_id, dept_name from SYS_DEPARTMENT where parent_id = ( " +
- "select dept_id from SYS_DEPARTMENT where dept_id is not null and " +
- "(parent_id='0' or parent_id is null or parent_id='' or parent_id='<NULL>')" +
- ") and dept_id = '" + deptId + "'" );
-
- //如果是省级就返回true
- if(erDao.isProvInteDept(sb.toString())){
- return 2 ;//省级
- } else {
- sb.delete(0, sb.length()) ;
- sb.append("select dept_id from SYS_DEPARTMENT where parent_id in (select dept_id from SYS_DEPARTMENT " +
- "where parent_id = '1' and dept_code is not null ) and dept_id = '" + deptId + "'" ) ;
-
- if(erDao.isProvInteDept(sb.toString())){
- return 3 ;//市级
- } else {
- return 4 ;//其它
- }
- }
- }
- }*/
-
- //通过部门ID得到直属下级部门ID
- public List<String> subDept(String deptID){
- String sql = "select dept_id, dept_name from SYS_DEPARTMENT where is_del = '0' and parent_id = '" + deptID + "' " ;
- return erDao.subDeptIDs(sql) ;
- }
-
- /*//查询部门是否为省级公司
- public String userDeptLevelProv(String deptId){
- String sql = "select dept_id, dept_name from SYS_DEPARTMENT where parent_id = '1' and dept_code is not null " +
- "and dept_code != '002' where dept_id = '" + deptId + "'" ;
-
- //如果是省级则返回true,
-
- //如果不是省级,继续查询当前部门是否为地市级
-
- }*/
-
- /*//查询部门是否为省级公司
- public String userDeptLevelPref(String deptId){
- String sql = "select dept_id, dept_name from SYS_DEPARTMENT where parent_id = '1' and dept_code is not null " +
- "and dept_code != '002' where dept_id = '" + deptId + "'" ;
-
- //如果是省级则返回true,
-
- //如果不是省级,继续查询当前部门是否为地市级
- return null ;
- }*/
-
- /**
- * 查询事件表的事件名称,复选下拉列表用
- * @return
- */
- // @POST
- // @ProduceMime("application/json")
- // @Path("/queryYjIncident/")
- // public String queryYjIncident(){
- // String sql = "select FD_OBJECTID,INCIDENTNAME from ECM_CM_YJZYINCIDENT where IS_DEL = '0' order by startdate" ;
- // System.out.println("事件表的事件名称查询,下拉复选列表: " + sql );
- // return ctDao.queryYjIncident(sql) ;
- // }
-
- /**
- * 查询事件表的事件名称,单选下拉列表用
- * @return
- */
- // @POST
- // @ProduceMime("application/json")
- // @Path("/queryYjIncidentByRadio/")
- // public String queryYjIncidentByRadio(){
- // String sql = "select FD_OBJECTID fd_id,INCIDENTNAME name from ECM_CM_YJZYINCIDENT where IS_DEL = '0' order by startdate " ;
- // return ctDao.queryRadioSelect(sql);
- // }
-
- /**
- * 查询应急预警通知单,挂事件名
- */
- @POST
- @ProduceMime("application/json")
- @Path("/queryPublishAlertNotice")
- public String queryPublishAlertNotice(String params){
- log.info(params);
- String unitID = Utils.getParameter("deptId", params);
- if(verifyParams(unitID)){
- // String sql = "SELECT FD_OBJECTID FD_ID, EARLY_WARNING_NAME NAME, RELEASE_UNIT UNIT," +
- // " RELEASE_RELIEVE_DATE SENDDATE FROM " +
- // "ECM_EM_PUBLISH_ALERT_NOTICE WHERE IS_DEL = '0' AND IS_SEND = '5' " +
- // "ORDER BY RELEASE_RELIEVE_DATE DESC " ;
-
- String sql = "SELECT FD_OBJECTID FD_ID, EARLY_WARNING_NAME NAME FROM " +
- "ECM_EM_PUBLISH_ALERT_NOTICE WHERE IS_DEL = '0' AND IS_SEND = '5' " +
- getOneSqlWhere("RELEASE_UNIT", unitID) + "ORDER BY RELEASE_RELIEVE_DATE DESC " ;
- return ctDao.queryRadioSelect(sql);
- }
- return null;
- }
-
- /**
- * 查询应急预警响应通知单,事件挂名,多选框
- */
- @POST
- @ProduceMime("application/json")
- @Path("queryNoticeByMultiMode")
- public String queryNoticeByMultiMode(String params){
- log.info(params);
- String unitID = Utils.getParameter("deptId", params);
- if(verifyParams(unitID)){
- // String sql = "SELECT FD_OBJECTID FD_ID, EARLY_WARNING_NAME NAME FROM " +
- // "ECM_EM_PUBLISH_ALERT_NOTICE WHERE IS_DEL = '0' AND IS_SEND = '5' " +
- // getOneSqlWhere("RELEASE_UNIT", unitID) + "ORDER BY RELEASE_RELIEVE_DATE DESC " ;
-
- String sql = "SELECT t1.FD_OBJECTID FD_ID, DEPT_NAME, EARLY_WARNING_NAME NAME FROM " +
- "ECM_EM_PUBLISH_ALERT_NOTICE AS t1 LEFT JOIN SYS_DEPARTMENT AS t2 " +
- "ON t1.RELEASE_UNIT = t2.dept_id WHERE t1.IS_DEL = '0' AND t2.IS_DEL = '0' " +
- "AND IS_SEND = '5' " + getOneSqlWhere("RELEASE_UNIT", unitID) +
- "ORDER BY RELEASE_RELIEVE_DATE DESC " ;
- return ctDao.queryYjIncident(sql) ;
- }
- return null ;
- }
-
- /**
- * 查询应急队伍调动队伍,多选框
- */
- @POST
- @ProduceMime("application/json")
- @Path("queryTeamMove")
- public String queryTeamMove(String params){
- log.info(params);
- String sql = "SELECT * FROM(SELECT BUSINISS_ID FD_ID, ISNULL(TEAM_NAME,'') NAME, ISNULL(TASK_NAME,'') " +
- "TASK, ROW_NUMBER() OVER(PARTITION BY BUSINISS_ID ORDER BY LOCATION_TIME DESC) AS SORT " +
- "FROM SYS_APP_USER_LOCATION T1 LEFT JOIN ECM_AM_EMERGENCY_TEAM T2 ON " +
- "T1.BUSINISS_ID = T2.FD_OBJECTID LEFT JOIN NWYJ.ECM_EM_TEAM_UNIT T3 ON " +
- "T1.BUSINISS_ID = T3.TEAM_NEAM LEFT JOIN ECM_EM_TEAM_WRR T4 ON T3.DEMAND_ID = T4.FD_OBJECTID " +
- "WHERE T1.IS_DEL = '0' AND T2.IS_DEL = '0' ) WHERE SORT = '1'" ;
-
- return ctDao.queryTeamMove(sql) ;
- }
-
- /**
- * 通过事件ID得到队伍下拉复选框(应急资源应急队伍查询用)
- * @param params
- * @return
- */
- @POST
- @ProduceMime("application/json")
- @Path("/queryTeamByInci/")
- public String queryTeamByInci(String params){
- log.info(params);
- String teaminciId = Utils.getParameter("teaminciId", params) ;
-
- // String sql = "select distinct(team_id),t2.team_name from SYS_APP_TEAMER as t1 " +
- // "left join ECM_AM_EMERGENCY_TEAM as t2 on t1.team_id = t2.fd_objectid " +
- // "where t1.is_del = '0' and t2.is_del='0' " ;
- String sql = "select t2.TEAM_NEAM TEAM_ID, t3.TEAM_NAME TEAM_NAME from ECM_EM_TEAM_WRR as t1 " +
- "left join ECM_EM_TEAM_UNIT as t2 on t1.FD_OBJECTID = t2.DEMAND_ID " +
- "left join ECM_AM_EMERGENCY_TEAM as t3 on t2.TEAM_NEAM = t3.fd_objectid " +
- "where t2.CURRENT_STATE <> '131' " +
- "and (TEAM_NAME <> '<NULL>' or TEAM_NAME <> null or TEAM_NAME <> '' ) " ;
-
- if(this.verifyParams(teaminciId)){ sql += this.getOneSqlWhere("t1.TASK_NAME_ID", teaminciId) ; }
- return ctDao.queryTeamByInci(sql) ;
-
- }
-
- //应急资源绘制图形应急队伍用
- @POST
- @ProduceMime("application/json")
- @Path("/queryTeam/")
- public String queryTeam(String params){
- log.info(params);
- String dept_id = Utils.getParameter("deptId", params);
- if(this.verifyParams(dept_id)){
- String sql = "select fd_objectid,team_name from ECM_AM_EMERGENCY_TEAM where is_del='0'" +
- this.getOneSqlWhere("TEAM_COMP_ID", dept_id) +
- " and team_name is not null" ;
- return ctDao.queryTeam(sql) ;
- }
- return null ;
- }
-
- /**
- * 得到队伍详细信息
- * @return
- */
- @POST
- @ProduceMime("application/json")
- @Path("/queryTeamInfo")
- public String queryTeamInfo(String params){
- log.info(params);
- String fdId = Utils.getParameter("fdId", params);
- if(this.verifyParams(fdId)){
-
- String sql = "select TEAM_TYPE TYPE, FD_DESCRiPTION LEVEL, TEAM_LEADER LEADER, TEAM_PHONE PHONE " +
- "from ECM_AM_EMERGENCY_TEAM t1 left join bm_mapvaluecanst t2 " +
- "on t1.TEAM_LEVEL = t2.fd_code where t2.fd_type='BM_DYDJ' and FD_OBJECTID = '" + fdId + "'" ;
- return ctDao.queryTeamInfo(sql) ;
- }
- return null ;
- }
-
- //得到外部资源引用系统所属模块名称下拉单选列表
- @POST
- @ProduceMime("application/json")
- @Path("/queryArea/")
- public String queryArea(){
- String sql = "select area_id fd_id, area_name name from ECM_CM_MATICMAP where IS_DEL = '0' AND IS_USED = '0' ";
- return ctDao.queryRadioSelect(sql);
- }
-
- /**
- * 单位多选下拉树
- */
- /*@ProduceMime("application/json")
- @POST
- @Path("selectTreeDept")
- public String selectTreeDept(String params){
- log.info(params);
- String deptId = Utils.getParameter("unitId", params);
- String parentId = Utils.getParameter("parentId", params);
- if(this.verifyParams(deptId) && this.verifyParams(parentId)){
- int deptLevel = wsdxDept(deptId) ;
- if(deptLevel==1){
- return otherDao.wDept(deptId) ;
- }
- if(deptLevel==2){
- String res = otherDao.sDept(deptId) ;
- return res ;
- }
- if(deptLevel==3){
- return otherDao.dDept(deptId) ;
- }
- if(deptLevel==4){
- return otherDao.oDept(deptId) ;
- }
- if(deptLevel==5){
- return otherDao.oDept(deptId) ;
- }
-
- }
- return null ;
- }*/
-
- /**
- * 单位多选下拉树
- */
- @ProduceMime("application/json")
- @POST
- @Path("selectTreeDept")
- public String selectTreeDept(String params){
- log.info(params);
- String deptId = Utils.getParameter("unitId", params);
-
- if(this.verifyParams(deptId)){
- String sql = "SELECT DEPT_ID,PARENT_ID,DEPT_NAME FROM SYS_DEPARTMENT WHERE DEPT_TYPE = '1' " +
- "AND DEPT_NAME NOT LIKE '%管理所%' AND IS_DEL = '0' start WITH DEPT_ID = ? " +
- "CONNECT BY PRIOR DEPT_ID = PARENT_ID ";
- return otherDao.getDeptGzJson(sql, deptId);
-
- }
- return null ;
- }
-
- /**
- * 查询当前部门是网省地县哪级部门,返回12345分别对应网省地县其他
- */
- public int wsdxDept(String deptId){
- String sql = "SELECT DEPT_ID, DEPT_NAME FROM SYS_DEPARTMENT " +
- "WHERE IS_DEL = '0' AND PARENT_ID = '0' AND DEPT_CODE IS NOT NULL " +
- "AND DEPT_ID = ? ORDER BY SORT " ;
- if(otherDao.deptLevel(sql,deptId))
- return 1 ;//网级公司
-
- sql = "SELECT DEPT_ID, DEPT_NAME FROM SYS_DEPARTMENT WHERE IS_DEL = '0' AND " +
- "PARENT_ID in (SELECT DEPT_ID FROM SYS_DEPARTMENT WHERE PARENT_ID = '0' AND IS_DEL = '0'" +
- "AND DEPT_ID IS NOT NULL ) AND DEPT_ID = ? ORDER BY SORT " ;
- if(otherDao.deptLevel(sql,deptId))
- return 2 ;//省级公司
- sql = "SELECT DEPT_ID, DEPT_NAME FROM SYS_DEPARTMENT WHERE IS_DEL = '0' AND PARENT_ID in (" +
- "SELECT DEPT_ID FROM SYS_DEPARTMENT WHERE IS_DEL = '0' AND PARENT_ID in " +
- "(SELECT DEPT_ID FROM SYS_DEPARTMENT WHERE PARENT_ID = '0' AND IS_DEL = '0' AND DEPT_ID IS NOT NULL )" +
- ")AND DEPT_NAME LIKE '%供电局%' AND DEPT_ID = ? ORDER BY SORT " ;
- if(otherDao.deptLevel(sql, deptId))
- return 3 ;//市级公司
- sql = "SELECT DEPT_ID, DEPT_NAME FROM SYS_DEPARTMENT WHERE IS_DEL = '0' AND PARENT_ID IN (" +
- "SELECT DEPT_ID FROM SYS_DEPARTMENT WHERE IS_DEL = '0' AND PARENT_ID in (" +
- "SELECT DEPT_ID FROM SYS_DEPARTMENT WHERE IS_DEL = '0' AND PARENT_ID in (" +
- "SELECT DEPT_ID FROM SYS_DEPARTMENT WHERE PARENT_ID = '0' AND IS_DEL = '0' AND DEPT_ID IS NOT NULL )" +
- ")AND DEPT_NAME LIKE '%供电局%' )AND DEPT_NAME LIKE '%供电局%' AND DEPT_ID = ? ORDER BY SORT " ;
- if(otherDao.deptLevel(sql, deptId))
- return 4 ;//县级公司
-
- return 5 ;//其他公司
- }
-
- // /**
- // * 通过部门ID得到队伍树形单选下拉框(应急资源手绘图形添加应急队伍用)
- // * @param params
- // * @return
- // */
- // @POST
- // @ProduceMime("application/json")
- // @Path("/queryTeamByDept/")
- // public String queryTeamByDept(String params){
- // log.info(params);
- // String deptId = Utils.getParameter("deptId", params) ;
- // String sql = "" ;
- // if(this.verifyParams(deptId)){
- // sql += this.getOneSqlWhere("teamincidentid", deptId) ;
- // }
- // System.out.println("对应应急事件的应急队伍复选下拉框SQL: " + sql);
- // return ctDao.queryTeamByInci(sql) ;
- // }
- //
- //==========================================================================================
- /**
- * 根据部门ID得到子部门
- *
- * @param params
- * @return 部门树的所有一级子结构json对象
- */
- @ProduceMime("application/")
- @POST
- @Path("/queryAllSubDept/")
- public String queryAllSubDept(String params) {
-
- StringBuffer sb = new StringBuffer();
- boolean flag=false;
- OrgInDeptBean deptBean = new OrgInDeptBean();
- String deptid = Utils.getParameter("deptId", params) == null ? "" : Utils.getParameter("deptId", params);
- String id = Utils.getParameter("id", params) == null ? "" : Utils.getParameter("id", params);
- if(id==null||"".equals(id)){
- id=deptid;
- flag=true;
- }
- OrgInDeptVo dv;
- try {
- dv = deptBean.getDeptRootById(id);
- if(flag){
- sb.append(dv.getID() + ",");
- }
- if(checkId(id)){
- List<String>childList=new ArrayList<String>();
- childList=getChildList(id);
- for(int i=0;i<childList.size();i++){
- OrgInDeptVo dvo=new OrgInDeptVo();
- dvo=deptBean.getDeptRootById(childList.get(i));
- if(checkId(childList.get(i))){
- sb.append(dvo.getID() + ",");
-
- }else{
- sb.append(dvo.getID() + ",");
-
- }
- }
- }
-
- if (sb.lastIndexOf(",") > -1) {
- sb.deleteCharAt(sb.lastIndexOf(","));
- }
- log.info("str:" + sb);
- return sb.toString();
- } catch (Exception e) {
- log.error("查询内部组织机构根节点错误", e);
- return null;
- }
- }
-
- public List<String> getChildList(String id){
- SysModel sysmodel = ModelFactory.getSysmodel();
- SysPersistence persistence = PersistenceFactory.getInstance(sysmodel);
- String sql="select id from EMC_AM_ORG_DEPARTMENT_TEST where parent_id='"+id+"' and is_del='0'";
- try {
- ArrayList<String[]> list = persistence.getSearchResult(99, sql.toString());
- if(list==null||list.size()==0){
- return new ArrayList<String>();
- }else{
- List<String>tempList=new ArrayList<String>();
- for(int i=0;i<list.size();i++){
- tempList.add(list.get(i)[0]);
- }
- return tempList;
- }
- } catch (PersistenceException e) {
- e.printStackTrace();
- return new ArrayList<String>();
- }
- }
-
-
- public boolean checkId(String id){
- SysModel sysmodel = ModelFactory.getSysmodel();
- SysPersistence persistence = PersistenceFactory.getInstance(sysmodel);
- String sql="select * from EMC_AM_ORG_DEPARTMENT_TEST where parent_id='"+id+"' and is_del='0'";
- try {
- ArrayList<String[]> list = persistence.getSearchResult(99, sql.toString());
- if(list==null||list.size()==0){
- return false;
- }else{
- return true;
- }
- } catch (PersistenceException e) {
- e.printStackTrace();
- return false;
- }
-
- }
-
-
-
-
- //================================================工具辅助方法=============================================================
-
- /**
- * 查询返回的结果是不是空
- * @param sql 查询语句返回的json字符串
- * @return 如果有数据返回原字符串,如果没有数据返回null
- */
- public String isNullData(String res){
- if(res.length() < 5){
- return null ;
- }
- return res ;
- }
-
- /**
- * 校验参数是不是空
- * @param params
- * @return
- */
- public Boolean verifyParams(String params){
- if(params != null && !"".equals(params)&& !"undefined".equalsIgnoreCase(params) && params != "null")
- return true ;
- return false ;
- }
-
- /**
- * 得到单个sql精确查询条件
- * @param colum
- * @param value
- * @return
- */
- public String getOneSqlWhere(String colum, String value){
- StringBuffer sb = new StringBuffer() ;
- String [] valueArr = null ;
- valueArr = value.split(",") ;
- sb.append("and (") ;
- for(int i = 0 ; i < valueArr.length ; i++){
- sb.append( colum + " = '" + valueArr[i] + "' or ") ;
- }
- sb.delete(sb.length()-3, sb.length()) ;
- sb.append(")") ;
- return sb.toString() ;
- }
-
- /**
- * 得到单个sql模糊查询条件
- * @param colum
- * @param value
- * @return
- */
- public String getOneSqlWhereLike(String colum, String value){
- StringBuffer sb = new StringBuffer() ;
- String [] valueArr = null ;
- valueArr = value.split(",") ;
- sb.append("and (") ;
- for(int i = 0 ; i < valueArr.length ; i++){
- sb.append( colum + " like '%" + valueArr[i] + "%' or ") ;
- }
- sb.delete(sb.length()-3, sb.length()) ;
- sb.append(")") ;
- return sb.toString() ;
- }
-
- /**
- * 将字符串转换成List<String>数组
- * @param params
- * @return
- */
- public List<String> trunList(String params){
- List<String> list = new ArrayList<String>() ;
- String [] paramsArr = params.split(",") ;
- Collections.addAll(list, paramsArr) ;
-
- return list ;
-
- }
-
- /**
- * 得到应急资源省市JSON格式字符串
- * @param params
- * @param list
- * @return
- */
- public StringBuffer getErMarkerJson(String params, List<String>list){
- StringBuffer sb = new StringBuffer() ;
- if(list != null){
- sb.append("\"" + params + "\":[") ;
- for(String str : list){
- sb.append("\"" + str + "\",") ;
- }
- sb.deleteCharAt(sb.length()-1) ;
- sb.append("],") ;
- return sb ;
- }
- return sb ;
- }
-
-
- /**
- * 外部系统引用配置表格显示
- * @param params
- * @return
- */
- /*@POST
- @ProduceMime("application/json")
- @Path("/getGridExternal/")
- public String getGridExternal(String params){
- OperateAble persistence = new OperateImpl();
- log.info(params);
- RowSet rowSet = new RowSet();
- String listId = Utils.getParameter("listId", params);
- String firstPageNum = Utils.getParameter("pager.pageNo", params) == null ? "0" : Utils.getParameter("pager.pageNo", params);
- String limit = Utils.getParameter("pager.pageSize", params) == null ? "10" : Utils.getParameter("pager.pageSize", params);
- String sort = Utils.getParameter("sort", params);// 排序字段
- String dir = Utils.getParameter("direction", params);// 升序还是降序
- FormListImpl formList = (FormListImpl) XFormFactory.getXFormModel().getFormList(listId);
- String sql = "select t3.dept_name DEPT, t1.fd_objectid FD_ID, t1.tm_name NAME, " +
- "t1.tm_url URL,t2.area_name AREA, t1.tm_use USE from ecm_cm_thematic t1 left join " +
- "ECM_CM_MATICMAP t2 on t1.tm_areaid=t2.area_id left join SYS_DEPARTMENT " +
- "t3 on t1.sc_dept_id = t3.dept_id where t1.is_del='0' and t1.is_external='0' " ;
-
- System.out.println("外部引用系统配置查询sql: " + sql);
- try {
- rowSet = persistence.queryPagingAllDatas(formList, new StringBuffer(sql), firstPageNum, limit);
- } catch (PersistenceException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (TransformTypeException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- // 处理返回的结果,将结果适用于QuickUI
- JSONObject origin = JSONObject.fromObject(rowSet);
- String pageNoResult = origin.getString("total");
- String rowsResult = origin.getString("rows");
- String result = "{\"pager.pageNo\":" + firstPageNum + ",\"pager.totalRows\":"
- + pageNoResult + ",\"rows\":" + rowsResult + "}";
- log.info("qui====" + result);
- return result;
- } */
-
- //===================================================线路跳闸与变电站停运暂时去掉start================================
- // /**
- // * 线路跳闸,根据单位、电压等级、恢复状态 (0:已恢复,1:未恢复)查询线路编码 TRIPTIME
- // * @param params
- // * @return
- // */
- // @POST
- // @ProduceMime("application/")
- // @Path("/queryLineTrip/")
- // public String queryLineTrip(String params){
- // log.info(params);
- // String vcStr = Utils.getParameter("voltageClass", params);
- // String companyStr = Utils.getParameter("company", params);
- // String statusStr = Utils.getParameter("status", params) ;
- // String beginTime = Utils.getParameter("beginTime", params) ;
- // String endTime = Utils.getParameter("endTime", params) ;
- //
- // String sql = "select EQUIPMENTID from ECM_OMS_LINE_TRIP_OUT where 1=1 and IS_DEL = '0' " ;
- //
- // if(this.verifyParams(vcStr))
- // sql += this.getOneSqlWhere("VOLLEVEL", vcStr) ;
- // if(this.verifyParams(companyStr))
- // sql += this.getOneSqlWhere("INAREAID", companyStr) ;
- // if(this.verifyParams(statusStr)){
- //
- // if(statusStr.equals("0")){//恢复
- // sql += "and ontime is not null " ;
- // } else if(statusStr.equals("1")){//未恢复
- // sql += "and ontime is null " ;
- // }
- //
- // }
- // if(this.verifyParams(beginTime) && this.verifyParams(endTime))
- // sql += "and TRIPTIME BETWEEN '" + beginTime + "' AND '" + endTime + "'" ;
- //
- // System.out.println("线路跳闸查询:" + sql);
- //
- // return isNullData(lineTripDao.queryLinePsrId(sql)) ;
- // }
-
- /*//变电站停运,根据单位、电压等级、恢复状态 (0:已恢复,1:未恢复)查询变电站编码
- @POST
- @ProduceMime("application/")
- @Path("/querySubstationOutage/")
- public String querySubstationOutage(String params){
- log.info(params);
- String vcStr = Utils.getParameter("voltageClass", params);
- String companyStr = Utils.getParameter("company", params);
- String statusStr = Utils.getParameter("status", params) ;
-
- String sql = "select SUBSTATION_CODE from ECM_OMS_SUBSTATION_OUTAGE where 1=1 " ;
- // sql += getSqlLsWhere(params) ;
- String result = lineTripDao.querySubstationPsrId(sql) ;
-
- return isNullData(result.substring(0,result.length()-1)) ;
- }*/
-
-
- //================================================线路跳闸和变电站停运end===========================================
- //================================================表格暂时去掉=============================================================
- // /**
- // * 线路跳闸表格显示
- // * @param params
- // * @return
- // */
- // @POST
- // @ProduceMime("application/json")
- // @Path("/getGridLt/")
- // public String getGridLt(String params){
- // OperateAble persistence = new OperateImpl();
- // log.info(params);
- //
- // RowSet rowSet = new RowSet();
- // String listId = Utils.getParameter("listId", params);
- //
- // String firstPageNum = Utils.getParameter("pager.pageNo", params) == null ? "0" : Utils.getParameter("pager.pageNo", params);
- // String limit = Utils.getParameter("pager.pageSize", params) == null ? "10" : Utils.getParameter("pager.pageSize", params);
- // String sort = Utils.getParameter("sort", params);// 排序字段
- // String dir = Utils.getParameter("direction", params);// 升序还是降序
- //
- // FormListImpl formList = (FormListImpl) XFormFactory.getXFormModel().getFormList(listId);
- //
- //
- // String vollevel = Utils.getParameter("vollevel", params) ;//电压等级
- // String dept = Utils.getParameter("dept", params) ;//部门单位
- // String beginTime = Utils.getParameter("BEGINTIME", params) ; //开始时间
- // String endTime = Utils.getParameter("ENDTIME", params) ; //截止时间
- //
- // String sql = "select s.dept_name,vollevel,trip,reco from ( " +
- // "with t1 as(select INAREAID, VOLLEVEL, count(vollevel) as trip " +
- // "from ECM_OMS_LINE_TRIP_OUT where 1=1 " ;
- // if(this.verifyParams(vollevel))
- // sql += this.getOneSqlWhere("VOLLEVEL", vollevel) ;
- // if(this.verifyParams(dept))
- // sql += this.getOneSqlWhere("INAREAID", dept) ;
- // if(this.verifyParams(beginTime) && this.verifyParams(endTime))
- // sql += "and TRIPTIME BETWEEN '" + beginTime + "' AND '" + endTime + "'" ;
- //
- // sql += "group by INAREAID, VOLLEVEL,TRIPTIME)," +
- // "t2 as(select INAREAID,vollevel,isnull(count(vollevel),0) as recover from ECM_OMS_LINE_TRIP_OUT " +
- // "where RECLOSE = '0' " ;
- // if(this.verifyParams(vollevel))
- // sql += this.getOneSqlWhere("VOLLEVEL", vollevel) ;
- // if(this.verifyParams(dept))
- // sql += this.getOneSqlWhere("INAREAID", dept) ;
- // if(this.verifyParams(beginTime) && this.verifyParams(endTime))
- // sql += "and TRIPTIME BETWEEN '" + beginTime + "' AND '" + endTime + "'" ;
- //
- // sql += "group by INAREAID, VOLLEVEL,TRIPTIME) " +
- // "select t1.*, nvl(t2.recover, 0) as reco from t1 left join t2 " +
- // "on t1.INAREAID=t2.INAREAID and t1.vollevel=t2.vollevel) " +
- // "as a left join SYS_DEPARTMENT as s on a.inareaid = s.dept_id " ;
- //
- // System.out.println("线路跳闸表格查询sql: " + sql);
- // try {
- // rowSet = persistence.queryPagingAllDatas(formList, new StringBuffer(sql), firstPageNum, limit);
- // } catch (PersistenceException e) {
- // // TODO Auto-generated catch block
- // e.printStackTrace();
- // } catch (TransformTypeException e) {
- // // TODO Auto-generated catch block
- // e.printStackTrace();
- // }
- // // 处理返回的结果,将结果适用于QuickUI
- // JSONObject origin = JSONObject.fromObject(rowSet);
- // String pageNoResult = origin.getString("total");
- // String rowsResult = origin.getString("rows");
- //
- // String result = "{\"pager.pageNo\":" + firstPageNum + ",\"pager.totalRows\":"
- // + pageNoResult + ",\"rows\":" + rowsResult + "}";
- // log.info("qui====" + result);
- // return result;
- // }
- //=========================================负荷损失表格暂时去掉======================================
- // /**
- // * 负荷损失表格用(这里只针对线路跳闸的进行统计,因为没有变电站停运数据表)
- // * @param params
- // * @return
- // */
- /*@POST
- @ProduceMime("application/json")
- @Path("/getLoadLost/")
- public String getLoadLost(String params){
- OperateAble persistence = new OperateImpl();
- log.info(params);
- RowSet rowSet = new RowSet();
- String listId = Utils.getParameter("listId", params);
- String firstPageNum = Utils.getParameter("pager.pageNo", params) == null ? "0" : Utils.getParameter("pager.pageNo", params);
- String limit = Utils.getParameter("pager.pageSize", params) == null ? "10" : Utils.getParameter("pager.pageSize", params);
- String sort = Utils.getParameter("sort", params);// 排序字段
- String dir = Utils.getParameter("direction", params);// 升序还是降序
- FormListImpl formList = (FormListImpl) XFormFactory.getXFormModel().getFormList(listId);
-
- String vollevel = Utils.getParameter("vollevel", params) ;//电压等级
- String dept = Utils.getParameter("dept", params) ;//部门单位
- String reclose = Utils.getParameter("RECLOSE", params) ;//恢复状态
- String beginTime = Utils.getParameter("BEGINTIME", params) ; //开始时间
- String endTime = Utils.getParameter("ENDTIME", params) ; //截止时间
-
- StringBuffer sql = new StringBuffer() ;
- sql.append("select sum(LOSTLOAD) as loadlost, s.dept_name from ECM_OMS_LINE_TRIP_OUT as e " +
- "left join SYS_DEPARTMENT as s on e.inareaid = s.dept_id where 1=1 ") ;
-
- if(this.verifyParams(vollevel))
- sql.append(this.getOneSqlWhere("VOLLEVEL", vollevel)) ;
- if(this.verifyParams(dept))
- sql.append(this.getOneSqlWhere("INAREAID", dept)) ;
- if(this.verifyParams(reclose))
- sql.append(this.getOneSqlWhere("RECLOSE", reclose)) ;
- if(this.verifyParams(beginTime) && this.verifyParams(endTime))
- sql.append("and TRIPTIME BETWEEN '" + beginTime + "' AND '" + endTime + "'") ;
-
- sql.append("group by INAREAID, s.dept_name ") ;
-
- System.out.println("负荷损失表格sql: " + sql.toString());
-
- try {
- rowSet = persistence.queryPagingAllDatas(formList, sql, firstPageNum, limit) ;
- } catch (PersistenceException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (TransformTypeException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }z
-
- // 处理返回的结果,将结果适用于QuickUI
- JSONObject origin = JSONObject.fromObject(rowSet);
- String pageNoResult = origin.getString("total");
- String rowsResult = origin.getString("rows");
- String result = "{\"pager.pageNo\":" + firstPageNum + ",\"pager.totalRows\":"
- + pageNoResult + ",\"rows\":" + rowsResult + "}";
- log.info("qui====" + result);
- return result;
- } */
- /**
- * 获得工程上下文路径
- * @return json {"context":"protocol://ip:port:/project"}
- */
- @GET
- @ProduceMime("application/json")
- @Path("/getContext")
- public String getContext() {
- HttpServletRequest req = mc.getHttpServletRequest();
- String path = req.getContextPath();
- String ctx = req.getScheme() + "://" + req.getServerName() + ":" + req.getServerPort()
- + path;
- JSONObject obj = new JSONObject();
- try {
- obj.put("context", ctx);
- } catch (JSONException e) {
- }
- return obj.toString();
- }
- /**
- * 获得95598来电数
- * @return json {"context":"protocol://ip:port:/project"}
- */
- @POST
- @ProduceMime("application/json")
- @Path("/getCallNum")
- public String getCallNum(String params) {
- String startDate = Utils.getParameter("beginTime", params);//开始时间
- String endDate = Utils.getParameter("endTime", params);//结束时间
- String organizationid = Utils.getParameter("ID", params);//人资ID
- String[] arr=organizationid.split(",");
- List<String> organizationId=new ArrayList<String>();
- for(int i=0;i<arr.length;i++){
- String str=arr[i];
- organizationId.add(str);
- }
- String result=gpsTaskWebService.call95598(startDate, endDate, organizationId);
- return result;
- }
-
- /**
- * 新闻页码数
- * @param params
- * @return
- * @throws PersistenceException
- */
- @ProduceMime("application/json")
- @POST
- @Path("/getNewsByCountPage")
- public String getNewsByCountPage(String params) {
- log.info(params);
- int listNum = Integer.parseInt(Utils.getParameter("listNum", params));
- String type = Utils.getParameter("newsType",params) ;//新闻类型
-
- String sql = "select count(1) pageCount from EMC_AM_NEWS where IS_DEL='0' " +
- "and (NEW_TITLE like '%应急%' or NEW_TITLE like '%保供电%' or NEW_TITLE like '%抗冰%' " +
- "or NEW_TITLE like '%台风%' or NEW_TITLE like '%地震%') " ;
- if(this.verifyParams(type)){
- sql += "and NEW_TYPE='" + type + "' " ;
- }
-
- double pc = emerDao.pageCount(sql);
- return "{\"countList\":" + pc + ",\"countPage\":"+(int)Math.ceil(pc/listNum) + "}";
- }
-
- /**
- * 新闻
- * @param params
- * @return
- * @throws PersistenceException
- */
- @ProduceMime("application/json")
- @POST
- @Path("/getNews")
- public String getNews(String params) throws PersistenceException {
- String type = Utils.getParameter("newsType",params) ;//新闻类型
- String begin = Utils.getParameter("begin", params) ;
- String end = Utils.getParameter("end", params) ;
- if(this.verifyParams(begin) && this.verifyParams(end)){
-
- String sql = "select FD_ID, NAME, PDATE, RN from ( select FD_OBJECTID FD_ID, " +
- "NEW_TITLE NAME,NEW_UPDATETIME PDATE, ROWNUM RN from EMC_AM_NEWS " +
- "where IS_DEL='0' and (NEW_TITLE like '%应急%' or NEW_TITLE like '%保供电%' " +
- "or NEW_TITLE like '%抗冰%' or NEW_TITLE like '%台风%' or NEW_TITLE like '%地震%') " ;
- if(this.verifyParams(type)){
- sql += "and NEW_TYPE=? )where RN between ? and ?" ;
- return otherDao.getGovDocDayList(sql, type, begin, end);
- } else {
- sql += ")where RN between ? and ?" ;
- return otherDao.getGovDocDayList(sql, begin, end);
- }
-
- }
-
- return null ;
-
- /*String json ;
- if(this.verifyParams(type)){
- json = otherDao.getNewsTwo(type);
- // select NEW_TITLE,FD_OBJECTID,NEW_UPDATETIME from EMC_AM_NEWS where IS_DEL='0' and NEW_TYPE='"+type+"' and (NEW_TITLE like '%应急%' or NEW_TITLE like '%保供电%' or NEW_TITLE like '%抗冰%' or NEW_TITLE like '%台风%' or NEW_TITLE like '%地震%')";
- } else {
- json = otherDao.getNews();
- }
- return json;*/
- }
-
-
- /**
- * 政府来文来函最新日期查询
- */
- @ProduceMime("application/")
- @POST
- @Path("/getGovDocDay")
- public String getGovDocDay(String params){
- log.info(params);
- String dept = Utils.getParameter("deptId", params);
- if(this.verifyParams(dept)){
- String sql = "select top 1 PRINT_DATE PDATE from EMC_AM_GOVERNMENT_DOCUMENT where is_del='0' " +
- "and IS_ISSUE = '1' and PRINT_DATE is not null and UNITE = ? order by PRINT_DATE desc";
- Date day = otherDao.getGovDocDay(sql, dept);
- if(day==null)
- return null;
- return day.toString();
- }
- return null ;
- }
-
- /**
- * 政府来文来函跟据日期查询页码数
- */
- @ProduceMime("application/")
- @POST
- @Path("/getGovDocDayByCountPage")
- public String getGovDocDayByCountPage(String params){
- log.info(params);
- int listNum = Integer.parseInt(Utils.getParameter("listNum", params));
- String dept_id = Utils.getParameter("deptId", params) ;
- String begin = Utils.getParameter("beginDay", params);
- String end = Utils.getParameter("endDay", params) ;
-
- if(this.verifyParams(listNum + "") && this.verifyParams(dept_id) && this.verifyParams(begin) && this.verifyParams(end)){
- String sql = "select count(1) pageCount from EMC_AM_GOVERNMENT_DOCUMENT " +
- "where is_del='0' and IS_ISSUE = '1' " + this.getOneSqlWhere("UNITE", dept_id) + " and PRINT_DATE is not null " +
- "and (PRINT_DATE between '" + begin + "' and '" + end + "' or PRINT_DATE between '" +
- begin + " 00:00:00 ' and '" + end + " 23:59:59' )" ;
-
- double pc = emerDao.pageCount(sql);
- // System.out.println("{\"countList\":" + pc + ",\"countPage\":"+(int)Math.ceil(pc/listNum) + "}");
- return "{\"countList\":" + pc + ",\"countPage\":"+(int)Math.ceil(pc/listNum) + "}";
-
- }
- return null ;
-
- }
-
- /**
- * 政府来文来函跟据日期查询
- */
- @ProduceMime("application/json")
- @POST
- @Path("/getGovDocDayList")
- public String getGovDocDayList(String params){
- log.info(params);
- String deptId = Utils.getParameter("deptId", params);
- String beginDay = Utils.getParameter("beginDay", params);
- String endDay = Utils.getParameter("endDay", params) ;
- String begin = Utils.getParameter("begin", params) ;
- String end = Utils.getParameter("end", params) ;
- if(this.verifyParams(deptId) && this.verifyParams(beginDay) && this.verifyParams(endDay) && this.verifyParams(begin) && this.verifyParams(end)){
-
- String sql = "select FD_ID, NAME, PDATE, RN from (select FD_ID, NAME, PDATE, ROWNUM RN from ( " +
- "select FD_OBJECTID FD_ID, DOCUMENT_NAME NAME, PRINT_DATE PDATE from " +
- "EMC_AM_GOVERNMENT_DOCUMENT where is_del='0' and IS_ISSUE = '1' " + this.getOneSqlWhere("UNITE", deptId) +
- "and (PRINT_DATE between ? and ? or PRINT_DATE between ? and ?) ))where RN between ? and ? ;" ;
- return otherDao.getGovDocDayList(sql, beginDay, endDay, beginDay+" 00:00:00", endDay+" 23:59:59", begin, end) ;
-
- }
- return null ;
- }
-
-
- /**
- * 应急发文/应急专报等级部门查询条件
- * @param deptLevel 部门等级 0/1/2 上级/本级/下级
- * @return 返回部门级别对应的条件
- */
- public String getWhereGovDoc(String deptLevel, String deptId, String parentId){
- String where = "" ;
- if(deptLevel=="0" || "0".equals(deptLevel)){
-
- where = "LEFT JOIN (SELECT DEPT_ID, DEPT_NAME, DEPT_TYPE, PARENT_ID FROM NWYJ.SYS_DEPARTMENT " +
- "WHERE DEPT_ID = '" + parentId +
- "' ) u2 on u1.WDEPT = u2.DEPT_ID where u1.WDEPT in u2.DEPT_ID " ;
-
- }else if(deptLevel=="1" || "1".equals(deptLevel)){
-
- // where = "left join SYS_DEPARTMENT u2 on u1.WDEPT = u2.DEPT_ID where (u1.WDEPT='" + deptId + "' or (u2.PARENT_ID='" + deptId + "' ))" ;
- where = "LEFT JOIN NWYJ.SYS_DEPARTMENT u2 ON u1.WDEPT = u2.DEPT_ID where (u1.WDEPT='" + deptId + "')" ;
-
- }else if(deptLevel=="2" || "2".equals(deptLevel)){
-
- /*where = "left join (select DEPT_ID, DEPT_NAME, DEPT_TYPE, PARENT_ID from SYS_DEPARTMENT s where " +
- "s.IS_DEL='0' and s.PARENT_ID='" + deptId + "') u2 on " +
- "u1.WDEPT = u2.DEPT_ID where u1.WDEPT in u2.DEPT_ID or (u1.WDEPT in u2.PARENT_ID)" ;*/
- /*where = "LEFT JOIN (SELECT DEPT_ID, DEPT_NAME, DEPT_TYPE, PARENT_ID FROM NWYJ.SYS_DEPARTMENT s WHERE " +
- "s.IS_DEL='0' and s.PARENT_ID='" + deptId + "') u2 ON " +
- "u1.WDEPT = u2.DEPT_ID " ;*/
- where = ", (SELECT DEPT_ID, DEPT_NAME, DEPT_TYPE, PARENT_ID FROM NWYJ.SYS_DEPARTMENT s WHERE " +
- "s.IS_DEL='0' and s.PARENT_ID='" + deptId + "') u2 WHERE " +
- "u1.WDEPT = u2.DEPT_ID " ;
- }
-
- // System.out.println("-------------------------------------");
- // System.out.println("0/1/2 上级/本级/下级" + ": " + deptLevel);
- // System.out.println(where);
- return where ;
- }
-
- /**
- * 查询应急发文总数
- * @param params
- * @return
- */
- @POST
- @ProduceMime("application/json")
- @Path("/pageCountByGovDoc")
- public String pageCountByGovDoc(String params){
- log.info(params);
- int listNum = Integer.parseInt(Utils.getParameter("listNum", params));
- String deptId = Utils.getParameter("deptId", params);
- // String parentId = Utils.getParameter("parentId", params);
- String dept_level = Utils.getParameter("dept_level", params);
- String beginDay = Utils.getParameter("beginDay", params);
- String endDay = Utils.getParameter("endDay", params);
-
- String parentId = "" ;
- if(this.verifyParams(deptId)){
- // System.out.println(deptId);
- parentId = otherDao.getParentId(deptId);
- }
-
- if(this.verifyParams(parentId) && this.verifyParams(dept_level)){
- String sql = "" ;
- String where = this.getWhereGovDoc(dept_level, deptId, parentId) ;
- if(this.verifyParams(beginDay) && this.verifyParams(endDay)){
-
- sql = "select count(1) pageCount from ( select FD_ID, NAME, PDATE, UNIT, WDEPT, FLG from ( " +
- "(select t1.FD_OBJECTID FD_ID, t1.NAME, t1.RELEASE_DATE PDATE, t1.RELEASE_UNIT UNIT, " +
- "t1.WRITE_DEPT WDEPT,1 FLG from ECM_EM_GOV_ALERT_NOTICE t1 where IS_DEL='0' and " +
- "EARLY_WARNING_STATUS = '33' and RELEASE_DATE between '" + beginDay +
- "' and '" + endDay + ") union all (select t2.FD_OBJECTID FD_ID, t2.NAME, " +
- "t2.RELEASE_DATE PDATE, t2.RELEASE_UNIT UNIT, t2.WRITE_DEPT WDEPT, 2 FLG " +
- "from ECM_EM_GOV_RESPONSE_NOTICE t2 where IS_DEL='0' and RESPONSE_STATUS = '33' " +
- " and RELEASE_DATE between '" + beginDay + "' and '" + endDay +
- ")) order by PDATE desc ) as u1 " + where ;
- } else {
-
- sql = "select count(1) pageCount from ( select FD_ID, NAME, PDATE, UNIT, WDEPT, FLG from ( " +
- "(select t1.FD_OBJECTID FD_ID, t1.NAME, t1.RELEASE_DATE PDATE, t1.RELEASE_UNIT UNIT, " +
- "t1.WRITE_DEPT WDEPT,1 FLG from ECM_EM_GOV_ALERT_NOTICE t1 where IS_DEL='0' and " +
- "EARLY_WARNING_STATUS = '33' ) union all (select t2.FD_OBJECTID FD_ID, t2.NAME, " +
- "t2.RELEASE_DATE PDATE, t2.RELEASE_UNIT UNIT, t2.WRITE_DEPT WDEPT, 2 FLG " +
- "from ECM_EM_GOV_RESPONSE_NOTICE t2 where IS_DEL='0' and RESPONSE_STATUS = '33' " +
- ")) order by PDATE desc ) as u1 " + where ;
- }
-
-
- double pc = emerDao.pageCount(sql);
- return "{\"countList\":" + pc + ",\"countPage\":"+(int)Math.ceil(pc/listNum) + "}";
- }
- return null ;
- }
-
- /**
- * 应急发文查询
- * @param params
- * @return
- */
- @ProduceMime("application/json")
- @POST
- @Path("/getGovDocNotice")
- public String getGovDocNotice(String params){
- log.info(params);
- String deptId = Utils.getParameter("deptId", params);
- // String parentId = Utils.getParameter("parentId", params);
- String dept_level = Utils.getParameter("dept_level", params);
-
- String begin = Utils.getParameter("begin", params);
- String end = Utils.getParameter("end", params);
- String beginDay = Utils.getParameter("beginDay", params);
- String endDay = Utils.getParameter("endDay", params);
-
- String parentId = "" ;
- if(this.verifyParams(deptId)){
- // System.out.println(deptId);
- parentId = otherDao.getParentId(deptId);
- }
-
- if(this.verifyParams(deptId) && this.verifyParams(begin) && this.verifyParams(end) && this.verifyParams(dept_level)){
- String sql = "" ;
- String where = this.getWhereGovDoc(dept_level, deptId, parentId);
- if(this.verifyParams(beginDay) && this.verifyParams(endDay)){
- sql = "select FD_ID, NAME, PDATE, UNIT, WDEPT, FLG, RN from( " +
- "select FD_ID, NAME, PDATE, UNIT, WDEPT, FLG, rownum RN from ( " +
- "select FD_ID, NAME, PDATE, UNIT, WDEPT, FLG from (" +
- "(select t1.FD_OBJECTID FD_ID, t1.NAME, t1.RELEASE_DATE PDATE, " +
- "t1.RELEASE_UNIT UNIT, t1.WRITE_DEPT WDEPT,1 FLG from ECM_EM_GOV_ALERT_NOTICE t1 " +
- "where IS_DEL='0' and EARLY_WARNING_STATUS = '33' and RELEASE_DATE between '" + beginDay +
- "' and '" + endDay + "') union all (select t2.FD_OBJECTID FD_ID, " +
- "t2.NAME, t2.RELEASE_DATE PDATE, t2.RELEASE_UNIT UNIT, t2.WRITE_DEPT WDEPT, 2 FLG " +
- "from ECM_EM_GOV_RESPONSE_NOTICE t2 where IS_DEL='0' and RESPONSE_STATUS = '33' " +
- "and RELEASE_DATE between '" + beginDay + "' and '" + endDay + "')" +
- ") order by PDATE desc) as u1 " + where +
- ")as t5 where RN between " + begin + " and " + end + " " ;
-
- } else {
-
- sql = "select FD_ID, NAME, PDATE, UNIT, WDEPT, FLG, RN from( " +
- "select FD_ID, NAME, PDATE, UNIT, WDEPT, FLG, rownum RN from ( " +
- "select FD_ID, NAME, PDATE, UNIT, WDEPT, FLG from (" +
- "(select t1.FD_OBJECTID FD_ID, t1.NAME, t1.RELEASE_DATE PDATE, " +
- "t1.RELEASE_UNIT UNIT, t1.WRITE_DEPT WDEPT,1 FLG from ECM_EM_GOV_ALERT_NOTICE t1 " +
- "where IS_DEL='0' and EARLY_WARNING_STATUS = '33' ) union all (select t2.FD_OBJECTID FD_ID, " +
- "t2.NAME, t2.RELEASE_DATE PDATE, t2.RELEASE_UNIT UNIT, t2.WRITE_DEPT WDEPT, 2 FLG " +
- "from ECM_EM_GOV_RESPONSE_NOTICE t2 where IS_DEL='0' and RESPONSE_STATUS = '33' )" +
- ") order by PDATE desc) as u1 " + where +
- ")as t5 where RN between " + begin + " and " + end + " " ;
-
- }
-
- // System.out.println("======================================");
- // System.out.println(sql);
- return otherDao.getGovDocNotice(sql) ;
- }
- return null;
- }
-
-
- /**
- * 查询应急发文总数2
- * @param params
- * @return
- */
- @POST
- @ProduceMime("application/json")
- @Path("/pageCountByGovDoc2")
- public String pageCountByGovDoc2(String params){
- log.info(params);
- int listNum = Integer.parseInt(Utils.getParameter("listNum", params));
- String deptId = Utils.getParameter("deptId", params);
- String parentId = Utils.getParameter("parentId", params);
- String dept_level = Utils.getParameter("dept_level", params);
- String beginDay = Utils.getParameter("beginDay", params);
- String endDay = Utils.getParameter("endDay", params);
- if(this.verifyParams(deptId) && this.verifyParams(dept_level)){
- String sql = "" ;
- String where = this.getWhereGovDoc(dept_level, deptId, parentId) ;
- if(this.verifyParams(beginDay) && this.verifyParams(endDay)){
-
- sql = "select count(1) pageCount from ( select FD_ID, NAME, PDATE, UNIT, WDEPT, FLG from ( " +
- "(select t1.FD_OBJECTID FD_ID, t1.NAME, t1.RELEASE_DATE PDATE, t1.RELEASE_UNIT UNIT, " +
- "t1.CORP_ID WDEPT,1 FLG from JSC_ECM_EM_GOV_ALERT_NOTICE_VIEW t1 where IS_DEL='0' and " +
- "EARLY_WARNING_STATUS = '33' and RELEASE_DATE between '" + beginDay +
- "' and '" + endDay + ") union all (select t2.FD_OBJECTID FD_ID, t2.NAME, " +
- "t2.RELEASE_DATE PDATE, t2.RELEASE_UNIT UNIT, t2.CORP_ID WDEPT, 2 FLG " +
- "from JSC_ECM_EM_GOV_RESPONSE_NOTICE_VIEW t2 where IS_DEL='0' and RESPONSE_STATUS = '33' " +
- " and RELEASE_DATE between '" + beginDay + "' and '" + endDay +
- ")) order by PDATE desc ) as u1 " + where ;
- } else {
-
- sql = "select count(1) pageCount from ( select FD_ID, NAME, PDATE, UNIT, WDEPT, FLG from ( " +
- "(select t1.FD_OBJECTID FD_ID, t1.NAME, t1.RELEASE_DATE PDATE, t1.RELEASE_UNIT UNIT, " +
- "t1.WRITE_DEPT WDEPT,1 FLG from ECM_EM_GOV_ALERT_NOTICE t1 where IS_DEL='0' and " +
- "EARLY_WARNING_STATUS = '33' ) union all (select t2.FD_OBJECTID FD_ID, t2.NAME, " +
- "t2.RELEASE_DATE PDATE, t2.RELEASE_UNIT UNIT, t2.WRITE_DEPT WDEPT, 2 FLG " +
- "from ECM_EM_GOV_RESPONSE_NOTICE t2 where IS_DEL='0' and RESPONSE_STATUS = '33' " +
- ")) order by PDATE desc ) as u1 " + where ;
- }
-
-
- double pc = emerDao.pageCount(sql);
- return "{\"countList\":" + pc + ",\"countPage\":"+(int)Math.ceil(pc/listNum) + "}";
- }
- return null ;
- }
-
-
- /**
- * 应急发文查询2
- * @param params
- * @return
- */
- @ProduceMime("application/json")
- @POST
- @Path("/getGovDocNotice2")
- public String getGovDocNotice2(String params){
- log.info(params);
- String deptId = Utils.getParameter("deptId", params);
- String parentId = Utils.getParameter("parentId", params);
- String dept_level = Utils.getParameter("dept_level", params);
-
- String begin = Utils.getParameter("begin", params);
- String end = Utils.getParameter("end", params);
- String beginDay = Utils.getParameter("beginDay", params);
- String endDay = Utils.getParameter("endDay", params);
-
- if(this.verifyParams(deptId) && this.verifyParams(begin) && this.verifyParams(end) && this.verifyParams(dept_level)){
- String sql = "" ;
- parentId = otherDao.getParentId(deptId);
- String where = this.getWhereGovDoc(dept_level, deptId, parentId);
- if(this.verifyParams(beginDay) && this.verifyParams(endDay)){
- sql = "SELECT FD_ID, NAME, PDATE, UNIT, WDEPT, FLG, RN FROM( " +
- "SELECT FD_ID, NAME, PDATE, UNIT, WDEPT, FLG, ROWNUM RN FROM ( " +
- "SELECT FD_ID, NAME, PDATE, UNIT, WDEPT, FLG FROM (" +
- "(SELECT T1.FD_OBJECTID FD_ID, T1.NAME, T1.RELEASE_DATE PDATE, " +
- "T1.RELEASE_UNIT UNIT, T1.CORP_ID WDEPT,1 FLG FROM JSC_ECM_EM_GOV_ALERT_NOTICE_VIEW T1 " +
- "WHERE IS_DEL='0' AND EARLY_WARNING_STATUS = '33' AND RELEASE_DATE BETWEEN '" + beginDay +
- "' AND '" + endDay + "') UNION ALL (SELECT t2.FD_OBJECTID FD_ID, " +
- "T2.NAME, T2.RELEASE_DATE PDATE, T2.RELEASE_UNIT UNIT, T2.CORP_ID WDEPT, 2 FLG " +
- "FROM JSC_ECM_EM_GOV_RESPONSE_NOTICE_VIEW T2 WHERE IS_DEL='0' AND RESPONSE_STATUS = '33' " +
- "AND RELEASE_DATE BETWEEN '" + beginDay + "' AND '" + endDay + "')" +
- ") ORDER BY PDATE) AS U1 " + where +
- ")AS T5 WHERE RN BETWEEN " + begin + " AND " + end + " ORDER BY PDATE DESC" ;
-
- } else {
-
- sql = "SELECT FD_ID, NAME, PDATE, UNIT, WDEPT, FLG, RN FROM( " +
- "SELECT FD_ID, NAME, PDATE, UNIT, WDEPT, FLG, ROWNUM RN FROM ( " +
- "SELECT FD_ID, NAME, PDATE, UNIT, WDEPT, FLG FROM (" +
- "(SELECT T1.FD_OBJECTID FD_ID, T1.NAME, T1.RELEASE_DATE PDATE, " +
- "T1.RELEASE_UNIT UNIT, T1.CORP_ID WDEPT,1 FLG FROM JSC_ECM_EM_GOV_ALERT_NOTICE_VIEW T1 " +
- "WHERE IS_DEL='0' AND EARLY_WARNING_STATUS = '33' ) UNION ALL (SELECT T2.FD_OBJECTID FD_ID, " +
- "T2.NAME, T2.RELEASE_DATE PDATE, T2.RELEASE_UNIT UNIT, T2.CORP_ID WDEPT, 2 FLG " +
- "FROM JSC_ECM_EM_GOV_RESPONSE_NOTICE_VIEW T2 WHERE IS_DEL='0' AND RESPONSE_STATUS = '33' )" +
- ") ORDER BY PDATE desc) AS u1 " + where +
- ")AS T5 WHERE RN BETWEEN " + begin + " AND " + end + " ORDER BY PDATE DESC" ;
-
- }
-
- return otherDao.getGovDocNotice(sql) ;
- }
- return null;
- }
-
- /**
- * 全省停电用户复电比例
- */
- @ProduceMime("application/json")
- @POST
- @Path("/provUserRes")
- public String provUserRes(String params){
- log.info(params);
- String dept_id = Utils.getParameter("deptId", params);
- if(this.verifyParams(dept_id)){
- String sql = "select b.dept_name AS COMP_NAME,to_number(case WHEN TQ_TD_COUNT='' OR TQ_TD_COUNT IS NULL THEN 0 ELSE TQ_TD_COUNT END + case WHEN YH_TD_COUNT='' OR YH_TD_COUNT IS NULL THEN 0 ELSE YH_TD_COUNT END +case WHEN TJYH_TD_COUNT='' OR TJYH_TD_COUNT IS NULL THEN 0 ELSE TJYH_TD_COUNT END +case WHEN YJYH_TD_COUNT='' OR YJYH_TD_COUNT IS NULL THEN 0 ELSE YJYH_TD_COUNT END +case WHEN EJYH_TD_COUNT='' OR EJYH_TD_COUNT IS NULL THEN 0 ELSE EJYH_TD_COUNT END -case WHEN TQ_UNRECOVERED='' OR TQ_UNRECOVERED IS NULL THEN 0 ELSE TQ_UNRECOVERED END -case WHEN YH_UNRECOVERED='' OR YH_UNRECOVERED IS NULL THEN 0 ELSE YH_UNRECOVERED END -case WHEN TJYH_UNRECOVERED='' OR TJYH_UNRECOVERED IS NULL THEN 0 ELSE TJYH_UNRECOVERED END - case WHEN YJYH_UNRECOVERED='' OR YJYH_UNRECOVERED IS NULL THEN 0 ELSE YJYH_UNRECOVERED END -case WHEN EJYH_UNRECOVERED='' OR EJYH_UNRECOVERED IS NULL THEN 0 ELSE EJYH_UNRECOVERED END ) AS RECOVERED "
- + " FROM REPORT_GDSUNSHI_KEHUTD,sys_department b where report_id in( "
- + "select fd_objectid from report_records b where appear_time in( "
- + "select max(appear_time) from report_records where report_type='5' and comp_id ='"+dept_id+"') and comp_id='"+dept_id+"' and report_type='5') and comp_id=b.dept_id";
- return otherDao.provUserRes(sql);
- }
-
- return null ;
- }
-
- /**
- * 应急值班查询昨天今天明天的值班列表
- */
- @ProduceMime("application/json")
- @POST
- @Path("/getDutyThreeDays")
- public String getDutyThreeDays(String params){
- log.info(params);
- String firstPageNum = Utils.getParameter("pager.pageNo", params) == null ? "0" : Utils
- .getParameter("pager.pageNo", params);
- String limit = Utils.getParameter("pager.pageSize", params) == null ? "10" : Utils
- .getParameter("pager.pageSize", params);
- String dept_id = Utils.getParameter("deptId", params);
- String begin = Utils.getParameter("begin", params);
- String end = Utils.getParameter("end", params);
- String date= Utils.getParameter("date", params);
- SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
- java.util.Date endDate=null;
- java.util.Date beginDate=null;
- String result="";
- try {
- endDate=sdf.parse(date);
- endDate.setDate(endDate.getDate()+1);
- end=sdf.format(endDate);
- beginDate=sdf.parse(date);
- beginDate.setDate(beginDate.getDate()-2);
- begin=sdf.format(beginDate);
- } catch (ParseException e) {
- log.error(e.getMessage());
- }
-
-
- List<Map<String ,String>> list= null;
-
- if(this.verifyParams(dept_id) && this.verifyParams(begin) && this.verifyParams(end)){
- /*String sql = "select t1.FD_OBJECTID, t1.LEADER_NAME, t1.LEADER_TEL,t1.TELEPHONE,t2.DEPT_NAME,t2.DEPT_NAMES,t2.OPER_DEPT , t1.START_TIME , t1.END_TIME " +
- "from ECM_EM_DUTY_DETAIL t1 left join ECM_EM_DUTY_VIEW t2 " +
- "on t1.DUTY_ID = t2.FD_OBJECTID where t1.IS_DEL ='0' AND t2.DUTY_TYPE ='1' " +
- "and t2.RELEASE='1' AND t2.DEPT_NAMES='" + dept_id +
- "' and t1.START_TIME between '" + begin + " 23:59:59' and '" + end + " 00:00:00' order by t1.START_TIME desc " ;*/
- String sql = "select count(1) TOTAL"
- + " from ECM_EM_DUTY_ALERT_INFO d1 left join ECM_EM_DUTY d2"
- + " on d1.DUTY_ID =d2.fd_objectid"
- + " left join SYS_DEPARTMENT d3 "
- + " on d2.DEPT_NAMES=d3.dept_id "
- //+ " left join BM_MAPVALUECANST d4 "
- //+ " on d4.FD_TYPE='BM_DUTYWAYSTATE' AND d4.FD_CODE=d1.DUTY_WAY "
- + " where d1.DAY_TIME between '" + begin + " 23:59:59' and '" + end + " 00:00:00' "
- + " and d3.CORP_ID in('"+dept_id+"') and d2.is_del='0' and d2.RELEASE='1'"
- + " ORDER BY d1.DUTY_NAME";
- String sql1 = "select d1.DUTY_NAME leader_name,d1.DUTY_NAME_TEL leader_tel,"
- + "d1.DATE_TIME,d3.dept_id,substr(d1.DAY_TIME,0,10) DUTY_DATE, "
- + "d3.DEPT_NAME DEPT_NAME ,d3.CORP_NAME CORP_NAME "
- + " from ECM_EM_DUTY_ALERT_INFO d1 left join ECM_EM_DUTY d2"
- + " on d1.DUTY_ID =d2.fd_objectid"
- + " left join SYS_DEPARTMENT d3 "
- + " on d2.DEPT_NAMES=d3.dept_id "
- //+ " left join BM_MAPVALUECANST d4 "
- //+ " on d4.FD_TYPE='BM_DUTYWAYSTATE' AND d4.FD_CODE=d1.DUTY_WAY "
- + " where d1.DAY_TIME between '" + begin + " 23:59:59' and '" + end + " 00:00:00' "
- + " and d3.CORP_ID in('"+dept_id+"') and d2.is_del='0' and d2.RELEASE='1'"
- + " ORDER BY d1.DUTY_NAME limit "+(Integer.valueOf(firstPageNum)-1)*Integer.valueOf(limit)+","+Integer.valueOf(limit);
- list = otherDao.getDutyThreeDays(sql);
- String total=list.get(0).get("TOTAL");
- list = otherDao.getDutyThreeDays(sql1);
- log.info(JSONArray.fromObject(list).toString());
-
- result = "{\"pager.pageNo\":"+firstPageNum+",\"pager.totalRows\":"
- + total + ",\"rows\":" + JsonPluginsUtil.listToJson(list)+ "}";
-
- return result;
- //return "{\"rows\":"+JSONArray.fromObject(list).toString()+"}";
- }
- return null ;
- }
-
- /**
- * 应急专报简报页码查询
- */
- @ProduceMime("application/json")
- @POST
- @Path("getBrieFingByCountPage")
- public String getBrieFingByCountPage(String params){
- log.info(params);
- int listNum = Integer.parseInt(Utils.getParameter("listNum", params));
- String dept_id = Utils.getParameter("deptId", params);
- // String parentId = Utils.getParameter("parentId", params);
- String dept_level = Utils.getParameter("dept_level", params);
- String flg = Utils.getParameter("flg", params) ;
-
- String parentId = "" ;
- if(this.verifyParams(dept_id)){
- // System.out.println(dept_id);
- parentId = otherDao.getParentId(dept_id);
- }
-
- if(this.verifyParams(parentId) && this.verifyParams(flg) && this.verifyParams(dept_level)){
- String where = this.getWhereGovDoc(dept_level, dept_id, parentId);
-
- // String sql = "select count(1) pageCount from ECM_EM_ALERT_REPORT_INPUT where IS_DEL = '0' " +
- // "and IS_RELEASE = '1' and REPORT_TYPE = '" + flg + this.getOneSqlWhere("INPUT_UNIT", dept_id);
-
- String sql = "select count(1) pageCount from (select FD_ID, NAME, PDATE, WDEPT from ( " +
- "select FD_OBJECTID FD_ID, REPORT_NAME NAME, INPUT_DATE PDATE, INPUT_UNIT WDEPT from " +
- "ECM_EM_ALERT_REPORT_INPUT where IS_DEL = '0' and IS_RELEASE = '1' and REPORT_TYPE = '" +
- flg + "' ) as u1 " + where +
- " order by WDEPT DESC ) as t3" ;
- double pc = emerDao.pageCount(sql);
- return "{\"countList\":" + pc + ",\"countPage\":"+(int)Math.ceil(pc/listNum) + "}";
-
- }
- return null ;
- }
-
- /**
- * 应急专报简报
- */
- @ProduceMime("application/json")
- @POST
- @Path("getBriefing")
- public String getBriefing(String params){
- log.info(params);
-
- String dept_id = Utils.getParameter("deptId", params);
- // String parentId = Utils.getParameter("parentId", params);
-
- String dept_level = Utils.getParameter("dept_level", params);
- String flg = Utils.getParameter("flg", params);
- String begin = Utils.getParameter("begin", params);
- String end = Utils.getParameter("end", params);
-
- String parentId = "" ;
- if(this.verifyParams(dept_id)){
- // System.out.println(dept_id);
- parentId = otherDao.getParentId(dept_id);
- }
-
- if(this.verifyParams(dept_id) && this.verifyParams(parentId) && this.verifyParams(flg) && this.verifyParams(begin) && this.verifyParams(end) && this.verifyParams(dept_level)){
- String where = this.getWhereGovDoc(dept_level, dept_id, parentId) ;
-
- // String sql = "select FD_ID, NAME, PDATE, RN from ( " +
- // "select FD_ID, NAME, PDATE, ROWNUM RN from ( " +
- // "select FD_OBJECTID FD_ID, REPORT_NAME NAME, INPUT_DATE PDATE from " +
- // "ECM_EM_ALERT_REPORT_INPUT where IS_DEL = '0' and IS_RELEASE = '1' " +
- // "and REPORT_TYPE = ? " + this.getOneSqlWhere("INPUT_UNIT", dept_id) +
- // "order by INPUT_DATE DESC ))where ROWNUM between " + begin + " and " + end ;
- // System.out.println(where);
- // System.out.println(parentId);
- // System.out.println(dept_level);
-
-
- String sql = "SELECT FD_ID, NAME, PDATE, RN FROM (SELECT FD_ID, NAME, PDATE, ROWNUM RN FROM ( " +
- "SELECT FD_ID, NAME, PDATE, WDEPT FROM (SELECT FD_OBJECTID FD_ID, REPORT_NAME NAME, " +
- "INPUT_DATE PDATE, INPUT_UNIT WDEPT FROM ECM_EM_ALERT_REPORT_INPUT WHERE " +
- "IS_DEL = '0' AND IS_RELEASE = '1' AND REPORT_TYPE = ? ) AS u1 " + where +
- "ORDER BY PDATE DESC )) as t3 WHERE RN BETWEEN " + begin + " AND " + end ;
- // System.out.println(dept_level+"\t"+dept_id+"\t"+parentId);
- // System.out.println("======================================================");
- // System.out.println(sql);
- // System.out.println(flg);
- return otherDao.getGovDocDayList(sql, flg);
- }
-
- return null ;
- }
-
- /**
- * 应急装备查看,队伍(总计数,网省级显示)
- */
- @ProduceMime("application/json")
- @POST
- @Path("/searchErByTeam")
- public String searchErByTeam(String params){
- log.info(params);
- String deptId = Utils.getParameter("deptId", params);
- String st = Utils.getParameter("searchType", params);
- /*String sql = "select FD_OBJECTID FD_ID, TEAM_NAME NAME, TEAM_MEMBER_NUMBER NUM, LONGITUDE, LATITUDE " +
- "from ECM_AM_EMERGENCY_TEAM where IS_DEL='0'" ;*/
- if(this.verifyParams(deptId) && this.verifyParams(st)){
- String sql = "SELECT * FROM TEAM_SCATTER_PROV_GIS_VIEW WHERE DEPT_ID = ? OR PARENT_ID = ?";
-
- if(st.equals("1") || st == "1"){
- sql = "SELECT * FROM TEAM_SCATTER_PROV_GIS_VIEW WHERE ?=? " + this.getOneSqlWhere("DEPT_ID", deptId) ;
- }
- log.info("GIS应急资源:应急队伍总数查询:"+sql);
- return erDao.searchErDistByTeam(sql,deptId);
- /*String sql = "select distinct t2.UNIT FD_ID, t3.DEPT_NAME NAME, t2.NUM, CFID, LONGITUDE, LATITUDE from " +
- "ECM_AM_EMERGENCY_TEAM t1 left join (select SUM(TEAM_MEMBER_NUMBER) NUM,COUNT" +
- "(FD_OBJECTID) CFID, TEAM_COMP_ID UNIT from ECM_AM_EMERGENCY_TEAM " +
- "where IS_DEL='0' group by TEAM_COMP_ID) t2 on t1.TEAM_COMP_ID = t2.UNIT " +
- "left join SYS_DEPARTMENT t3 on t2.UNIT = t3.DEPT_ID " +
- "where (t1.LONGITUDE<>NULL OR t1.LONGITUDE IS NOT NULL OR t1.LONGITUDE<>'<NULL>') " +
- "and t1.IS_DEL='0' and t1.LATITUDE<>'' " + this.getOneSqlWhere("t1.TEAM_COMP_ID", deptId);*/
-
-
-
-
-
- }
- return null ;
- }
-
- /**
- * 应急装备查看,发电车和发电机
- */
- @ProduceMime("application/json")
- @POST
- @Path("/searchErByEqui")
- public String searchErByEqui(String params){
- log.info(params);
- String deptId = Utils.getParameter("deptId", params);
- String st = Utils.getParameter("searchType", params);
-
- // String sql = "select FD_OBJECTID FD_ID, CAR_NAME NAME, CAR_NUM NUM, JINGDU LONGITUDE, WEIDU LATITUDE " +
- // "from EMC_AM_GENERATOR_CAR where IS_DEL='0'" ;
-
- if(this.verifyParams(deptId) && this.verifyParams(st)){
-
- /*String sql = "select a.FD_ID, a.NAME, a.NUM CN, b.NUM JN, a.LONGITUDE, a.LATITUDE from ( " +
- "select distinct t2.UNIT FD_ID, t3.DEPT_NAME NAME, t2.NUM, JINGDU LONGITUDE, WEIDU LATITUDE " +
- "from EMC_AM_GENERATOR_CAR t1 left join (select sum(CAR_NUM) NUM, COMP_ID UNIT " +
- "from EMC_AM_GENERATOR_CAR where IS_DEL='0' group by COMP_ID) t2 " +
- "on t1.COMP_ID = t2.UNIT left join SYS_DEPARTMENT t3 on t2.UNIT = t3.DEPT_ID ) as a join ( " +
- "select distinct t2.UNIT FD_ID, t3.DEPT_NAME NAME, t2.NUM, LONGITUDE, LATITUDE " +
- "from EMC_AM_GENERATOR t1 left join (select sum(NUM) NUM, COMP_ID UNIT " +
- "from EMC_AM_GENERATOR where IS_DEL='0' group by COMP_ID) t2 " +
- "on t1.COMP_ID = t2.UNIT left join SYS_DEPARTMENT t3 on t2.UNIT = t3.DEPT_ID " +
- ") as b on a.FD_ID = b.FD_ID AND (a.LONGITUDE<>NULL OR a.LONGITUDE IS NOT NULL OR a.LONGITUDE<>'<NULL>') " +
- "and a.LATITUDE<>'' where 1=1 " + this.getOneSqlWhere("a.FD_ID", deptId);*/
- String sql = "SELECT * FROM EQUI_SCATTER_PROV_GIS_VIEW WHERE DEPT_ID = ? OR PARENT_ID = ?";
- if(st.equals("1") || st == "1"){
- sql = "SELECT * FROM EQUI_SCATTER_PROV_GIS_VIEW WHERE ?=? " + this.getOneSqlWhere("DEPT_ID", deptId) ;
- }
- return erDao.searchErDistByEquip(sql,deptId);
- }
- return null ;
- }
-
- /**
- * 应急装备查看,发电车
- */
- @ProduceMime("application/json")
- @POST
- @Path("/searchErByCar")
- public String searchErByCar(String params){
- log.info(params);
- String deptId = Utils.getParameter("deptId", params);
- String st = Utils.getParameter("searchType", params);
-
- if(this.verifyParams(deptId) && this.verifyParams(st)){
-
- String sql = "SELECT * FROM EQUI_CAR_SCATTER_PROV_GIS_VIEW WHERE DEPT_ID = ? OR PARENT_ID = ?";
- if(st.equals("1") || st == "1"){
- sql = "SELECT * FROM EQUI_CAR_SCATTER_PROV_GIS_VIEW WHERE ?=? " + this.getOneSqlWhere("DEPT_ID", deptId) ;
- }
- return erDao.searchErByCar(sql, deptId, "发电车");
- }
- return null ;
- }
-
- /**
- * 应急装备查看,发电机
- */
- @ProduceMime("application/json")
- @POST
- @Path("/searchErByGen")
- public String searchErByGen(String params){
- log.info(params);
- String deptId = Utils.getParameter("deptId", params);
- String st = Utils.getParameter("searchType", params);
-
- if(this.verifyParams(deptId) && this.verifyParams(st)){
-
- String sql = "SELECT * FROM EQUI_GEN_SCATTER_PROV_GIS_VIEW WHERE DEPT_ID = ? OR PARENT_ID = ?";
- if(st.equals("1") || st == "1"){
- sql = "SELECT * FROM EQUI_GEN_SCATTER_PROV_GIS_VIEW WHERE ?=? " + this.getOneSqlWhere("DEPT_ID", deptId) ;
- }
- log.info("发电机SQL:"+sql);
- return erDao.searchErByCar(sql, deptId, "发电机");
- }
- return null ;
- }
-
- //
- /**
- * 临时场所查看
- */
- @ProduceMime("application/json")
- @POST
- @Path("/searchErByTempSpace")
- public String searchErByTempSpace(String params){
- log.info(params);
- String place_type = Utils.getParameter("place_type", params);
-
- String sql = "SELECT T1.FD_OBJECTID FD_ID, LONGITUDE, LATITUDE, SETTLEMENTS_NAME, PLACE, CONTACT_PERSON, " +
- "CONTACT_PERSON_TEL TELEPHONE, T2.NAME ICONNAME FROM ECM_EM_TEMPORARY_SETTLEMENTS T1 LEFT JOIN ECM_CM_GISICON T2 ON " +
- "(T1.PLACE_TYPES = T2.TYPE AND T2.LAYEROUT = 'place') WHERE T1.IS_DEL = '0' AND " +
- "T2.IS_DEL = '0' AND (LONGITUDE<>NULL OR LONGITUDE IS NOT NULL OR LONGITUDE<>'<NULL>') " +
- "AND (LATITUDE<>NULL OR LATITUDE IS NOT NULL OR LATITUDE<>'<NULL>') " ;
- if(this.verifyParams(place_type)){
- sql += this.getOneSqlWhere("PLACE_TYPES", place_type);
- }
- return erDao.searchErPlace(sql);
-
- }
-
- /**
- * 应急队伍分布查询,地市级显示
- */
- @ProduceMime("application/json")
- @POST
- @Path("/searchErByTeamPrev")
- public String searchErByTeamPrev(String params){
- log.info(params);
- String deptId = Utils.getParameter("deptId", params);
- String st = Utils.getParameter("searchType", params);
-
- if(this.verifyParams(deptId) && this.verifyParams(st)){
- String sql = "SELECT * FROM NWYJ.TEAM_SCATTER_GIS_VIEW WHERE DEPT_ID = ? OR PARENT_ID = ?" ;
- if(st.equals("1") || st == "1"){
- sql = "SELECT * FROM NWYJ.TEAM_SCATTER_GIS_VIEW WHERE ?=? " + this.getOneSqlWhere("DEPT_ID", deptId) ;
- }
-
- log.info("GIS队伍分布查询:"+sql+"; param:"+deptId);
- System.out.println(sql+"======="+deptId);
- return erDao.getTeamScatter(sql, deptId);
-
- }
- return null ;
- }
-
- /**
- * 应急装备(发电机)分布查询,地市级显示
- */
- @ProduceMime("application/json")
- @POST
- @Path("/searchErByEquiPrev")
- public String searchErByEquiPrev(String params){
- log.info(params);
- String deptId = Utils.getParameter("deptId", params);
- String st = Utils.getParameter("searchType", params);
- if(this.verifyParams(deptId) && this.verifyParams(st)){
-
- String sql = "SELECT * FROM DYNAMO_SCATTER_GIS_VIEW WHERE DEPT_ID = ? OR PARENT_ID = ?" ;
- if(st.equals("1") || st == "1"){
- sql = "SELECT * FROM DYNAMO_SCATTER_GIS_VIEW WHERE ?=? " + this.getOneSqlWhere("DEPT_ID", deptId) ;
- }
- return erDao.getEquiScatter(sql, deptId, "发电机","edui_prev");
-
- }
- return null ;
- }
-
- /**
- * 应急装备(发电车)分布查询,地市级显示
- */
- @ProduceMime("application/json")
- @POST
- @Path("/searchErByEquiCarPrev")
- public String searchErByEquiCarPrev(String params){
- log.info(params);
- String deptId = Utils.getParameter("deptId", params);
- String st = Utils.getParameter("searchType", params);
-
- if(this.verifyParams(deptId) && this.verifyParams(st)){
-
- String sql = "SELECT * FROM CAR_SCATTER_GIS_VIEW WHERE DEPT_ID = ? OR PARENT_ID = ?" ;
- if(st.equals("1") || st == "1"){
- sql = "SELECT * FROM CAR_SCATTER_GIS_VIEW WHERE ?=? " + this.getOneSqlWhere("DEPT_ID", deptId) ;
- }
- return erDao.getEquiScatter(sql, deptId, "发电车","car_prev");
- }
- return null ;
- }
-
- /* @ProduceMime("application/json")
- @POST
- @Path("/searchErByCar")
- public String searchErByCar(String params){
- log.info(params);
- String deptId = Utils.getParameter("deptId", params);
- // String sql = "select FD_OBJECTID FD_ID, CAR_NAME NAME, CAR_NUM NUM, JINGDU LONGITUDE, WEIDU LATITUDE " +
- // "from EMC_AM_GENERATOR_CAR where IS_DEL='0'" ;
- if(this.verifyParams(deptId)){
- String sql = "select distinct t2.UNIT FD_ID, t3.DEPT_NAME NAME, t2.NUM, JINGDU LONGITUDE, WEIDU LATITUDE " +
- "from EMC_AM_GENERATOR_CAR t1 left join (select sum(CAR_NUM) NUM, COMP_ID UNIT " +
- "from EMC_AM_GENERATOR_CAR where IS_DEL='0' group by COMP_ID) t2 " +
- "on t1.COMP_ID = t2.UNIT left join SYS_DEPARTMENT t3 on t2.UNIT = t3.DEPT_ID " +
- "where 1=1 " + this.getOneSqlWhere("t1.COMP_ID", deptId);
- return erDao.searchErDist(sql, "265");
- }
- return null ;
- }*/
-
- /**
- * 应急装备查看
- */
- /*@ProduceMime("application/json")
- @POST
- @Path("/searchErByGen")
- public String searchErByGen(String params){
- log.info(params);
- String deptId = Utils.getParameter("deptId", params);
- // String sql = "select FD_OBJECTID FD_ID, NAME, NUM, LONGITUDE, LATITUDE from EMC_AM_GENERATOR where IS_DEL='0'" ;
- if(this.verifyParams(deptId)){
- String sql = "select distinct t2.UNIT FD_ID, t3.DEPT_NAME NAME, t2.NUM, LONGITUDE, LATITUDE " +
- "from EMC_AM_GENERATOR t1 left join (select sum(NUM) NUM, COMP_ID UNIT " +
- "from EMC_AM_GENERATOR where IS_DEL='0' group by COMP_ID) t2 " +
- "on t1.COMP_ID = t2.UNIT left join SYS_DEPARTMENT t3 on t2.UNIT = t3.DEPT_ID " +
- "where 1=1 " + this.getOneSqlWhere("t1.COMP_ID", deptId);
- return erDao.searchErDist(sql, "266");
- }
-
- return null ;
- }*/
-
- /**
- * 查询网公司发布的应急预警通知单
- */
- @ProduceMime("application/json")
- @POST
- @Path("getCompanyHeadquartersEwer")
- public String getCompanyHeadquartersEwer(){
- String sql = "SELECT FD_OBJECTID, EARLY_WARNING_NAME NAME,decode(CURRENT_EW_LEVEL,null,CURRENT_ER_LEVEL, " +
- "CURRENT_EW_LEVEL)ELEVEL FROM ECM_EM_PUBLISH_ALERT_NOTICE t1 " +
- "WHERE IS_DEL = '0' AND IS_SEND = '5' AND RELEASE_UNIT = (" +
- "SELECT DEPT_ID FROM SYS_DEPARTMENT WHERE IS_DEL = '0' AND PARENT_ID = '0') " ;
- return ewerDao.getCompanyHeadquartersEwer(sql);
- }
-
- /**
- * 变电站视频树形结构
- * @param params
- * @return
- */
- @ProduceMime("application/json")
- @POST
- @Path("getSync")
- public String getSync(String params){
- log.info(params);
- // String parentID = Utils.getParameter("id", params) == null ? "0" : Utils.getParameter("id", params);
- String parentID = Utils.getParameter("id", params) ;
- String deptId = Utils.getParameter("deptId", params);
-
- String sql ;
-
- if(this.verifyParams(parentID)){
- sql = "select FD_OBJECTID FD_ID,EM_ID ID, EM_NAME NAME, PARENT_ID PID, CAMERA, EM_NUM, SUBLEVEL " +
- "from ECM_CM_SYNCVIDEOTREE where parent_id = '" + parentID + "' and IS_DEL = '0' and " +
- "(EM_NAME is not null OR EM_NAME<>'<NULL>') order by EM_NUM " ;
-
- }else{
- if(this.verifyParams(deptId)){
- if(deptId=="1" || "1".equals(deptId)){
- sql = "select FD_OBJECTID FD_ID,EM_ID ID, EM_NAME NAME, PARENT_ID PID, CAMERA, EM_NUM, SUBLEVEL " +
- "from ECM_CM_SYNCVIDEOTREE where IS_DEL = '0' and " +
- "(EM_NAME is not null OR EM_NAME<>'<NULL>') order by EM_NUM " ;
- }else{
- sql = "select FD_OBJECTID FD_ID,EM_ID ID, EM_NAME NAME, PARENT_ID PID, CAMERA, EM_NUM, SUBLEVEL " +
- "from ECM_CM_SYNCVIDEOTREE where DEPT_ID = '" + deptId + "' and IS_DEL = '0' and " +
- "(EM_NAME is not null OR EM_NAME<>'<NULL>') order by EM_NUM " ;
- }
- }else{
- return null ;
- }
- }
-
- // System.out.println("===============================================================================================");
- // System.out.println(sql);
- return otherDao.SyncTree(sql);
- }
-
- @ProduceMime("application/json")
- @POST
- @Path("getSyncConfig")
- public String getSyncConfig(){
- ConfigManager cm = ConfigManager.getInstance();
- StringBuffer sb = new StringBuffer();
- sb.append("{\"ip\":\"" + cm.getProper("emergency.ip") + "\",\"port\":\"" + cm.getProper("emergency.port") +
- "\",\"name\":\"" + cm.getProper("emergency.userName") + "\",\"pwd\":\"" + cm.getProper("emergency.pwd") +
- "\",\"mode\":\"" + cm.getProper("emergency.mode") + "\"}");
- return sb.toString();
- }
-
- // @ProduceMime("application/json")
- // @POST
- // @Path("/getDeptInfo")
- // public String getDeptInfo(String params){
- // log.info(params);
- // String deptId = Utils.getParameter("deptId", params);
- // InDepartmentService depts = new InDepartmentService();
- // if(this.verifyParams(deptId)){
- // String result = depts.getDepartmentInfo(deptId);
- // return result ;
- // }
- // return null ;
- // }
-
- /**
- * 地图保存图片功能用
- * @param params
- * @return
- */
- @ProduceMime("application/json")
- @POST
- @Path("getImg")
- public String getImg(String params) {
- log.info(params);
- String imgCode = Utils.getParameter("imgCode", params) ;
- BASE64Decoder decoder = new BASE64Decoder();
- String separator = System.getProperty("file.separator");
- String rootPath = System.getProperty("user.dir");
- rootPath = rootPath.substring(0,rootPath.length()-3);
-
- String tempPath = rootPath + "webapps" + separator + "nwyj" + separator + "upload" + separator +
- "NwyjTemp" + separator + "CockpitImg" ;
-
- String uidFile = UUID.randomUUID().toString() ;
- String fileName = separator + uidFile ;
- String imgName = separator + "map.png" ;
-
- String filePath = tempPath + separator + fileName ;
- String imgPath = filePath + separator + imgName ;
-
- File folder = new File(filePath);
- if(!(folder.exists() && folder.isDirectory())){
- folder.mkdirs();
- }
- try {
- byte[] bytes = decoder.decodeBuffer(imgCode);
- for (int i = 0; i < bytes.length; ++i) {
- if (bytes[i] < 0) {// 调整异常数据
- bytes[i] += 256;
- }
- }
-
- OutputStream out = new FileOutputStream(imgPath);
- out.write(bytes);
- out.flush();
- out.close();
- } catch (IOException e) { e.printStackTrace(); }
-
- return "{\"path\":\"" + uidFile + "\"}" ;
- }
-
-
- /**
- * 将地图临时文件
- * @param params
- * @return
- */
- @ProduceMime("application/json")
- @POST
- @Path("delTempImg")
- public String delTempImg(String params) {
- log.info(params);
- String imgFile = Utils.getParameter("imgFile", params) ;
- String separator = System.getProperty("file.separator");
- String rootPath = System.getProperty("user.dir");
- rootPath = rootPath.substring(0,rootPath.length()-3);
-
- String tempPath = rootPath + "webapps" + separator + "nwyj" + separator + "upload" + separator +
- "NwyjTemp" + separator + "CockpitImg" ;
-
- String fileName = separator + imgFile ;
- String filePath = tempPath + fileName ;
-
- String imgName = separator + "map.png" ;
- String imgPath = filePath + imgName ;
-
-
- File folder = new File(filePath);
- File imgFolder = new File(imgPath);
-
- if(!(folder.exists() && folder.isDirectory())){
-
- return null ;
- } else {
- if(imgFolder.exists()){
- imgFolder.delete();
- }
- Boolean flg = folder.delete();
- return "{\"res\":\"" + flg + "\"}" ;
- }
-
- }
-
- /**
- * 保存台风模拟路径信息
- * @return
- */
- @ProduceMime("application/json")
- @POST
- @Path("addSimulateTyphoonPath")
- public String addSimulateTyphoonPath(String params){
- log.info(params);
- String simu = Utils.getParameter("SIMU", params);
- String info = Utils.getParameter("INFO", params);
-
- SimulateTyphoon st = JsonPluginsUtil.jsonToBean(simu,SimulateTyphoon.class);
- List<SimulateTyphoonInfo> list = new ArrayList<SimulateTyphoonInfo>() ;
- list = JsonPluginsUtil.jsonToBeanList(info, SimulateTyphoonInfo.class);
-
- tran.addSimulateTyphoonPath(list, st);
- return null ;
- }
-
- @ProduceMime("application/json")
- @POST
- @Path("getHistoryTyphoonPath")
- public String getHistoryTyphoonPath(String params){
- log.info(params);
- String sid = Utils.getParameter("sid", params);
- if(this.verifyParams(sid)){
-
- String sql = "SELECT FD_OBJECTID FD_ID, LONGITUDE, LATITUDE, SEVEN_RADIUS, TEN_RADIUS, TWELVE_RADIUS, " +
- "MAX_STRENGTH, MAX_SPEED, MOVEMENT_SPEED, CENTRAL_PRESSURE, ORIENTATION, CREATE_TIME " +
- "FROM ECM_CM_SIMULATETYPHOONPATHINFO WHERE SIMULATEPATH_ID = ? ORDER BY ORDER_NUM " ;
- /*String sql = "SELECT FD_OBJECTID FD_ID, LONGITUDE, LATITUDE, SEVEN_RADIUS, TEN_RADIUS, TWELVE_RADIUS, " +
- "MAX_STRENGTH, MAX_SPEED, MOVEMENT_SPEED, CENTRAL_PRESSURE, ORIENTATION, CREATE_TIME " +
- "FROM ECM_CM_SIMULATETYPHOONPATHINFO WHERE SIMULATEPATH_ID = '" + sid + "' ORDER BY ORDER_NUM " ;*/
- return typhDao.getHistoryPath(sql, sid);
- }
- return null;
- }
- /*public static String readText(String filename){
- String content = "" ;
- try{
- File file = new File(filename);
- if(file.exists()){
- FileReader fr = new FileReader(file);
- BufferedReader br = new BufferedReader(fr);
- String str = "" ;
- String newline = "" ;
- while((str = br.readLine())!= null){
- content += newline + str ;
- newline = "\n";
- }
- br.close();
- fr.close();
- }
- } catch(IOException e) { e.printStackTrace(); }
- return content ;
- }*/
-
- }
|