3db6151e6892de6e83dded3e09a15d0d9019dc75.svn-base 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106
  1. package com.cockpit.dao;
  2. import java.sql.SQLException;
  3. import java.util.ArrayList;
  4. import java.util.Date;
  5. import java.util.HashMap;
  6. import java.util.Iterator;
  7. import java.util.List;
  8. import java.util.Map;
  9. import org.slf4j.LoggerFactory;
  10. import com.cockpit.util.CockpitUtil;
  11. import com.cockpit.vo.Posi;
  12. import com.cockpit.vo.Progream;
  13. import com.cockpit.vo.SaveType;
  14. import com.cockpit.vo.Yjzyincident;
  15. /**
  16. * 应急资源图层
  17. * @author zhumingyue
  18. *
  19. */
  20. public class EmergencyResourceDao extends ConnDaoImpl{
  21. CockpitToolDao ctDao = new CockpitToolDao() ;
  22. private CockpitUtil cutil = new CockpitUtil();
  23. private static final org.slf4j.Logger log = LoggerFactory.getLogger(EmergencyResourceDao.class);
  24. /**
  25. * 应急资源装备分布(发电车/发电机)
  26. * @param sql
  27. * @param dept_id
  28. * @param type
  29. * @return
  30. */
  31. public String getEquiScatter(String sql, String dept_id, String type, String icon){
  32. StringBuffer sb = new StringBuffer();
  33. sb.append("[");
  34. rs = executeQuerySetPs(sql, dept_id, dept_id);
  35. try {
  36. while(rs.next()){
  37. sb.append("{\"posX\":\"" + rs.getString("LON") + "\",\"posY\":\"" + rs.getString("LAT") +
  38. "\",\"title\":\"" + type + "名称:" + rs.getString("EQUI_NAME") +
  39. "\\n" + type + "类型:" + rs.getString("MODEL_TYPE") +
  40. "\\n" + type + "状态:" + rs.getString("USTAT") + "\\n地址:" + rs.getString("STORE_PLACE") +
  41. "\\n\\n负责人:" + rs.getString("DUTY_MEN") + "\\n负责人电话:" + rs.getString("PHONE") +
  42. "\",\"extraData\":{\"FD_OBJECTID\":\"" + rs.getString("FD_ID") +
  43. "\",\"name\":\"" + icon + "\"}},") ;
  44. }
  45. sb.deleteCharAt(sb.length() - 1) ;
  46. if(sb.length()==0){ return null ; }
  47. sb.append("]") ;
  48. log.info("装备分布坐标查询结果:" + sb.toString());
  49. return sb.toString() ;
  50. } catch (SQLException e) {
  51. log.error("装备分布坐标查询错误"+e.getMessage());
  52. } finally { closeAll(); }
  53. return null;
  54. }
  55. /**
  56. * 应急资源队伍分布
  57. * @param sql
  58. * @param dept_id
  59. * @return
  60. */
  61. public String getTeamScatter(String sql, String dept_id){
  62. StringBuffer sb = new StringBuffer();
  63. sb.append("[");
  64. rs = executeQuerySetPs(sql, dept_id, dept_id);
  65. try {
  66. while(rs.next()){
  67. sb.append("{\"posX\":\"" + rs.getString("LONGITUDE") + "\",\"posY\":\"" + rs.getString("LATITUDE") +
  68. "\",\"title\":\"队伍名称:" + rs.getString("TEAM_NAME") + "\\n队伍类型:" + rs.getString("TTYPE") +
  69. "\\n队伍人数:" + rs.getString("NUM") +
  70. "\\n队伍状态:" + rs.getString("TSTAT") + "\\n地址:" + rs.getString("TEAM_AEAR") +
  71. "\\n\\n负责人:" + rs.getString("TEAM_LEADER") + "\\n负责人电话:" + rs.getString("TEAM_PHONE") +
  72. "\",\"extraData\":{\"FD_OBJECTID\":\"" + rs.getString("FD_ID") +
  73. "\",\"name\":\"team_prev\",\"DEPT_ID\":\"" + rs.getString("DEPT_ID") +
  74. "\",\"DEPT_NAME\":\"" + rs.getString("DEPT_NAME") + "\"}},") ;
  75. }
  76. sb.deleteCharAt(sb.length() - 1) ;
  77. if(sb.length()==0){ return null ; }
  78. sb.append("]") ;
  79. // log.info("队伍分布坐标查询结果:" + sb.toString());
  80. return sb.toString() ;
  81. } catch (SQLException e) {
  82. log.error("队伍分布坐标查询错误"+e.getMessage());
  83. } finally { closeAll(); }
  84. return null;
  85. }
  86. /**
  87. * 获得仓库图标信息
  88. * @param sql
  89. * @return
  90. */
  91. public String getMareHouse(String sql){
  92. log.info("==========应急仓库图标查询SQL:" + sql) ;
  93. StringBuffer sb = new StringBuffer() ;
  94. sb.append("[") ;
  95. try{
  96. rs = executeQuery(sql) ;
  97. while(rs.next()){
  98. /*sb.append("{\"posX\":" + tempXY(rs.getString("LON")) + ",\"posY\":" + tempXY(rs.getString("LAT")) +
  99. ",\"title\":\"名称:" + rs.getString("NAME") +
  100. "\",\"extraData\":{\"FD_OBJECTID\":\"" + rs.getString("CODE") +
  101. "\",\"name\":\"erso_house\"}},") ;*/
  102. sb.append("{\"posX\":" + tempXY(rs.getString("LON")) + ",\"posY\":" + tempXY(rs.getString("LAT")) +
  103. ",\"title\":\"名称:" + rs.getString("NAME") +
  104. "\\n所属单位:" + (rs.getString("DEPT_NAME")==null ? "":rs.getString("DEPT_NAME")) +
  105. "\\n仓库归属:" + rs.getString("HB") +
  106. "\\n仓库类别:" + rs.getString("HT") +
  107. "\\n仓库级别:" + (rs.getString("HL")==null ? "":rs.getString("HL")) +
  108. "\\n存储物资类别:" + getStorageMaterialType(rs.getString("GT")) +
  109. "\\n详细地址:" + rs.getString("ADDR") +
  110. "\\n责任人:" + (rs.getString("MAN")==null ? "":rs.getString("MAN")) +
  111. "\",\"extraData\":{\"FD_OBJECTID\":\"" + rs.getString("CODE") +
  112. "\",\"name\":\"" + rs.getString("ICON") + "\"}},") ;
  113. }
  114. sb.deleteCharAt(sb.length() - 1) ;
  115. if(sb.length()==0){ return null ; }
  116. sb.append("]") ;
  117. log.info("应急仓库图标:" + sb.toString()) ;
  118. return sb.toString() ;
  119. }catch(Exception e){e.printStackTrace();}
  120. finally{
  121. closeAll() ;
  122. }
  123. return null ;
  124. }
  125. /**
  126. * 转换坐标度数
  127. * @param pos
  128. * @return
  129. */
  130. public double tempXY(String pos){
  131. // 22°44′52.15"″
  132. // 23°9′25.42"″
  133. // System.out.println(pos);
  134. double res = 0;
  135. try{
  136. pos = pos.substring(0,pos.length()-1);
  137. String du = pos.split("°")[0];
  138. pos = pos.split("°")[1];
  139. String feng = pos.split("′")[0];
  140. pos = pos.split("′")[1];
  141. String miao = pos.split("\"")[0];
  142. res += Double.parseDouble(du);
  143. res += Double.parseDouble(feng)/60.0;
  144. res += Double.parseDouble(miao)/3600.0;
  145. }catch(NumberFormatException e){
  146. res = 0;
  147. }catch(StringIndexOutOfBoundsException e){
  148. res = 0;
  149. }
  150. return res;
  151. };
  152. /**
  153. * 切割仓库物资类型
  154. * @param gtStr
  155. * @return
  156. */
  157. public String getStorageMaterialType(String gtStr){
  158. StringBuffer gtRes = new StringBuffer() ;
  159. String[] gtArr = gtStr.split("|");//物资类别
  160. for(String key : gtArr){
  161. if(key.equals("1"))
  162. gtRes.append("主网变电类/");
  163. if(key.equals("2"))
  164. gtRes.append("配网变电类/");
  165. if(key.equals("3"))
  166. gtRes.append("主网线路类/");
  167. if(key.equals("4"))
  168. gtRes.append("配网线路类/");
  169. if(key.equals("5"))
  170. gtRes.append("表计与计量类/");
  171. if(key.equals("6"))
  172. gtRes.append("其他/");
  173. }
  174. if(gtRes.length()>0){
  175. gtRes.deleteCharAt(gtRes.length()-1);
  176. return gtRes.toString();
  177. }
  178. return "";
  179. };
  180. public String getMareHouseById(String sql, String fd_id){
  181. StringBuffer sb = new StringBuffer();
  182. rs = executeQuerySetPs(sql, fd_id);
  183. try{
  184. if(rs.next()){
  185. /*
  186. WAREHOUSE_CODE
  187. WAREHOUSE_NAME
  188. WAREHOUSE_BELONGING
  189. BELONGING_DEPARTMENT
  190. WAREHOUSE_TYPE
  191. WAREHOUSE_LEVEL
  192. AREA_COVERED
  193. ARCHITEC_AREA
  194. LATITUDE
  195. LONGITUDE
  196. DETAILED_ADDRESS
  197. STORAGE_MATERIAL_TYPE
  198. STORAGE_MATERIAL_TYPE_SHOW
  199. WAREHOUSE_DESC
  200. SUPERIOR_WAREHOUSE
  201. WAREHOUSE_PRINCIPAL
  202. WAREHOUSE_SYS_CODE
  203. OBJECT_ID
  204. UP_DATE
  205. WAREHOUSE_BELONGING_SHOW
  206. WAREHOUSE_TYPE_SHOW
  207. WAREHOUSE_LEVEL_SHOW*/
  208. sb.append("{\"WAREHOUSE_CODE\":\"" + rs.getString("WAREHOUSE_CODE") + "\"," +
  209. "\"WAREHOUSE_NAME\":\"" + rs.getString("WAREHOUSE_NAME") + "\"," +
  210. "\"WAREHOUSE_BELONGING\":\"" + rs.getString("WAREHOUSE_BELONGING") + "\"," +
  211. "\"BELONGING_DEPARTMENT\":\"" + rs.getString("BELONGING_DEPARTMENT") + "\"," +
  212. "\"WAREHOUSE_TYPE\":\"" + rs.getString("WAREHOUSE_TYPE") + "\"," +
  213. "\"WAREHOUSE_LEVEL\":\"" + rs.getString("WAREHOUSE_LEVEL") + "\"," +
  214. "\"AREA_COVERED\":\"" + rs.getString("AREA_COVERED") + "\"," +
  215. "\"ARCHITEC_AREA\":\"" + rs.getString("ARCHITEC_AREA") + "\"," +
  216. "\"LATITUDE\":\"" + rs.getString("LATITUDE").replaceAll("\"", "") + "\"," +
  217. "\"LONGITUDE\":\"" + rs.getString("LONGITUDE").replaceAll("\"", "") + "\"," +
  218. "\"DETAILED_ADDRESS\":\"" + rs.getString("DETAILED_ADDRESS") + "\"," +
  219. "\"STORAGE_MATERIAL_TYPE\":\"" + rs.getString("STORAGE_MATERIAL_TYPE") + "\"," +
  220. "\"STORAGE_MATERIAL_TYPE_SHOW\":\"" + getStorageMaterialType(rs.getString("STORAGE_MATERIAL_TYPE")) +
  221. "\",\"WAREHOUSE_DESC\":\"" + rs.getString("WAREHOUSE_DESC") + "\"," +
  222. "\"SUPERIOR_WAREHOUSE\":\"" + rs.getString("SUPERIOR_WAREHOUSE") + "\"," +
  223. "\"WAREHOUSE_PRINCIPAL\":\"" + rs.getString("WAREHOUSE_PRINCIPAL") + "\"," +
  224. "\"WAREHOUSE_SYS_CODE\":\"" + rs.getString("WAREHOUSE_SYS_CODE") + "\"," +
  225. "\"OBJECT_ID\":\"" + rs.getString("OBJECT_ID") + "\"," +
  226. "\"UP_DATE\":\"" + rs.getString("UP_DATE") + "\"," +
  227. "\"WAREHOUSE_BELONGING_SHOW\":\"" + rs.getString("WAREHOUSE_BELONGING_SHOW") + "\"," +
  228. "\"WAREHOUSE_TYPE_SHOW\":\"" + rs.getString("WAREHOUSE_TYPE_SHOW") + "\"," +
  229. "\"WAREHOUSE_LEVEL_SHOW\":\"" + rs.getString("WAREHOUSE_LEVEL_SHOW") + "\"}" );
  230. log.info("GIS仓库基本信息查询结果(getMareHouseById)==" + sb.toString());
  231. return sb.toString();
  232. }
  233. }catch(SQLException e){ log.error("GIS仓库通过ID获得详细信息错误:" + sql); }
  234. finally{ closeAll(); }
  235. return null;
  236. }
  237. /**
  238. * 本地可调用资源
  239. * @param sql
  240. * @return
  241. */
  242. public Map<String,String> queryNativeGene(String sql){
  243. Map<String, String> nativeRes = new HashMap<String, String>() ;
  244. try{
  245. rs = executeQuery(sql) ;
  246. while(rs.next()){
  247. nativeRes.put(rs.getString("comp_id"), rs.getString("sum")) ;
  248. }
  249. return nativeRes ;
  250. }
  251. catch(Exception e){e.printStackTrace();}
  252. finally{ closeAll(); }
  253. return null ;
  254. }
  255. /**
  256. * 查询用户自定义图形信息,按类型分别查询(图形类)
  257. * @param sql
  258. * @param inicId
  259. * @param type
  260. * @return
  261. */
  262. public String queryDrawByUser(String sql, String inicId, String type, String userId){
  263. StringBuffer sb = new StringBuffer() ;
  264. StringBuffer other = new StringBuffer() ;
  265. sb.append("[{\"points\":[") ;
  266. try{
  267. rs = executeQuerySetPs(sql,inicId,type,userId) ;
  268. if(rs.next()){
  269. sb.append("{\"x\":" + rs.getString("LONGITUDE") + ",\"y\":" + rs.getString("LATITUDE") + "}") ;
  270. if(rs.getString("RADIUS")==null){
  271. other.append("\"radius\":\"" + rs.getString("RADIUS") + "\",\"describeinfo\":\"" +
  272. rs.getString("DESCRIBEINFO") + "\",\"teamid\":\"" + rs.getString("TEAMID") +
  273. "\",\"drawId\":\"" + rs.getString("fd_id") + "\"},") ;
  274. }else{
  275. other.append("\"radius\":" + rs.getString("RADIUS") + ",\"describeinfo\":\"" +
  276. rs.getString("DESCRIBEINFO") + "\",\"teamid\":\"" + rs.getString("TEAMID") +
  277. "\",\"drawId\":\"" + rs.getString("fd_id") + "\"},") ;
  278. }
  279. }
  280. while(rs.next()){
  281. if(rs.getInt("NUM")==1){
  282. sb.append("]," + other + "{\"points\":[") ;
  283. sb.append("{\"x\":" + rs.getString("LONGITUDE") + ",\"y\":" + rs.getString("LATITUDE") + "}") ;
  284. other.delete(0, other.length()) ;
  285. other.append("\"radius\":\"" + rs.getString("RADIUS") + "\",\"describeinfo\":\"" +
  286. rs.getString("DESCRIBEINFO") + "\",\"teamid\":\"" + rs.getString("TEAMID") +
  287. "\",\"drawId\":\"" + rs.getString("fd_id") + "\"},") ;
  288. }else{
  289. sb.append(",{\"x\":" + rs.getString("LONGITUDE") + ",\"y\":" + rs.getString("LATITUDE") + "}") ;
  290. }
  291. }
  292. sb.append("]," + other) ;
  293. sb.deleteCharAt(sb.length()-1) ;
  294. sb.append("]") ;
  295. System.out.println("用户自定义图形查询(形状类): " + sb.toString());
  296. return sb.toString() ;
  297. }
  298. catch(Exception e){ e.printStackTrace(); }
  299. finally{ closeAll(); }
  300. return "" ;
  301. }
  302. /**
  303. * 查询用户自定义图形信息,按类型分别查询(图标类)
  304. * @param sql
  305. * @param inicId
  306. * @param type
  307. * @return
  308. */
  309. public String queryDrawByUserMarker(String sql, String inicId, String type, String userId){
  310. StringBuffer sb = new StringBuffer() ;
  311. sb.append("[") ;
  312. try{
  313. rs = executeQuerySetPs(sql, inicId, type, userId) ;
  314. while(rs.next()){
  315. sb.append("{\"posX\":" + rs.getString("LONGITUDE") + ",\"posY\":" + rs.getString("LATITUDE") +
  316. ",\"title\":\"" + rs.getString("DESCRIBEINFO") +"\",\"extraData\":{\"FD_ID\":\"" +
  317. rs.getString("TEAMID") + "\",\"inciId\":\"" + rs.getString("fd_id") +
  318. "\",\"name\":\"" + rs.getString("name") + "\"}},") ;
  319. }
  320. sb.deleteCharAt(sb.length()-1) ;
  321. if(sb.length()==0){ return null ; }
  322. sb.append("]") ;
  323. System.out.println("用户自定义图形查询(图标类): " + sb.toString());
  324. return sb.toString() ;
  325. }
  326. catch(Exception e){ e.printStackTrace(); }
  327. finally{ closeAll(); }
  328. return null ;
  329. }
  330. //存储用户自定义图形信息
  331. public String createDrawByUser(String inicId,String info){
  332. String sql = "insert into ECM_CM_DRAWINFOBYUSER values(?, ?, ?, ?, ?)" ;
  333. return this.executeAdd(sql, inicId,info,'0',new Date()) ;
  334. }
  335. //导入用户自定义图层信息
  336. public String importDrawByUser(String sql){
  337. try{
  338. rs = executeQuery(sql) ;
  339. if(rs.next())
  340. return rs.getString("drawinfo") ;
  341. } catch(Exception e){ e.printStackTrace(); }
  342. finally{ closeAll(); }
  343. return null ;
  344. }
  345. /**
  346. * 根据传入的List进行批量保存应急资源参数信息表,对应ECM_CM_SAVETYPE
  347. * @param list
  348. * @return
  349. * @throws Exception
  350. */
  351. public String createDrawType(List<SaveType> list)throws Exception{
  352. String sql = "insert into ECM_CM_SAVETYPE values(?, ?, ?, ?, ?, ?)" ;
  353. String fd_ids = this.executeAddBatch(sql, list) ;
  354. closeAll() ;
  355. return fd_ids ;
  356. }
  357. /**
  358. * 根据传入的List进行批量保存应急资源自定义图形坐标信息表,对应ECM_CM_SAVETYPE
  359. * @param list
  360. * @return
  361. * @throws Exception
  362. */
  363. public String createProgream(List<Progream> list)throws Exception{
  364. String sql = "insert into ECM_CM_PROGREAMSAVE values(?, ?, ?, ?, ?, ?, ?, ?,?,?)" ;
  365. String fd_ids = this.executeAddBatch(sql, list) ;
  366. closeAll() ;
  367. return fd_ids ;
  368. }
  369. /**
  370. * 根据传入的List进行批量逻辑删除用户自定义图形参数表
  371. * @param list
  372. * @return
  373. */
  374. public Boolean delUserDefinedToType(List<String> list) {
  375. String sql = "update ECM_CM_SAVETYPE set is_del = '1' where fd_objectid = ? " ;
  376. Boolean flg = this.executeDelBatchToOneFiled(sql, list) ;
  377. closeAll() ;
  378. return flg ;
  379. }
  380. /**
  381. * 根据传入的List进行批量逻辑删除用户自定义图形坐标表
  382. * @param list
  383. * @return
  384. */
  385. public Boolean delUserDefinedToProgreamsave(List<String> list) {
  386. String sql = "update ECM_CM_PROGREAMSAVE set is_del = '1' where figureid = ? " ;
  387. Boolean flg = this.executeDelBatchToOneFiled(sql, list) ;
  388. closeAll() ;
  389. return flg ;
  390. }
  391. /**
  392. * 查询是否有结果
  393. * @param sql
  394. * @return Boolean true: 有 false:无
  395. */
  396. public Boolean isProvInteDept(String sql){
  397. return this.resultIsNull(sql) ;
  398. }
  399. /**
  400. * 查询部门的直属子部门
  401. * @param sql
  402. * @return
  403. */
  404. public List<String> subDeptIDs(String sql){
  405. List<String> deptList = new ArrayList<String>() ;
  406. try{
  407. rs = this.executeQuery(sql) ;
  408. while(rs.next()){
  409. deptList.add(rs.getString("DEPT_ID")) ;
  410. }
  411. return deptList ;
  412. }catch(Exception e){ e.printStackTrace(); }
  413. finally{ closeAll(); }
  414. return null ;
  415. }
  416. //添加事件信息
  417. public String addIncident(String sql,String data){
  418. try{
  419. String fd_id = this.executeAdd(sql, data) ;
  420. return fd_id.equals(null) ? null : fd_id ;
  421. }catch(Exception e){ log.error("GIS添加事件错误"+e.getMessage()); }
  422. finally{ closeAll(); }
  423. return null ;
  424. }
  425. //根据事件查询出该事件的自定义图形有哪些
  426. public Map<String,String> getDrawsSql(String sql){
  427. Map<String,String> draws = new HashMap<String,String>() ;
  428. try{
  429. rs = this.executeQuery(sql) ;
  430. while(rs.next()){
  431. draws.put(rs.getString("fd_objectid"), rs.getString("drowtype")) ;
  432. }
  433. return draws ;
  434. }catch(Exception e){ log.error("GIS查询图形错误"+e.getMessage()); }
  435. finally{ closeAll(); }
  436. return null ;
  437. }
  438. //根据图形名称查询出该图形
  439. public StringBuffer getDrawXY(String sql){
  440. StringBuffer sb = new StringBuffer() ;
  441. sb.append("{\"points\":[") ;
  442. try{
  443. rs = this.executeQuery(sql) ;
  444. while(rs.next()){
  445. sb.append("{\"x\":" + rs.getString("longitude") + ",\"y\":" + rs.getString("latitude") + "},") ;
  446. }
  447. sb.deleteCharAt(sb.length()-1) ;
  448. if(sb.length()<15){ return null ; }
  449. sb.append("]}") ;
  450. return sb ;
  451. }catch(Exception e){ log.error("GIS查询图形错误"+e.getMessage()); }
  452. finally{ closeAll(); }
  453. return null ;
  454. }
  455. //根据图形的FIGUREID(每个图形的ID)得到图形坐标
  456. public Map<String,String> getDrawPoints(String sql){
  457. Map<String,String> draws = new HashMap<String,String>() ;
  458. StringBuffer sb = new StringBuffer() ;
  459. String fid = "" ;
  460. try{
  461. rs = this.executeQuery(sql) ;
  462. if(rs.next()){
  463. fid = rs.getString("FIGUREID") ;
  464. sb.append("{\"points\":[") ;
  465. sb.append("{\"x\":" + rs.getString("longitude") + ",\"y\":" + rs.getString("latitude") + "},") ;
  466. }
  467. while(rs.next()){
  468. if(fid.equals(rs.getString("FIGUREID"))){
  469. sb.append("{\"x\":" + rs.getString("longitude") + ",\"y\":" + rs.getString("latitude") + "},") ;
  470. } else {
  471. sb.deleteCharAt(sb.length()-1) ;
  472. sb.append("]}") ;
  473. draws.put(fid, sb.toString()) ;
  474. sb.delete(0, sb.length()) ;
  475. fid = rs.getString("FIGUREID") ;
  476. sb.append("{\"points\":[") ;
  477. sb.append("{\"x\":" + rs.getString("longitude") + ",\"y\":" + rs.getString("latitude") + "},") ;
  478. }
  479. }
  480. sb.deleteCharAt(sb.length()-1) ;
  481. sb.append("]}") ;
  482. draws.put(fid, sb.toString()) ;
  483. return draws ;
  484. }catch(Exception e){ log.error("GIS查询自定义图形错误"+e.getMessage()); }
  485. finally{ closeAll(); }
  486. return null ;
  487. }
  488. //根据传入的List进行批量保存事件表
  489. public String createDraw(List<Yjzyincident> list)throws Exception{
  490. String sql = "insert into ECM_CM_YJZYINCIDENT values(?, ?, ?, ?)" ;
  491. String fd_ids = this.executeAddBatch(sql, list) ;
  492. closeAll() ;
  493. return fd_ids ;
  494. }
  495. //查询事件名称是否存在
  496. public String existIncidentName(String condition){
  497. String sql = "select count(*) as num from ECM_CM_YJZYINCIDENT where INCIDENTNAME = '" + condition + "'" ;
  498. try{
  499. rs = this.executeQuery(sql) ;
  500. rs.next() ;
  501. return rs.getInt("num") > 0 ? "1" : "0" ;
  502. }catch(Exception e){ log.error("GIS查询事件错误"+e.getMessage()); }
  503. finally{ closeAll(); }
  504. return "1" ;
  505. }
  506. //根据城市查询坐标
  507. public Map<String, String> queryXYM(String sql){
  508. Map<String, String> xy = new HashMap<String, String>() ;
  509. try{
  510. rs = this.executeQuery(sql) ;
  511. while(rs.next()){
  512. xy.put(rs.getString("DEPT_ID"), "\"x\":" + rs.getString("POS_X") + ",\"y\":" + rs.getString("POS_Y")) ;
  513. }
  514. return xy ;
  515. }catch(Exception e){ log.error("GIS查询城市坐标错误"+e.getMessage()); }
  516. finally{ closeAll(); }
  517. return null ;
  518. }
  519. //根据城市查询坐标返回字符串
  520. public String queryXY(String sql){
  521. StringBuffer sb = new StringBuffer() ;
  522. sb.append("[") ;
  523. try{
  524. rs = this.executeQuery(sql) ;
  525. while(rs.next()){
  526. sb.append("{\"x\":" + rs.getString("pos_x") + ",\"y\":" + rs.getString("pos_y") + "},") ;
  527. }
  528. sb.deleteCharAt(sb.length() - 1) ;
  529. if(sb.length()==0){ return null ; }
  530. sb.append("]") ;
  531. return sb.toString() ;
  532. }catch(Exception e){ log.error("GIS查询城市坐标错误"+e.getMessage()); }
  533. finally{ closeAll(); }
  534. return null ;
  535. }
  536. /**
  537. * 根据事件ID或队伍ID查询出应急队伍最新的位置,用于展示图标
  538. * @param sql
  539. * @return
  540. */
  541. public String queryYjTameMarker(String sql){
  542. log.info("根据事件ID或队伍ID查询出应急队伍最新的位置,用于展示图标SQL:"+sql);
  543. StringBuffer sb = new StringBuffer() ;
  544. rs = this.executeQuery(sql) ;
  545. sb.append("[") ;
  546. try{
  547. while(rs.next()){
  548. sb.append("{\"posX\":" + rs.getString("longitude") + ",\"posY\":" + rs.getString("latitude") +
  549. ",\"title\":\"" + rs.getString("incidentname") + "事件应急队:" +
  550. rs.getString("team_name") + "\",\"extraData\":{\"teamid\":\"" +
  551. rs.getString("team_id") + "\",\"inciid\":\"" + rs.getString("inicid") +
  552. "\",\"name\":\"team_prev\"}},") ;
  553. }
  554. sb.deleteCharAt(sb.length()-1) ;
  555. if(sb.length()==0){ return null ; }
  556. sb.append("]") ;
  557. // System.out.println("应急队伍定位result: " + sb.toString());
  558. return sb.toString() ;
  559. } catch (Exception e){ log.error("GIS查询队伍定位错误"+e.getMessage()); }
  560. finally { closeAll(); }
  561. return null ;
  562. }
  563. /**
  564. * 根据事件ID或队伍ID查询出应急队伍最新的位置,用于展示图标
  565. * @param sql
  566. * @return
  567. */
  568. public String queryTameMarker(String sql){
  569. log.info("根据事件ID或队伍ID查询出应急队伍最新的位置,用于展示图标SQL:"+sql);
  570. StringBuffer sb = new StringBuffer() ;
  571. rs = this.executeQuery(sql) ;
  572. sb.append("[") ;
  573. try{
  574. while(rs.next()){
  575. sb.append("{\"posX\":" + rs.getString("LON") + ",\"posY\":" + rs.getString("LAT") +
  576. ",\"title\":\"队伍名称:" + rs.getString("NAME") + "\\n调拨名称:" +
  577. rs.getString("TNAME") + "\\n队伍人数:" +
  578. rs.getString("MENNUM") + "人\\n专业:" + (String)cutil.getResoultByDefault(rs.getString("MAJOR"), "暂无") +
  579. "\\n起始地点:" + rs.getString("STATRPLACE") + "\\n终点:" + rs.getString("DEST") +
  580. "\",\"extraData\":{\"teamid\":\"" +
  581. rs.getString("FD_ID") + "\",\"inciid\":\"" + rs.getString("INICID") +
  582. "\",\"name\":\"team_prev\"}},") ;
  583. }
  584. sb.deleteCharAt(sb.length()-1) ;
  585. if(sb.length()==0){ return null ; }
  586. sb.append("]") ;
  587. log.info("GIS查询队伍定位结果:" + sb.toString());
  588. // System.out.println("应急队伍定位result: " + sb.toString());
  589. return sb.toString() ;
  590. } catch (Exception e){ log.error("GIS查询队伍定位错误:" + sql); }
  591. finally { closeAll(); }
  592. return null ;
  593. }
  594. //根据队伍查询坐标描述用
  595. public String queryTameXY(String sql){
  596. StringBuffer sb = new StringBuffer() ;
  597. StringBuffer tempX = new StringBuffer() ;
  598. StringBuffer tempY = new StringBuffer() ;
  599. sb.append("[") ;
  600. rs = this.executeQuery(sql) ;
  601. try{
  602. if(rs.next()){
  603. sb.append("{\"x\":" + rs.getString("longitude") + ",\"y\":" + rs.getString("latitude") +
  604. ",\"afterX\":" + rs.getString("longitude") + ",\"afterY\":" +
  605. rs.getString("latitude") + "},") ;
  606. tempX.append(rs.getString("longitude")) ;
  607. tempY.append(rs.getString("latitude")) ;
  608. }
  609. while(rs.next()){
  610. sb.append("{\"x\":" + rs.getString("longitude") + ",\"y\":" + rs.getString("latitude") +
  611. ",\"afterX\":" + tempX + ",\"afterY\":" + tempY + "},") ;
  612. tempX.delete(0, tempX.length()) ;
  613. tempY.delete(0, tempY.length()) ;
  614. tempX.append(rs.getString("longitude")) ;
  615. tempY.append(rs.getString("latitude")) ;
  616. }
  617. sb.deleteCharAt(sb.length()-1) ;
  618. if(sb.length()==0){ return null ; }
  619. sb.append("]") ;
  620. // System.out.println("根据队伍查询坐标: " + sb.toString()) ;
  621. return sb.toString() ;
  622. }
  623. catch(Exception e) { log.error("GIS查询队伍坐标错误"+e.getMessage()); }
  624. finally { closeAll(); }
  625. return null ;
  626. }
  627. //根据队伍查询坐标描述用
  628. public String queryTameLine(String sql){
  629. StringBuffer sb = new StringBuffer() ;
  630. StringBuffer tempX = new StringBuffer() ;
  631. StringBuffer tempY = new StringBuffer() ;
  632. String key = "" ;
  633. sb.append("[") ;
  634. rs = this.executeQuery(sql) ;
  635. try{
  636. if(rs.next()){
  637. sb.append("{\"teamId\":\"" + rs.getString("team_id") + "\",\"teamName\":\"" + rs.getString("team_name") +
  638. "\",\"inciName\":\"" + rs.getString("incidentname") + "\",\"points\":[{\"x\":" +
  639. rs.getString("longitude") + ",\"y\":" + rs.getString("latitude") + ",\"afterX\":" +
  640. rs.getString("longitude") + ",\"afterY\":" + rs.getString("latitude") +
  641. ",\"uploadTime\":\"" + rs.getString("team_time") + "\"},") ;
  642. tempX.append(rs.getString("longitude")) ;
  643. tempY.append(rs.getString("latitude")) ;
  644. key = rs.getString("team_id") ;
  645. }
  646. while(rs.next()){
  647. if(key.equals(rs.getString("team_id"))){
  648. if(!ctDao.equalsXY(tempX.toString(), rs.getString("longitude"),tempY.toString(), rs.getString("latitude"))){
  649. sb.append("{\"x\":" + rs.getString("longitude") + ",\"y\":" + rs.getString("latitude") +
  650. ",\"afterX\":" + tempX + ",\"afterY\":" + tempY +
  651. ",\"uploadTime\":\"" + rs.getString("team_time") + "\"},") ;
  652. tempX.delete(0, tempX.length()) ;
  653. tempY.delete(0, tempY.length()) ;
  654. tempX.append(rs.getString("longitude")) ;
  655. tempY.append(rs.getString("latitude")) ;
  656. }
  657. } else {
  658. sb.deleteCharAt(sb.length()-1) ;
  659. sb.append("]},{\"teamId\":\"" + rs.getString("team_id") + "\",\"teamName\":\"" + rs.getString("team_name") +
  660. "\",\"inciName\":\"" + rs.getString("incidentname") + "\",\"points\":[{\"x\":" + rs.getString("longitude") +
  661. ",\"y\":" + rs.getString("latitude") + ",\"afterX\":" + rs.getString("longitude") +
  662. ",\"afterY\":" + rs.getString("latitude") + ",\"uploadTime\":" + rs.getString("team_time") + "\"},") ;
  663. key = rs.getString("teamid") ;
  664. tempX.delete(0, tempX.length()) ;
  665. tempY.delete(0, tempY.length()) ;
  666. tempX.append(rs.getString("longitude")) ;
  667. tempY.append(rs.getString("latitude")) ;
  668. }
  669. }
  670. sb.deleteCharAt(sb.length()-1) ;
  671. if(sb.length()==0){ return null ; }
  672. sb.append("]}]") ;
  673. // System.out.println("轨迹描绘:" + sb.toString()) ;
  674. return sb.toString() ;
  675. }
  676. catch(Exception e) { log.error("GIS查询队伍轨迹错误"+e.getMessage()); }
  677. finally { closeAll(); }
  678. return null ;
  679. // StringBuffer sb = new StringBuffer() ;
  680. // StringBuffer tempX = new StringBuffer() ;
  681. // StringBuffer tempY = new StringBuffer() ;
  682. //
  683. // sb.append("[") ;
  684. // rs = this.executeQuery(sql) ;
  685. // try{
  686. // if(rs.next()){
  687. // sb.append("{\"x\":" + rs.getString("longitude") + ",\"y\":" + rs.getString("latitude") +
  688. // ",\"afterX\":" + rs.getString("longitude") + ",\"afterY\":" +
  689. // rs.getString("latitude") + "},") ;
  690. // tempX.append(rs.getString("longitude")) ;
  691. // tempY.append(rs.getString("latitude")) ;
  692. //
  693. // }
  694. // while(rs.next()){
  695. // sb.append("{\"x\":" + rs.getString("longitude") + ",\"y\":" + rs.getString("latitude") +
  696. // ",\"afterX\":" + tempX + ",\"afterY\":" + tempY + "},") ;
  697. // tempX.delete(0, tempX.length()) ;
  698. // tempY.delete(0, tempY.length()) ;
  699. // tempX.append(rs.getString("longitude")) ;
  700. // tempY.append(rs.getString("latitude")) ;
  701. // }
  702. //
  703. // sb.deleteCharAt(sb.length()-1) ;
  704. // sb.append("]") ;
  705. // System.out.println(sb.toString()) ;
  706. // return sb.toString() ;
  707. // }
  708. // catch(Exception e) { e.printStackTrace(); }
  709. // finally { closeAll(); }
  710. // return null ;
  711. }
  712. //根据队伍查询坐标描述用
  713. public String queryTameLineById(String sql){
  714. StringBuffer sb = new StringBuffer() ;
  715. StringBuffer tempX = new StringBuffer() ;
  716. StringBuffer tempY = new StringBuffer() ;
  717. String key = "" ;
  718. sb.append("[") ;
  719. rs = this.executeQuery(sql) ;
  720. try{
  721. if(rs.next()){
  722. sb.append("{\"teamId\":\"" + rs.getString("FD_ID") + "\",\"teamName\":\"" + rs.getString("NAME") +
  723. "\",\"inciName\":\"" + rs.getString("TNAME") + "\",\"points\":[{\"x\":" +
  724. rs.getString("LON") + ",\"y\":" + rs.getString("LAT") + ",\"afterX\":" +
  725. rs.getString("LON") + ",\"afterY\":" + rs.getString("LAT") +
  726. ",\"uploadTime\":\"" + rs.getDate("LOCATION_TIME") + " " +
  727. rs.getTime("LOCATION_TIME") + "\"},") ;
  728. tempX.append(rs.getString("LON")) ;
  729. tempY.append(rs.getString("LAT")) ;
  730. key = rs.getString("FD_ID") ;
  731. }
  732. while(rs.next()){
  733. if(key.equals(rs.getString("FD_ID"))){
  734. if(!ctDao.equalsXY(tempX.toString(), rs.getString("LON"),tempY.toString(), rs.getString("LAT"))){
  735. sb.append("{\"x\":" + rs.getString("LON") + ",\"y\":" + rs.getString("LAT") +
  736. ",\"afterX\":" + tempX + ",\"afterY\":" + tempY +
  737. ",\"uploadTime\":\"" + rs.getDate("LOCATION_TIME") + " " +
  738. rs.getTime("LOCATION_TIME") + "\"},") ;
  739. tempX.delete(0, tempX.length()) ;
  740. tempY.delete(0, tempY.length()) ;
  741. tempX.append(rs.getString("LON")) ;
  742. tempY.append(rs.getString("LAT")) ;
  743. }
  744. } else {
  745. sb.deleteCharAt(sb.length()-1) ;
  746. sb.append("]},{\"teamId\":\"" + rs.getString("FD_ID") + "\",\"teamName\":\"" + rs.getString("NAME") +
  747. "\",\"inciName\":\"" + rs.getString("TNAME") + "\",\"points\":[{\"x\":" + rs.getString("LON") +
  748. ",\"y\":" + rs.getString("LAT") + ",\"afterX\":" + rs.getString("LON") +
  749. ",\"afterY\":" + rs.getString("LAT") + ",\"uploadTime\":\"" + rs.getDate("LOCATION_TIME") +
  750. " " + rs.getTime("LOCATION_TIME") + "\"},") ;
  751. key = rs.getString("FD_ID") ;
  752. tempX.delete(0, tempX.length()) ;
  753. tempY.delete(0, tempY.length()) ;
  754. tempX.append(rs.getString("LON")) ;
  755. tempY.append(rs.getString("LAT")) ;
  756. }
  757. }
  758. sb.deleteCharAt(sb.length()-1) ;
  759. if(sb.length()==0){ return null ; }
  760. sb.append("]}]") ;
  761. System.out.println(sb.toString());
  762. return sb.toString() ;
  763. }
  764. catch(Exception e) { log.error("GIS查询队伍轨迹错误"+e.getMessage()); }
  765. finally { closeAll(); }
  766. return null ;
  767. }
  768. public Map<String, Posi> getStartTimeByTeam(String sql){
  769. Map<String, Posi> map = new HashMap<String, Posi>();
  770. rs = this.executeQuery(sql) ;
  771. try{
  772. while(rs.next()){
  773. Posi posi = new Posi();
  774. posi.setStartDate(rs.getTimestamp("LOCATION_TIME"));
  775. map.put(rs.getString("FD_ID"), posi);
  776. }
  777. return map;
  778. } catch(Exception e) { log.error("GIS队伍轨迹开始时间查询错误:"+sql); }
  779. finally { closeAll(); }
  780. return null ;
  781. }
  782. public Map<String, Posi> getEndTimeByTeam(String sql){
  783. Map<String, Posi> map = new HashMap<String, Posi>();
  784. rs = this.executeQuery(sql) ;
  785. try{
  786. while(rs.next()){
  787. Posi posi = new Posi();
  788. posi.setEndDate(rs.getTimestamp("LOCATION_TIME"));
  789. map.put(rs.getString("FD_ID"), posi);
  790. }
  791. return map;
  792. } catch(Exception e) { log.error("GIS队伍轨迹结束时间查询错误:"+sql); }
  793. finally { closeAll(); }
  794. return null ;
  795. }
  796. public List<Posi> getTimeByTeam(Map<String, Posi> smap, Map<String, Posi> emap){
  797. List<Posi> list = new ArrayList<Posi>();
  798. Iterator iter = smap.entrySet().iterator();
  799. while(iter.hasNext()){
  800. Map.Entry<String, Posi> entry = (Map.Entry<String, Posi>)iter.next();
  801. String id = entry.getKey();
  802. Posi posi = entry.getValue();
  803. posi.setFD_ID(id);
  804. if(emap.get(id).getEndDate()==null){
  805. posi.setEndDate(new Date());
  806. }else{
  807. posi.setEndDate(emap.get(id).getEndDate());
  808. }
  809. list.add(posi);
  810. }
  811. return list;
  812. }
  813. /**
  814. * 获得资源调拨图标信息
  815. * @param sql
  816. * @return
  817. */
  818. public String searchErDistByTeam(String sql,String dept_id){
  819. // System.out.println(sql+"----------------------------------------------------"+dept_id);
  820. StringBuffer sb = new StringBuffer() ;
  821. sb.append("[") ;
  822. try{
  823. rs = executeQuerySetPs(sql, dept_id, dept_id) ;
  824. String fd_id = "";
  825. if(rs.next()){
  826. fd_id = rs.getString("FD_ID");
  827. sb.append("{\"posX\":\"" + rs.getString("LONGITUDE") + "\",\"posY\":\"" + rs.getString("LATITUDE") +
  828. "\",\"title\":\"" + rs.getString("NAME") + "\\n共" + rs.getString("CFID") +
  829. "支队伍,总计" + rs.getString("NUM") +
  830. "人\",\"extraData\":{\"FD_OBJECTID\":\"" + rs.getString("FD_ID") +
  831. "\",\"name\":\"team_prev\",\"DEPT_ID\":\"" + rs.getString("DEPT_ID") +
  832. "\",\"DEPT_NAME\":\"" + rs.getString("NAME") + "\"}},") ;
  833. }
  834. while(rs.next()){
  835. if(fd_id.equals(rs.getString("FD_ID"))){
  836. fd_id = rs.getString("FD_ID");
  837. continue;
  838. }
  839. fd_id = rs.getString("FD_ID");
  840. sb.append("{\"posX\":\"" + rs.getString("LONGITUDE") + "\",\"posY\":\"" + rs.getString("LATITUDE") +
  841. "\",\"title\":\"" + rs.getString("NAME") + "\\n共" + rs.getString("CFID") +
  842. "支队伍,总计" + rs.getString("NUM") +
  843. "人\",\"extraData\":{\"FD_OBJECTID\":\"" + rs.getString("FD_ID") +
  844. "\",\"name\":\"team_prev\",\"DEPT_ID\":\"" + rs.getString("DEPT_ID") +
  845. "\",\"DEPT_NAME\":\"" + rs.getString("NAME") + "\"}},") ;
  846. }
  847. sb.deleteCharAt(sb.length() - 1) ;
  848. if(sb.length()==0){ return null ; }
  849. sb.append("]") ;
  850. return sb.toString() ;
  851. }catch(Exception e){log.error("GIS查询应急队伍总计错误"+e.getMessage());}
  852. finally{
  853. closeAll() ;
  854. }
  855. return null ;
  856. }
  857. /**
  858. * 获得资源调拨图标信息
  859. * @param sql
  860. * @return
  861. */
  862. public String searchErDistByEquip(String sql, String deptId){
  863. StringBuffer sb = new StringBuffer() ;
  864. sb.append("[") ;
  865. try{
  866. rs = executeQuerySetPs(sql, deptId,deptId) ;
  867. while(rs.next()){
  868. sb.append("{") ;
  869. sb.append("\"posX\":\"" + (rs.getDouble("LONGITUDE")-0.5) + "\",\"posY\":\"" + rs.getDouble("LATITUDE") +
  870. "\",\"title\":\"单位:" + rs.getString("NAME") + "\\n发电车总计:" + rs.getString("CN") +
  871. "台\\t发电机总计:" + rs.getString("JN") +
  872. "台\",\"extraData\":{\"FD_OBJECTID\":\"" + rs.getString("FD_ID") +
  873. "\",\"name\":\"erso_equip\",\"DEPT_ID\":\"" + rs.getString("DEPT_ID") +
  874. "\",\"DEPT_NAME\":\"" + rs.getString("NAME") + "\"}},") ;
  875. }
  876. sb.deleteCharAt(sb.length() - 1) ;
  877. if(sb.length()==0){ return null ; }
  878. sb.append("]") ;
  879. return sb.toString() ;
  880. }catch(Exception e){e.printStackTrace();}
  881. finally{
  882. closeAll() ;
  883. }
  884. return null ;
  885. }
  886. /**
  887. * 获得资源发电车网省级图标信息
  888. * @param sql
  889. * @return
  890. */
  891. public String searchErByCar(String sql, String deptId, String type){
  892. StringBuffer sb = new StringBuffer() ;
  893. sb.append("[") ;
  894. try{
  895. rs = executeQuerySetPs(sql, deptId,deptId) ;
  896. while(rs.next()){
  897. sb.append("{") ;
  898. sb.append("\"posX\":\"" + rs.getDouble("LONGITUDE") + "\",\"posY\":\"" + rs.getDouble("LATITUDE") +
  899. "\",\"title\":\"单位:" + rs.getString("NAME") + "\\n" + type + "总计:" + rs.getString("NUM") +
  900. "台\",\"extraData\":{\"FD_OBJECTID\":\"" + rs.getString("DEPT_ID") +
  901. "\",\"name\":\"erso_equip\",\"DEPT_ID\":\"" + rs.getString("DEPT_ID") +
  902. "\",\"DEPT_NAME\":\"" + rs.getString("NAME") + "\"}},") ;
  903. }
  904. sb.deleteCharAt(sb.length() - 1) ;
  905. if(sb.length()==0){ return null ; }
  906. sb.append("]") ;
  907. return sb.toString() ;
  908. }catch(Exception e){e.printStackTrace();}
  909. finally{
  910. closeAll() ;
  911. }
  912. return null ;
  913. }
  914. /**
  915. * 获得应急资源临时安置点图标信息
  916. * @param sql
  917. * @return
  918. */
  919. public String searchErPlace(String sql){
  920. log.info("应急资源临时安置点图标信息SQL:"+sql);
  921. StringBuffer sb = new StringBuffer() ;
  922. sb.append("[") ;
  923. try{
  924. rs = executeQuery(sql) ;
  925. while(rs.next()){
  926. sb.append("{") ;
  927. sb.append("\"posX\":\"" + rs.getString("LONGITUDE") + "\",\"posY\":\"" + rs.getString("LATITUDE") +
  928. "\",\"title\":\"名称:" + rs.getString("SETTLEMENTS_NAME") + "\\n地点:" + rs.getString("PLACE") +
  929. "\\n值守人员:" + rs.getString("CONTACT_PERSON") + "\\n联系人电话:" + rs.getString("TELEPHONE") +
  930. "\",\"extraData\":{\"FD_OBJECTID\":\"" + rs.getString("FD_ID") +
  931. "\",\"name\":\"" + rs.getString("ICONNAME") + "\"}},") ;
  932. }
  933. sb.deleteCharAt(sb.length() - 1) ;
  934. if(sb.length()==0){ return null ; }
  935. sb.append("]") ;
  936. log.info("应急资源临时安置点图标信息返回结果:"+sb.toString());
  937. return sb.toString() ;
  938. }catch(Exception e){log.error("GIS查询临时安置点错误"+e.getMessage());}
  939. finally{
  940. closeAll() ;
  941. }
  942. return null ;
  943. }
  944. }