|
@@ -44,13 +44,16 @@ public class GeoDataSourceServiceImpl implements IGeoDataSourceService {
|
|
|
List<LayerGroupDsView> layerGroupDsViewList = new ArrayList<LayerGroupDsView>();
|
|
|
|
|
|
Map<String, Object> dsParams = new HashMap<String, Object>();
|
|
|
- dsParams.put(JDBCDataStoreFactory.DATABASE.key, geoConfig.getDsBase());
|
|
|
- dsParams.put(JDBCDataStoreFactory.DBTYPE.key, geoConfig.getDbType());
|
|
|
-
|
|
|
+ dsParams.put(DBCPDataSourceFactory.DSTYPE.key, "DBCP");
|
|
|
+ dsParams.put(DBCPDataSourceFactory.DRIVERCLASS.key, "com.mysql.cj.jdbc.Driver");
|
|
|
+ dsParams.put(DBCPDataSourceFactory.JDBC_URL.key, "jdbc:mysql://"+geoConfig.getDsIp()+":"+geoConfig.getDsPort()+"/"+geoConfig.getDsBase()+"?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai");
|
|
|
+ dsParams.put(DBCPDataSourceFactory.USERNAME.key, geoConfig.getDsUsername());
|
|
|
+ dsParams.put(DBCPDataSourceFactory.PASSWORD.key, geoConfig.getDsPassword());
|
|
|
+ dsParams.put(DBCPDataSourceFactory.MAXACTIVE.key, Integer.valueOf(10));
|
|
|
+ dsParams.put(DBCPDataSourceFactory.MAXIDLE.key, Integer.valueOf(1));
|
|
|
dsParams.put(JDBCDataStoreFactory.HOST.key, geoConfig.getDsIp());
|
|
|
+ dsParams.put(JDBCDataStoreFactory.DATABASE.key, geoConfig.getDsBase());
|
|
|
dsParams.put(JDBCDataStoreFactory.PORT.key, geoConfig.getDsPort());
|
|
|
- dsParams.put(JDBCDataStoreFactory.USER.key, geoConfig.getDsUsername());
|
|
|
- dsParams.put(JDBCDataStoreFactory.PASSWD.key, geoConfig.getDsPassword());
|
|
|
dsParams.put("tableName", "layer_group_ds_view");
|
|
|
|
|
|
|
|
@@ -86,14 +89,18 @@ public class GeoDataSourceServiceImpl implements IGeoDataSourceService {
|
|
|
if(CollUtil.isEmpty(layerCodeList)){
|
|
|
return dataMaps;
|
|
|
}
|
|
|
- Map<String, Object> dsParams = new HashMap<String, Object>();
|
|
|
- dsParams.put(JDBCDataStoreFactory.DATABASE.key, geoConfig.getDsBase());
|
|
|
- dsParams.put(JDBCDataStoreFactory.DBTYPE.key, geoConfig.getDbType());
|
|
|
|
|
|
+ Map<String, Object> dsParams = new HashMap<String, Object>();
|
|
|
+ dsParams.put(DBCPDataSourceFactory.DSTYPE.key, "DBCP");
|
|
|
+ dsParams.put(DBCPDataSourceFactory.DRIVERCLASS.key, "com.mysql.cj.jdbc.Driver");
|
|
|
+ dsParams.put(DBCPDataSourceFactory.JDBC_URL.key, "jdbc:mysql://"+geoConfig.getDsIp()+":"+geoConfig.getDsPort()+"/"+geoConfig.getDsBase()+"?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai");
|
|
|
+ dsParams.put(DBCPDataSourceFactory.USERNAME.key, geoConfig.getDsUsername());
|
|
|
+ dsParams.put(DBCPDataSourceFactory.PASSWORD.key, geoConfig.getDsPassword());
|
|
|
+ dsParams.put(DBCPDataSourceFactory.MAXACTIVE.key, Integer.valueOf(10));
|
|
|
+ dsParams.put(DBCPDataSourceFactory.MAXIDLE.key, Integer.valueOf(1));
|
|
|
dsParams.put(JDBCDataStoreFactory.HOST.key, geoConfig.getDsIp());
|
|
|
+ dsParams.put(JDBCDataStoreFactory.DATABASE.key, geoConfig.getDsBase());
|
|
|
dsParams.put(JDBCDataStoreFactory.PORT.key, geoConfig.getDsPort());
|
|
|
- dsParams.put(JDBCDataStoreFactory.USER.key, geoConfig.getDsUsername());
|
|
|
- dsParams.put(JDBCDataStoreFactory.PASSWD.key, geoConfig.getDsPassword());
|
|
|
dsParams.put("tableName", "layer_style_view");
|
|
|
|
|
|
|
|
@@ -163,14 +170,16 @@ public class GeoDataSourceServiceImpl implements IGeoDataSourceService {
|
|
|
public PageResult geoDsQuery(Map<String, Object> paramMaps) throws Exception {
|
|
|
|
|
|
Map<String, Object> dsParams = new HashMap<String, Object>();
|
|
|
-
|
|
|
- dsParams.put(JDBCDataStoreFactory.DATABASE.key, geoConfig.getDsBase());
|
|
|
- dsParams.put(JDBCDataStoreFactory.DBTYPE.key, geoConfig.getDbType());
|
|
|
-
|
|
|
+ dsParams.put(DBCPDataSourceFactory.DSTYPE.key, "DBCP");
|
|
|
+ dsParams.put(DBCPDataSourceFactory.DRIVERCLASS.key, "com.mysql.cj.jdbc.Driver");
|
|
|
+ dsParams.put(DBCPDataSourceFactory.JDBC_URL.key, "jdbc:mysql://"+geoConfig.getDsIp()+":"+geoConfig.getDsPort()+"/"+geoConfig.getDsBase()+"?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai");
|
|
|
+ dsParams.put(DBCPDataSourceFactory.USERNAME.key, geoConfig.getDsUsername());
|
|
|
+ dsParams.put(DBCPDataSourceFactory.PASSWORD.key, geoConfig.getDsPassword());
|
|
|
+ dsParams.put(DBCPDataSourceFactory.MAXACTIVE.key, Integer.valueOf(10));
|
|
|
+ dsParams.put(DBCPDataSourceFactory.MAXIDLE.key, Integer.valueOf(1));
|
|
|
dsParams.put(JDBCDataStoreFactory.HOST.key, geoConfig.getDsIp());
|
|
|
+ dsParams.put(JDBCDataStoreFactory.DATABASE.key, geoConfig.getDsBase());
|
|
|
dsParams.put(JDBCDataStoreFactory.PORT.key, geoConfig.getDsPort());
|
|
|
- dsParams.put(JDBCDataStoreFactory.USER.key, geoConfig.getDsUsername());
|
|
|
- dsParams.put(JDBCDataStoreFactory.PASSWD.key, geoConfig.getDsPassword());
|
|
|
dsParams.put("tableName", "tile_data_source");
|
|
|
|
|
|
return ecqlService.cqlQuery(dsParams,paramMaps);
|
|
@@ -180,14 +189,16 @@ public class GeoDataSourceServiceImpl implements IGeoDataSourceService {
|
|
|
public Result geoDsAddInfo(Map<String, Object> paramMaps) throws Exception {
|
|
|
|
|
|
Map<String, Object> dsParams = new HashMap<String, Object>();
|
|
|
-
|
|
|
- dsParams.put(JDBCDataStoreFactory.DATABASE.key, geoConfig.getDsBase());
|
|
|
- dsParams.put(JDBCDataStoreFactory.DBTYPE.key, geoConfig.getDbType());
|
|
|
-
|
|
|
+ dsParams.put(DBCPDataSourceFactory.DSTYPE.key, "DBCP");
|
|
|
+ dsParams.put(DBCPDataSourceFactory.DRIVERCLASS.key, "com.mysql.cj.jdbc.Driver");
|
|
|
+ dsParams.put(DBCPDataSourceFactory.JDBC_URL.key, "jdbc:mysql://"+geoConfig.getDsIp()+":"+geoConfig.getDsPort()+"/"+geoConfig.getDsBase()+"?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai");
|
|
|
+ dsParams.put(DBCPDataSourceFactory.USERNAME.key, geoConfig.getDsUsername());
|
|
|
+ dsParams.put(DBCPDataSourceFactory.PASSWORD.key, geoConfig.getDsPassword());
|
|
|
+ dsParams.put(DBCPDataSourceFactory.MAXACTIVE.key, Integer.valueOf(10));
|
|
|
+ dsParams.put(DBCPDataSourceFactory.MAXIDLE.key, Integer.valueOf(1));
|
|
|
dsParams.put(JDBCDataStoreFactory.HOST.key, geoConfig.getDsIp());
|
|
|
+ dsParams.put(JDBCDataStoreFactory.DATABASE.key, geoConfig.getDsBase());
|
|
|
dsParams.put(JDBCDataStoreFactory.PORT.key, geoConfig.getDsPort());
|
|
|
- dsParams.put(JDBCDataStoreFactory.USER.key, geoConfig.getDsUsername());
|
|
|
- dsParams.put(JDBCDataStoreFactory.PASSWD.key, geoConfig.getDsPassword());
|
|
|
dsParams.put("tableName", "tile_data_source");
|
|
|
|
|
|
DateTime beginTime = DateUtil.parse(DateUtil.formatDateTime(new Date()), DatePattern.NORM_DATETIME_PATTERN);
|
|
@@ -201,14 +212,16 @@ public class GeoDataSourceServiceImpl implements IGeoDataSourceService {
|
|
|
public Result geoDsUpdateInfo(Map<String, Object> paramMaps) throws Exception {
|
|
|
|
|
|
Map<String, Object> dsParams = new HashMap<String, Object>();
|
|
|
-
|
|
|
- dsParams.put(JDBCDataStoreFactory.DATABASE.key, geoConfig.getDsBase());
|
|
|
- dsParams.put(JDBCDataStoreFactory.DBTYPE.key, geoConfig.getDbType());
|
|
|
-
|
|
|
+ dsParams.put(DBCPDataSourceFactory.DSTYPE.key, "DBCP");
|
|
|
+ dsParams.put(DBCPDataSourceFactory.DRIVERCLASS.key, "com.mysql.cj.jdbc.Driver");
|
|
|
+ dsParams.put(DBCPDataSourceFactory.JDBC_URL.key, "jdbc:mysql://"+geoConfig.getDsIp()+":"+geoConfig.getDsPort()+"/"+geoConfig.getDsBase()+"?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai");
|
|
|
+ dsParams.put(DBCPDataSourceFactory.USERNAME.key, geoConfig.getDsUsername());
|
|
|
+ dsParams.put(DBCPDataSourceFactory.PASSWORD.key, geoConfig.getDsPassword());
|
|
|
+ dsParams.put(DBCPDataSourceFactory.MAXACTIVE.key, Integer.valueOf(10));
|
|
|
+ dsParams.put(DBCPDataSourceFactory.MAXIDLE.key, Integer.valueOf(1));
|
|
|
dsParams.put(JDBCDataStoreFactory.HOST.key, geoConfig.getDsIp());
|
|
|
+ dsParams.put(JDBCDataStoreFactory.DATABASE.key, geoConfig.getDsBase());
|
|
|
dsParams.put(JDBCDataStoreFactory.PORT.key, geoConfig.getDsPort());
|
|
|
- dsParams.put(JDBCDataStoreFactory.USER.key, geoConfig.getDsUsername());
|
|
|
- dsParams.put(JDBCDataStoreFactory.PASSWD.key, geoConfig.getDsPassword());
|
|
|
dsParams.put("tableName", "tile_data_source");
|
|
|
|
|
|
DateTime updateTime = DateUtil.parse(DateUtil.formatDateTime(new Date()), DatePattern.NORM_DATETIME_PATTERN);
|
|
@@ -229,14 +242,16 @@ public class GeoDataSourceServiceImpl implements IGeoDataSourceService {
|
|
|
public Result geoDsRemoveInfo(Map<String, Object> paramMaps) throws Exception {
|
|
|
|
|
|
Map<String, Object> dsParams = new HashMap<String, Object>();
|
|
|
-
|
|
|
- dsParams.put(JDBCDataStoreFactory.DATABASE.key, geoConfig.getDsBase());
|
|
|
- dsParams.put(JDBCDataStoreFactory.DBTYPE.key, geoConfig.getDbType());
|
|
|
-
|
|
|
+ dsParams.put(DBCPDataSourceFactory.DSTYPE.key, "DBCP");
|
|
|
+ dsParams.put(DBCPDataSourceFactory.DRIVERCLASS.key, "com.mysql.cj.jdbc.Driver");
|
|
|
+ dsParams.put(DBCPDataSourceFactory.JDBC_URL.key, "jdbc:mysql://"+geoConfig.getDsIp()+":"+geoConfig.getDsPort()+"/"+geoConfig.getDsBase()+"?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai");
|
|
|
+ dsParams.put(DBCPDataSourceFactory.USERNAME.key, geoConfig.getDsUsername());
|
|
|
+ dsParams.put(DBCPDataSourceFactory.PASSWORD.key, geoConfig.getDsPassword());
|
|
|
+ dsParams.put(DBCPDataSourceFactory.MAXACTIVE.key, Integer.valueOf(10));
|
|
|
+ dsParams.put(DBCPDataSourceFactory.MAXIDLE.key, Integer.valueOf(1));
|
|
|
dsParams.put(JDBCDataStoreFactory.HOST.key, geoConfig.getDsIp());
|
|
|
+ dsParams.put(JDBCDataStoreFactory.DATABASE.key, geoConfig.getDsBase());
|
|
|
dsParams.put(JDBCDataStoreFactory.PORT.key, geoConfig.getDsPort());
|
|
|
- dsParams.put(JDBCDataStoreFactory.USER.key, geoConfig.getDsUsername());
|
|
|
- dsParams.put(JDBCDataStoreFactory.PASSWD.key, geoConfig.getDsPassword());
|
|
|
dsParams.put("tableName", "tile_data_source");
|
|
|
|
|
|
String cql = paramMaps.get("cql").toString();
|