| | |
| | | <version>2.7.5</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-data-jpa</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.squareup.okhttp3</groupId> |
| | | <artifactId>okhttp</artifactId> |
| | | <version>3.14.9</version> |
| | |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-web</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.rockyyu</groupId> |
| | | <artifactId>geotools-jdbc-gbase</artifactId> |
| | | <version>27.2.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-swagger2</artifactId> |
| | | <version>2.9.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-swagger-ui</artifactId> |
| | | <version>2.9.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-swagger-ui</artifactId> |
| | | <version>2.9.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.github.xiaoymin</groupId> |
| | | <artifactId>swagger-bootstrap-ui</artifactId> |
| | | <version>1.9.6</version> |
| | | </dependency> |
| | | <!-- å¼å
¥åæ 转å--> |
| | | <dependency> |
| | | <groupId>org.locationtech.jts</groupId> |
| | | <artifactId>jts-core</artifactId> |
| | | <version>1.16.1</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.locationtech.proj4j</groupId> |
| | | <artifactId>proj4j</artifactId> |
| | | <version>1.1.3</version> |
| | | </dependency> |
| | | <!-- ç®ä½åç¹ä½è½¬å --> |
| | | <dependency> |
| | | <groupId>com.github.houbb</groupId> |
| | | <artifactId>opencc4j</artifactId> |
| | | <version>1.7.2</version> |
| | | </dependency> |
| | | </dependencies> |
| | | <dependencyManagement> |
| | |
| | | <type>pom</type> |
| | | <scope>import</scope> |
| | | </dependency> |
| | | |
| | | |
| | | </dependencies> |
| | | </dependencyManagement> |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yb.controller;
|
| | |
|
| | | import java.lang.reflect.Field;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Arrays;
|
| | | import java.util.HashMap;
|
| | | import java.util.Map;
|
| | |
|
| | | import com.alibaba.fastjson.JSON;
|
| | | import com.yb.dao.THistoryDao;
|
| | | import io.swagger.annotations.ApiOperation;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.web.bind.annotation.*;
|
| | | import com.yb.entity.THistoryEntity;
|
| | | import com.yb.service.THistoryService;
|
| | | import com.yb.config.PageUtils;
|
| | | import com.yb.config.R;
|
| | |
|
| | |
|
| | | /**
|
| | | * ${comments}
|
| | | *
|
| | | * @author yw
|
| | | * @email leutu@qq.com
|
| | | * @date 2024-09-14 16:35:15
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping("/api/thistory")
|
| | | public class THistoryController {
|
| | | @Autowired
|
| | | private THistoryService tHistoryService;
|
| | | @Autowired
|
| | | private THistoryDao tHistoryDao;
|
| | |
|
| | | /**
|
| | | * å表
|
| | | */
|
| | | @GetMapping("/list")
|
| | | @ApiOperation(value = "list", notes = "åæ° ï¼ page,limit")
|
| | | public R list(@RequestParam Map<String, Object> params) {
|
| | | PageUtils page = tHistoryService.queryPage(params);
|
| | |
|
| | | return R.ok().put("page", page);
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * å表
|
| | | */
|
| | | @GetMapping("/query")
|
| | | @ApiOperation(value = "query", notes = "")
|
| | | public R query(@RequestParam Map<String, Object> params) {
|
| | | PageUtils page = tHistoryService.query(params);
|
| | |
|
| | | return R.ok().put("page", page);
|
| | | }
|
| | |
|
| | | /**
|
| | | * å表
|
| | | */
|
| | | @PostMapping("/listAll")
|
| | | @ApiOperation(value = "listAll", notes = "")
|
| | | public R listAll() {
|
| | | PageUtils page = tHistoryService.queryPage(new HashMap<String, Object>());
|
| | |
|
| | | return R.ok().put("page", page);
|
| | | }
|
| | |
|
| | | /**
|
| | | * ä¿¡æ¯
|
| | | */
|
| | | @PostMapping("/info/{id}")
|
| | | @ApiOperation(value = "info", notes = "")
|
| | | public R info(@PathVariable("id") Integer id) {
|
| | | THistoryEntity tHistory = tHistoryService.getById(id);
|
| | |
|
| | | return R.ok().put("tHistory", tHistory);
|
| | | }
|
| | |
|
| | | /**
|
| | | * ä¿å
|
| | | */
|
| | | @PostMapping("/save")
|
| | | @ApiOperation(value = "save", notes = "")
|
| | | public R save(@RequestBody THistoryEntity tHistory) {
|
| | | int id = tHistoryDao.insert(tHistory);
|
| | | // tHistory.getId().toString()
|
| | | HashMap<String,Object> hashMap= new HashMap<>();
|
| | | hashMap.put("id",tHistory.getId().toString());
|
| | | return R.ok(hashMap);
|
| | | }
|
| | |
|
| | | /**
|
| | | * ä¿®æ¹
|
| | | */
|
| | | @PostMapping("/update")
|
| | | @ApiOperation(value = "update", notes = "")
|
| | | public R update(@RequestBody THistoryEntity tHistory) {
|
| | | tHistoryService.updateById(tHistory);
|
| | | return R.ok();
|
| | | }
|
| | |
|
| | | /**
|
| | | * å é¤
|
| | | */
|
| | | @PostMapping("/delete")
|
| | | @ApiOperation(value = "delete", notes = "")
|
| | | public R delete(@RequestBody Integer[] ids) {
|
| | | tHistoryService.removeByIds(Arrays.asList(ids));
|
| | | return R.ok();
|
| | | }
|
| | |
|
| | | /**
|
| | | * ä¿®æ¹
|
| | | */
|
| | | @PostMapping("/getTableMeta")
|
| | | @ApiOperation(value = "getTableMeta", notes = "")
|
| | | public R getTableMeta() {
|
| | | ArrayList<Map<String, String>> list = new ArrayList<Map<String, String>>();
|
| | |
|
| | | Field[] fields = THistoryEntity.class.getDeclaredFields();
|
| | | for (Field field : fields) {
|
| | | Map<String, String> map = new HashMap<>();
|
| | | System.out.println("屿§å:" + field.getName());
|
| | | System.out.println("ç±»å:" + field.getType().getName());
|
| | | map.put("name", field.getName());
|
| | | map.put("type", field.getType().getName());
|
| | | map.put("cname", field.getName());
|
| | | list.add(map);
|
| | | }
|
| | | return R.ok(list);
|
| | | }
|
| | | }
|
| | |
| | | System.out.println("Answer: " + answer1);
|
| | | String jso = JSONObject.parseObject(answer1).getString("answer");
|
| | | String context = JSONObject.parseObject(answer1).getString("context");
|
| | | // JSONArray jsonArray = JSON.parseArray(context);
|
| | | // String metadata = "";
|
| | | // for (int i = 0; i < jsonArray.size(); i++) {
|
| | | // JSONObject jsonObject = jsonArray.getJSONObject(i);
|
| | | //
|
| | | // metadata = jsonObject.getString("metadata");
|
| | | //
|
| | | //
|
| | | // }
|
| | |
|
| | | if (context != "") {
|
| | | // String[] fileSource = metadata.split("/");
|
| | | hashMap.put("fileSrource", JSON.parseArray(context));
|
| | | hashMap.put("fileSrource", JSON.parseArray(context));
|
| | | }
|
| | | hashMap.put("content", jso);
|
| | | hashMap.put("type", "Rag");
|
| | |
| | | formData.put("token", xzConfig.token);
|
| | | formData.put("dbid", xzConfig.dbid);
|
| | | String obj = entityHttpUtil.getPostMessage(xzConfig.permissionLayer, formData);
|
| | | System.out.println("Answer: " + obj);
|
| | | System.out.println("layerList: " + obj);
|
| | | HashMap<String, Object> hashMap = new HashMap<String, Object>();
|
| | | String layers = JSON.parseObject(JSONObject.parseObject(obj).getString("data")).getString("layers");
|
| | | JSONArray dataArray = JSONArray.parseArray(layers);
|
| | |
| | | for (int i = 0; i < dataArray.size(); i++) {
|
| | | JSONObject itmObj = JSONObject.parseObject(dataArray.get(i).toString());
|
| | | String item = itmObj.getString("dataformat");
|
| | | // System.out.println("Answer: " + item);
|
| | |
|
| | | String id = itmObj.getString("id");
|
| | | if (item.equals("entity")) {
|
| | | HashMap<String, Object> itmHash = new HashMap<>();
|
| | | String name = itmObj.getString("name");
|
| | | String url = itmObj.getString("lod_url");
|
| | | if (url != null) {
|
| | | String l1 = JSONObject.parseObject(JSONObject.parseObject(url).getString("3d")).getString("l0");
|
| | | itmHash.put("url", l1);
|
| | | itmHash.put("sourceType", "Tileset");
|
| | | itmHash.put("name", name);
|
| | | itmHash.put("id", id);
|
| | | list.add(itmHash);
|
| | | String url3d = JSONObject.parseObject(url).getString("3d");
|
| | |
|
| | | if (url3d != null) {
|
| | | String l1 = JSONObject.parseObject(url3d).getString("l0");
|
| | | itmHash.put("url", l1);
|
| | | itmHash.put("sourceType", "Tileset");
|
| | | itmHash.put("name", name);
|
| | | itmHash.put("id", id);
|
| | | list.add(itmHash);
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | System.out.println("layerList: " + list);
|
| | | hashMap.put("data", list);
|
| | | return R.ok(hashMap);
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yb.controller.log;
|
| | |
|
| | | import org.slf4j.Logger;
|
| | | import org.slf4j.LoggerFactory;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | |
|
| | | @RestController
|
| | |
|
| | | public class LoggerController {
|
| | | private static final Logger logger = LoggerFactory.getLogger(LoggerController.class);
|
| | |
|
| | | @RequestMapping("/getLogger")
|
| | | public String getLogger() {
|
| | | logger.trace("log trace");
|
| | | logger.debug("log debug");
|
| | | logger.info("log info");
|
| | | logger.warn("log warn");
|
| | | logger.error("log error");
|
| | | return "Agent Log";
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yb.dao;
|
| | |
|
| | | import com.yb.entity.THistoryEntity;
|
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
| | | import org.apache.ibatis.annotations.Mapper;
|
| | | import org.springframework.stereotype.Repository;
|
| | |
|
| | | /**
|
| | | * ${comments}
|
| | | * |
| | | * @author yw
|
| | | * @email leutu@qq.com
|
| | | * @date 2024-09-14 16:35:15
|
| | | */
|
| | | @Mapper
|
| | | public interface THistoryDao extends BaseMapper<THistoryEntity> {
|
| | | |
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yb.entity;
|
| | |
|
| | | import com.baomidou.mybatisplus.annotation.IdType;
|
| | | import com.baomidou.mybatisplus.annotation.TableField;
|
| | | import com.baomidou.mybatisplus.annotation.TableId;
|
| | | import com.baomidou.mybatisplus.annotation.TableName;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.Date;
|
| | |
|
| | | import com.fasterxml.jackson.annotation.JsonFormat;
|
| | | import io.swagger.annotations.ApiModelProperty;
|
| | | import lombok.Data;
|
| | | import org.springframework.format.annotation.DateTimeFormat;
|
| | |
|
| | | /**
|
| | | * ${comments}
|
| | | *
|
| | | * @author yw
|
| | | * @email leutu@qq.com
|
| | | * @date 2024-09-14 16:35:15
|
| | | */
|
| | | @Data
|
| | | @TableName("t_history")
|
| | | public class THistoryEntity implements Serializable {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | /**
|
| | | * $column.comments
|
| | | */
|
| | | @TableId(value = "id", type = IdType.AUTO)
|
| | | private Integer id;
|
| | | /**
|
| | | * $column.comments
|
| | | */
|
| | |
|
| | |
|
| | | private String sessionid;
|
| | | /**
|
| | | * $column.comments
|
| | | */
|
| | |
|
| | |
|
| | | private String human;
|
| | | /**
|
| | | * $column.comments
|
| | | */
|
| | |
|
| | |
|
| | | private String ai;
|
| | | /**
|
| | | * $column.comments
|
| | | */
|
| | |
|
| | | @ApiModelProperty(value = "å建æ¶é´")
|
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
| | | private Date create_time;
|
| | | /**
|
| | | * $column.comments
|
| | | */
|
| | |
|
| | | @ApiModelProperty(value = "ä¿®æ¹æ¶é´")
|
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
| | | private Date update_time;
|
| | | /**
|
| | | * $column.comments
|
| | | */
|
| | |
|
| | |
|
| | | private Integer userid;
|
| | |
|
| | |
|
| | | }
|
| | |
| | | import com.alibaba.fastjson.JSON;
|
| | | import com.alibaba.fastjson.JSONArray;
|
| | | import com.alibaba.fastjson.JSONObject;
|
| | | import com.github.houbb.opencc4j.core.impl.ZhConvertBootstrap;
|
| | | import com.yb.config.XzConfig;
|
| | | import com.yb.helper.RsaHelper;
|
| | | import com.yb.util.EntityHttpUtil;
|
| | |
| | | String history = orderObject.getString("history");
|
| | |
|
| | | if (func.equals(xzConfig.funcName[0])) {
|
| | | mapObj = getPoiMap(orderObject,func);
|
| | | mapObj = getPoiMap(orderObject, func);
|
| | | } else if (func.equals(xzConfig.funcName[1])) {
|
| | | mapObj = getAroundPoi(orderObject, func);
|
| | | } else if (func.equals(xzConfig.funcName[2])) {
|
| | | mapObj = getQueryMeta(orderObject, func);
|
| | | } else if (func.equals(xzConfig.funcName[3])) {
|
| | | mapObj = getQueryRelationship(orderObject, func);
|
| | | }else if (func.equals(xzConfig.funcName[4])) {
|
| | | } else if (func.equals(xzConfig.funcName[4])) {
|
| | | mapObj = getCombatSimulate(orderObject, func);
|
| | | }else if (func.equals(xzConfig.funcName[5])) {
|
| | | } else if (func.equals(xzConfig.funcName[5])) {
|
| | | mapObj = getBatEnv(orderObject, func, allParams);
|
| | | }
|
| | | return mapObj;
|
| | |
| | | private HashMap<String, Object> getCombatSimulate(JSONObject orderObject, String func) {
|
| | | HashMap<String, Object> hashMap = new HashMap<String, Object>();
|
| | | hashMap.put("func", func);
|
| | | return hashMap;
|
| | | return hashMap;
|
| | | }
|
| | |
|
| | | private HashMap<String, Object> getBatEnv(JSONObject orderObject, String func, Map<String, String> allParams) throws Exception {
|
| | |
| | | System.out.println("rec history1:" + history);
|
| | | String val = entityHttpUtil.postAgentMessage(xzConfig.battleReport, allParams);
|
| | | JSONObject js = JSONObject.parseObject(val);
|
| | | if(js == null){
|
| | | if (js == null) {
|
| | | hashMap.put("msg", "æ¥åçæå¤±è´¥");
|
| | | return hashMap;
|
| | | }
|
| | |
| | | String type = argsObject.getString("attris");
|
| | | String dis = argsObject.getString("redius");
|
| | | int radius = 5000;
|
| | | if (dis != null) {
|
| | | if (dis != null && dis.contains("km")) {
|
| | | dis = dis.replace("km", "");
|
| | | radius = Integer.parseInt(dis) * 1000;
|
| | | }
|
| | | if (dis != null && dis.contains("m")) {
|
| | | dis = dis.replace("m", "");
|
| | | radius = Integer.parseInt(dis);
|
| | | }
|
| | | if (dis != null && dis.contains("ç±³")) {
|
| | | dis = dis.replace("ç±³", "");
|
| | | radius = Integer.parseInt(dis);
|
| | | }
|
| | | String aroundPoi = agentService.getAgentAroundPoi(place, type, radius, xzConfig.queryFiled, xzConfig.typeFiled);
|
| | | if (aroundPoi == "" || aroundPoi.isEmpty()) {
|
| | | String msg = "æªæ¥è¯¢å°" + place + "ç¸å
³æ°æ®ã请æä¾æ´å è¯¦ç»æ°æ®ã";
|
| | | hashMap.put("msg", msg);
|
| | | return hashMap;
|
| | | aroundPoi = agentService.getAgentAroundPoi(getTraditional(place), type, radius, xzConfig.queryFiled, xzConfig.typeFiled);
|
| | | if (aroundPoi == "" || aroundPoi.isEmpty()) {
|
| | | String msg = "æªæ¥è¯¢å°" + place + "ç¸å
³æ°æ®ã请æä¾æ´å è¯¦ç»æ°æ®ã";
|
| | | hashMap.put("msg", msg);
|
| | | return hashMap;
|
| | | }
|
| | |
|
| | | }
|
| | | JSONArray dataArray = JSONArray.parseArray(aroundPoi);
|
| | | System.out.println("aroundPoi: " + dataArray);
|
| | |
| | | String msg = "å·²æ¥è¯¢å°" + place + "å
ç" + type + "ç¸å
³æ°æ®ãå
±æ¥è¯¢å°" + dataArray.size() + "æ¡æ°æ®ã";
|
| | | hashMap.put("msg", msg);
|
| | | return hashMap;
|
| | |
|
| | | }
|
| | |
|
| | | public String getTraditional(String place) {
|
| | | ZhConvertBootstrap zhConvertBootstrap = ZhConvertBootstrap.newInstance();
|
| | | return zhConvertBootstrap.toTraditional(place);
|
| | |
|
| | | }
|
| | |
|
| | |
| | | String poiMap = agentService.getAgentPoiMap(place, xzConfig.queryFiled);
|
| | | JSONObject poiObj = JSONObject.parseObject(poiMap);
|
| | | if (poiMap == "" || poiMap.isEmpty()) {
|
| | | String msg = "æªæ¥è¯¢å°" + place + "ç¸å
³æ°æ®ã请æä¾æ´å è¯¦ç»æ°æ®ã";
|
| | | hashMap.put("msg", msg);
|
| | | return hashMap;
|
| | | poiMap = agentService.getAgentPoiMap(getTraditional(place), xzConfig.queryFiled);
|
| | | if (poiMap == "" || poiMap.isEmpty()) {
|
| | | String msg = "æªæ¥è¯¢å°" + place + "ç¸å
³æ°æ®ã请æä¾æ´å è¯¦ç»æ°æ®ã";
|
| | | hashMap.put("msg", msg);
|
| | | return hashMap;
|
| | | }
|
| | | }
|
| | | System.out.println("poiMap: " + poiObj);
|
| | | hashMap.put("func", func);
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yb.service;
|
| | |
|
| | | import com.baomidou.mybatisplus.extension.service.IService;
|
| | | import com.yb.config.PageUtils;
|
| | | import com.yb.config.R;
|
| | | import com.yb.config.Query;
|
| | | import com.yb.entity.THistoryEntity;
|
| | |
|
| | | import java.util.Map;
|
| | |
|
| | | /**
|
| | | * ${comments}
|
| | | *
|
| | | * @author yw
|
| | | * @email leutu@qq.com
|
| | | * @date 2024-09-14 16:35:15
|
| | | */
|
| | | public interface THistoryService extends IService<THistoryEntity> {
|
| | |
|
| | | PageUtils queryPage(Map<String, Object> params);
|
| | | PageUtils query(Map<String, Object> params);
|
| | | }
|
| | |
|
| | |
| | | import org.springframework.stereotype.Service;
|
| | | import org.locationtech.jts.geom.*;
|
| | | import org.locationtech.jts.operation.buffer.BufferOp;
|
| | |
|
| | |
|
| | | import java.util.*;
|
| | | import org.geotools.geometry.jts.JTS;
|
| | | import org.geotools.referencing.CRS;
|
| | | import org.locationtech.jts.geom.Coordinate;
|
| | | import org.locationtech.jts.geom.GeometryFactory;
|
| | | import org.locationtech.jts.geom.Point;
|
| | | //import org.opengis.referencing.FactoryException;
|
| | | //import org.opengis.referencing.crs.CoordinateReferenceSystem;
|
| | | //import org.opengis.referencing.operation.MathTransform;
|
| | | import org.locationtech.proj4j.CRSFactory;
|
| | | import org.locationtech.proj4j.CoordinateReferenceSystem;
|
| | | import org.locationtech.proj4j.CoordinateTransform;
|
| | | import org.locationtech.proj4j.CoordinateTransformFactory;
|
| | | import org.locationtech.proj4j.ProjCoordinate;
|
| | | import java.util.HashMap;
|
| | |
|
| | | @Service
|
| | |
| | |
|
| | | // å
³é®åæ¥è¯¢
|
| | | public String getQueryFiled(String place, String filed, String layerId, String dbId, String queryEntity) throws Exception {
|
| | | String query = filed + " like '%" + place + "%'" + "";
|
| | | String query = "";
|
| | | String valSql = " like '%" + place + "%'";
|
| | | String key = getPublickey();
|
| | | if (filed.indexOf(",") > -1) {
|
| | | String[] fileds = filed.split(",");
|
| | | for (int i = 0; i < fileds.length; i++) {
|
| | | String name = fileds[i];
|
| | | if (i > 0) {
|
| | | query += " or ";
|
| | | }
|
| | | query += name + valSql;
|
| | | }
|
| | | } else {
|
| | | query += filed + valSql;
|
| | | }
|
| | | query += "";
|
| | | System.out.println("rec getQueryFiled:" + query);
|
| | | String encrypt = RsaHelper.encrypt(key, query);
|
| | | HashMap formData = getHashMap(layerId, dbId, "1", "0", encrypt, null);
|
| | | String jsonString = entityHttpUtil.getPostMessage(queryEntity, formData);
|
| | |
| | |
|
| | | // å
³é®åæ¥è¯¢
|
| | | public String getQueryEntity(String place, String filed, String layerId, String dbId, String queryEntity) throws Exception {
|
| | | String query = filed + " like '%" + place + "%'" + "";
|
| | | String query = "";
|
| | | String valSql = " like '%" + place + "%'";
|
| | | String key = getPublickey();
|
| | | if (filed.indexOf(",") > -1) {
|
| | | String[] fileds = filed.split(",");
|
| | | for (int i = 0; i < fileds.length; i++) {
|
| | | String name = fileds[i];
|
| | | if (i > 0) {
|
| | | query += " or ";
|
| | | }
|
| | | query += name + valSql;
|
| | | }
|
| | | } else {
|
| | | query += filed + valSql;
|
| | | }
|
| | | query += "";
|
| | | String encrypt = RsaHelper.encrypt(key, query);
|
| | | HashMap formData = getHashMap(layerId, dbId, "1", "100", encrypt, null);
|
| | | formData.put("querytype", "entity");
|
| | |
| | | JSONObject jsonObject = JSON.parseObject(jsonString1);
|
| | | JSONObject dataObjject = jsonObject.getJSONObject("data");
|
| | | JSONArray dataArray = dataObjject.getJSONArray("items");
|
| | | if(dataArray.size()<=0){
|
| | | if (dataArray.size() <= 0) {
|
| | | return null;
|
| | | }
|
| | | return dataArray.getJSONObject(0).toString();
|
| | |
| | | String query = filed + " like '%" + type + "%'" + "";
|
| | | String encrypt = RsaHelper.encrypt(getPublickey(), query);
|
| | | HashMap formData = getHashMap(layerId, dbid, "1", "0", encrypt, wkt);
|
| | | formData.put("querytype","entity");
|
| | | String jsonString = entityHttpUtil.getPostMessage(entity, formData);
|
| | | JSONObject jsonObject = JSON.parseObject(jsonString);
|
| | | JSONObject dataObj = jsonObject.getJSONObject("data");
|
| | |
| | | hashMap.put("where", where);
|
| | | }
|
| | | if (box != null && box != "") {
|
| | | hashMap.put("box", box);
|
| | | hashMap.put("bbox", box);
|
| | | }
|
| | |
|
| | | return hashMap;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | //çæWKT
|
| | | public String getWKt(double lon, double lat, int radius) {
|
| | | public String getWKt(double lon, double lat, int radius) throws Exception {
|
| | | // å建ä¸ä¸ªåæ ç¹
|
| | | Coordinate coord = new Coordinate(lon, lat);
|
| | | // å建GeometryFactoryå®ä¾ï¼å¹¶æå®åæ åèç³»ç»ä¸ºWGS84
|
| | |
| | | // å建BufferOpå®ä¾ï¼ç¨äºçæç¼å²åº
|
| | | BufferOp bufferOp = new BufferOp(point);
|
| | | int dis = 500;
|
| | | if (radius != 0) {
|
| | | dis = radius;
|
| | | }
|
| | | // if (radius != 0) {
|
| | | // dis = radius;
|
| | | // }
|
| | | // 设置ç¼å²åºè·ç¦»ä¸º500ç±³
|
| | | Geometry bufferedGeometry = bufferOp.getResultGeometry(dis / 111319.9);
|
| | | // å建WKTWriterå®ä¾ï¼ç¨äºå°Geometry转æ¢ä¸ºWKTæ ¼å¼
|
| | |
| | | // è¾åºWKT
|
| | | // System.out.println("WKT: " + wkt);
|
| | | Envelope envelope = bufferedGeometry.getEnvelopeInternal();
|
| | | double[] wkt = new double[4];
|
| | | wkt[0] = envelope.getMinX();
|
| | | wkt[1] = envelope.getMinY();
|
| | | wkt[2] = envelope.getMaxX();
|
| | | wkt[3] = envelope.getMaxY();
|
| | | String arrayAsString = Arrays.toString(wkt);
|
| | | System.out.println("arrayAsString: " + arrayAsString);
|
| | | return arrayAsString;
|
| | |
|
| | | // double[] wkt = new double[4];
|
| | | // wkt[0] = ;
|
| | | // wkt[1] =;
|
| | | // wkt[2] = envelope.getMaxX();
|
| | | // wkt[3] = envelope.getMaxY();
|
| | | //
|
| | | // wkt += envelope.getMinX();
|
| | | // wkt += ","+envelope.getMinY();
|
| | | // wkt += ","+envelope.getMaxX();
|
| | | // wkt += ","+envelope.getMaxY();
|
| | | // System.out.println("WKT: " + wkt);
|
| | | // String arrayAsString = Arrays.toString(wkt);
|
| | | // System.out.println("wkt: " + wkt);
|
| | |
|
| | | CoordinateTransformFactory ctFactory = new CoordinateTransformFactory();
|
| | |
|
| | | // å®ä¹æºåæ ç³»ï¼WGS 84ï¼
|
| | | String srcCRS = "EPSG:4326";
|
| | | // å®ä¹ç®æ åæ ç³»ï¼ä¸å½å¤§å°åæ ç³»ï¼
|
| | | String destCRS = "EPSG:4550";
|
| | |
|
| | | // åå»ºåæ åèç³»ç»
|
| | | CRSFactory crsFactory = new CRSFactory();
|
| | | CoordinateReferenceSystem src = crsFactory.createFromName(srcCRS);
|
| | | CoordinateReferenceSystem dest = crsFactory.createFromName(destCRS);
|
| | |
|
| | | // åå»ºåæ è½¬æ¢å¨
|
| | | CoordinateTransform transform = ctFactory.createTransform(src, dest);
|
| | |
|
| | | // å®ä¹ä¸ä¸ªæºåæ ç¹ï¼ç»åº¦ï¼çº¬åº¦ï¼
|
| | | ProjCoordinate srcgetMin = new ProjCoordinate( envelope.getMinX(), envelope.getMinY()); // ä¾å¦ï¼å京çç»çº¬åº¦
|
| | | ProjCoordinate srcgetMax = new ProjCoordinate( envelope.getMaxX(), envelope.getMaxY()); // ä¾å¦ï¼å京çç»çº¬åº¦
|
| | | // æ§è¡è½¬æ¢
|
| | | ProjCoordinate destgetMin = new ProjCoordinate();
|
| | | ProjCoordinate destgetMax = new ProjCoordinate();
|
| | | transform.transform(srcgetMin, destgetMin);
|
| | | transform.transform(srcgetMax, destgetMax);
|
| | | String wkt =destgetMin.x+","+destgetMin.y+","+destgetMax.x+","+destgetMax.y;
|
| | | System.out.println("转æ¢åçåæ ï¼X = " +wkt);
|
| | | return wkt;
|
| | |
|
| | | }
|
| | |
|
| | |
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yb.service.impl;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import java.util.HashMap;
|
| | | import java.util.Map;
|
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
| | | import com.baomidou.mybatisplus.core.metadata.IPage;
|
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
| | | import com.yb.config.PageUtils;
|
| | | import com.yb.config.R;
|
| | | import com.yb.config.Query;
|
| | |
|
| | | import com.yb.dao.THistoryDao;
|
| | | import com.yb.entity.THistoryEntity;
|
| | | import com.yb.service.THistoryService;
|
| | |
|
| | |
|
| | | @Service("tHistoryService")
|
| | | public class THistoryServiceImpl extends ServiceImpl<THistoryDao, THistoryEntity> implements THistoryService {
|
| | |
|
| | | @Override
|
| | | public PageUtils queryPage(Map<String, Object> params) {
|
| | | IPage<THistoryEntity> page = this.page(
|
| | | new Query<THistoryEntity>().getPage(params),
|
| | | new QueryWrapper<THistoryEntity>()
|
| | | );
|
| | |
|
| | | return new PageUtils(page);
|
| | | }
|
| | | @Override
|
| | | public PageUtils query(Map<String, Object> params) {
|
| | | Map<String,Object> p = new HashMap<>();
|
| | | QueryWrapper q = new QueryWrapper<THistoryEntity>();
|
| | | for(String key:params.keySet()){
|
| | |
|
| | | String value = params.get(key).toString();
|
| | | if( key.equals("page") || key.equals("limit")) {
|
| | | p.put(key,value);
|
| | | continue;
|
| | | }
|
| | | if( key.indexOf("name") > -1 )
|
| | | q.like(key,value);
|
| | | else
|
| | | q.eq(key,value);
|
| | | System.out.println("key:"+key+" vlaue:"+value);
|
| | | }
|
| | | IPage<THistoryEntity> page = this.page(
|
| | | new Query<THistoryEntity>().getPage(p),
|
| | | q
|
| | | );
|
| | |
|
| | | return new PageUtils(page);
|
| | | }
|
| | | } |
| | |
| | | layerId: c8f3f75d-8730-44ec-81b7-f8ae4c5fd742
|
| | | # æ¥è¯¢å
³é®å
|
| | | # queryFiled: enti_name
|
| | | queryFiled: name_2
|
| | | queryFiled: name,name_2,name_1
|
| | | # æ¥è¯¢ç±»ååæ®µ
|
| | | typeFiled: fclass_1
|
| | | # å®ä½å
³é®åæ¥è¯¢
|
| | |
| | | agent:
|
| | | # 访é®å°å
|
| | | agentUrl: http://106.120.22.26:5367
|
| | | # agentUrl: http://103.135.160.14:5637
|
| | | # æå¾å½æ°
|
| | | agentIntent: /intention
|
| | | # ragæå¡
|
| | |
| | | server: |
| | | port: 7777 # æå¡å¨çHTTP端å£ï¼é»è®¤ä¸º8080 |
| | | # max-http-post-size: 2048M |
| | | servlet: |
| | | context-path: / |
| | | spring: |
| | | servlet: |
| | | multipart: |
| | | max-file-size: -1 |
| | | max-request-size: -1 |
| | | profiles: |
| | | active: agent |
| | | datasource: |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?>
|
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | |
|
| | | <mapper namespace="com.yb.dao.THistoryDao" >
|
| | |
|
| | | <!-- 坿 ¹æ®èªå·±çéæ±ï¼æ¯å¦è¦ä½¿ç¨ -->
|
| | | <resultMap type="com.yb.entity.THistoryEntity" id="tHistoryMap" >
|
| | | <result property="id" column="id"/>
|
| | | <result property="sessionid" column="sessionid"/>
|
| | | <result property="human" column="human"/>
|
| | | <result property="ai" column="ai"/>
|
| | | <result property="createTime" column="create_time"/>
|
| | | <result property="updateTime" column="update_time"/>
|
| | | <result property="userid" column="userid"/>
|
| | | </resultMap>
|
| | |
|
| | |
|
| | | </mapper> |
| | |
| | | layerId: c8f3f75d-8730-44ec-81b7-f8ae4c5fd742
|
| | | # æ¥è¯¢å
³é®å
|
| | | # queryFiled: enti_name
|
| | | queryFiled: name_2
|
| | | queryFiled: name,name_2,name_1
|
| | | # æ¥è¯¢ç±»ååæ®µ
|
| | | typeFiled: fclass_1
|
| | | # å®ä½å
³é®åæ¥è¯¢
|
| | |
| | | agent:
|
| | | # 访é®å°å
|
| | | agentUrl: http://106.120.22.26:5367
|
| | | # agentUrl: http://103.135.160.14:5637
|
| | | # æå¾å½æ°
|
| | | agentIntent: /intention
|
| | | # ragæå¡
|
| | |
| | | server: |
| | | port: 7777 # æå¡å¨çHTTP端å£ï¼é»è®¤ä¸º8080 |
| | | # max-http-post-size: 2048M |
| | | servlet: |
| | | context-path: / |
| | | spring: |
| | | servlet: |
| | | multipart: |
| | | max-file-size: -1 |
| | | max-request-size: -1 |
| | | profiles: |
| | | active: agent |
| | | datasource: |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?>
|
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | |
|
| | | <mapper namespace="com.yb.dao.THistoryDao" >
|
| | |
|
| | | <!-- 坿 ¹æ®èªå·±çéæ±ï¼æ¯å¦è¦ä½¿ç¨ -->
|
| | | <resultMap type="com.yb.entity.THistoryEntity" id="tHistoryMap" >
|
| | | <result property="id" column="id"/>
|
| | | <result property="sessionid" column="sessionid"/>
|
| | | <result property="human" column="human"/>
|
| | | <result property="ai" column="ai"/>
|
| | | <result property="createTime" column="create_time"/>
|
| | | <result property="updateTime" column="update_time"/>
|
| | | <result property="userid" column="userid"/>
|
| | | </resultMap>
|
| | |
|
| | |
|
| | | </mapper> |
| | |
| | | com\yb\controller\WebSocketController.class |
| | | com\yb\message\WebsocketConfiguration.class |
| | | com\yb\config\SQLFilter.class |
| | | com\yb\config\XzConfig.class |
| | | com\yb\service\impl\TMetaServiceImpl.class |
| | | com\yb\controller\GisOsmPoisFree1Controller.class |
| | | com\yb\entity\GisOsmPoisFree1Entity.class |
| | | com\yb\config\Constant$ScheduleStatus.class |
| | | com\yb\config\R.class |
| | | com\yb\message\WebSocketStompConfig.class |
| | | com\yb\controller\TMetaController.class |
| | | com\yb\dao\GisOsmPoisFree1Dao.class |
| | | com\yb\service\THistoryService.class |
| | | com\yb\entity\RelaEntity.class |
| | | com\yb\dao\THistoryDao.class |
| | | com\yb\service\IntentionService.class |
| | | com\yb\util\OkHttpUtil.class |
| | | com\yb\controller\XzController.class |
| | | com\yb\service\TMetaService.class |
| | | com\yb\controller\agentController.class |
| | | com\yb\controller\WebSocketController.class |
| | | com\yb\config\SQLFilter.class |
| | | com\yb\service\impl\TMetaServiceImpl.class |
| | | com\yb\service\impl\THistoryServiceImpl.class |
| | | com\yb\config\Constant$MenuType.class |
| | | com\yb\config\Swagger3Config.class |
| | | com\yb\entity\GisOsmPoisFree1Entity.class |
| | | com\yb\OllamaAiApplication.class |
| | | com\yb\postgis\GeometrySerializer.class |
| | | com\yb\service\impl\GisOsmPoisFree1ServiceImpl.class |
| | | com\yb\entity\ResponseEntity.class |
| | | com\yb\helper\RsaHelper.class |
| | | com\yb\entity\THistoryEntity.class |
| | | com\yb\message\WebSocketServer.class |
| | | com\yb\postgis\AbstractGeometryTypeHandler.class |
| | | com\yb\config\Constant$ScheduleStatus.class |
| | | com\yb\config\R.class |
| | | com\yb\message\WebSocketStompConfig.class |
| | | com\yb\service\GisOsmPoisFree1Service.class |
| | | com\yb\controller\TMetaController.class |
| | | com\yb\service\AgentService.class |
| | | com\yb\dao\GisOsmPoisFree1Dao.class |
| | | com\yb\postgis\PointTypeHandler.class |
| | | com\yb\util\EntityHttpUtil.class |
| | | com\yb\entity\TMetaEntity.class |
| | | com\yb\entity\RelaEntity.class |
| | | com\yb\controller\log\LoggerController.class |
| | | com\yb\dao\TMetaDao.class |
| | | com\yb\service\IntentionService.class |
| | | com\yb\service\XzService.class |
| | | com\yb\config\Query.class |
| | | com\yb\entity\ReqEntity.class |
| | | com\yb\config\Constant.class |
| | | com\yb\controller\THistoryController.class |
| | | com\yb\postgis\GeometryDeserializer.class |
| | | com\yb\util\OkHttpUtil.class |
| | | com\yb\config\PageUtils.class |
| | | com\yb\controller\XzController.class |
| | | com\yb\service\TMetaService.class |
| | | com\yb\controller\agentController.class |
| | |
| | | E:\project\AI大模å\æ°æºå¯¹æ¥\ollama_ai\src\main\java\com\yb\controller\GisOsmPoisFree1Controller.java |
| | | E:\project\AI大模å\æ°æºå¯¹æ¥\ollama_ai\src\main\java\com\yb\entity\RelaEntity.java |
| | | E:\project\AI大模å\æ°æºå¯¹æ¥\ollama_ai\src\main\java\com\yb\service\IntentionService.java |
| | | E:\project\AI大模å\æ°æºå¯¹æ¥\ollama_ai\src\main\java\com\yb\controller\log\LoggerController.java |
| | | E:\project\AI大模å\æ°æºå¯¹æ¥\ollama_ai\src\main\java\com\yb\service\impl\GisOsmPoisFree1ServiceImpl.java |
| | | E:\project\AI大模å\æ°æºå¯¹æ¥\ollama_ai\src\main\java\com\yb\entity\THistoryEntity.java |
| | | E:\project\AI大模å\æ°æºå¯¹æ¥\ollama_ai\src\main\java\com\yb\config\Constant.java |
| | | E:\project\AI大模å\æ°æºå¯¹æ¥\ollama_ai\src\main\java\com\yb\controller\WebSocketController.java |
| | | E:\project\AI大模å\æ°æºå¯¹æ¥\ollama_ai\src\main\java\com\yb\controller\THistoryController.java |
| | | E:\project\AI大模å\æ°æºå¯¹æ¥\ollama_ai\src\main\java\com\yb\service\THistoryService.java |
| | | E:\project\AI大模å\æ°æºå¯¹æ¥\ollama_ai\src\main\java\com\yb\dao\TMetaDao.java |
| | | E:\project\AI大模å\æ°æºå¯¹æ¥\ollama_ai\src\main\java\com\yb\message\WebSocketStompConfig.java |
| | | E:\project\AI大模å\æ°æºå¯¹æ¥\ollama_ai\src\main\java\com\yb\service\AgentService.java |
| | | E:\project\AI大模å\æ°æºå¯¹æ¥\ollama_ai\src\main\java\com\yb\service\impl\THistoryServiceImpl.java |
| | | E:\project\AI大模å\æ°æºå¯¹æ¥\ollama_ai\src\main\java\com\yb\helper\RsaHelper.java |
| | | E:\project\AI大模å\æ°æºå¯¹æ¥\ollama_ai\src\main\java\com\yb\message\WebSocketServer.java |
| | | E:\project\AI大模å\æ°æºå¯¹æ¥\ollama_ai\src\main\java\com\yb\config\R.java |
| | | E:\project\AI大模å\æ°æºå¯¹æ¥\ollama_ai\src\main\java\com\yb\postgis\AbstractGeometryTypeHandler.java |
| | | E:\project\AI大模å\æ°æºå¯¹æ¥\ollama_ai\src\main\java\com\yb\dao\THistoryDao.java |
| | | E:\project\AI大模å\æ°æºå¯¹æ¥\ollama_ai\src\main\java\com\yb\controller\agentController.java |
| | | E:\project\AI大模å\æ°æºå¯¹æ¥\ollama_ai\src\main\java\com\yb\postgis\GeometrySerializer.java |
| | | E:\project\AI大模å\æ°æºå¯¹æ¥\ollama_ai\src\main\java\com\yb\config\PageUtils.java |