|
@@ -38,7 +38,7 @@ public class DataSourceServiceImpl implements DataSourceService {
|
|
|
|
|
|
@Override
|
|
|
public synchronized Result addDataSource(DataSource dataSource) {
|
|
|
- dataSource = OpcUtil.convertPassword(dataSource);
|
|
|
+// dataSource = OpcUtil.convertPassword(dataSource);
|
|
|
String userId = userUtil.getCurrentUserId();
|
|
|
dataSource.setUserId(userId);
|
|
|
if (Blank.isEmpty(dataSource.getId())) {
|
|
@@ -117,6 +117,9 @@ public class DataSourceServiceImpl implements DataSourceService {
|
|
|
@Override
|
|
|
public Result getDataSourceItemTree(Integer id) {
|
|
|
DataSource dataSource = dataSourceDao.getDataSourceById(id);
|
|
|
+ if (Blank.isEmpty(dataSource)) {
|
|
|
+ return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "没有此数据源配置,请刷新");
|
|
|
+ }
|
|
|
DataSourceType dataSourceType = dataSourceDao.getDataSourceTypeById(dataSource.getTypeId());
|
|
|
dataSource = OpcUtil.convertPassword(dataSource);
|
|
|
if (dataSourceType.getDataSourceTypeKey().equals(DataSourceTypeEnum.OPC_UA_REAL.getValue()) ||
|
|
@@ -138,7 +141,7 @@ public class DataSourceServiceImpl implements DataSourceService {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "数据源ip,用户名,密码都不能为空");
|
|
|
}
|
|
|
return OpcDaUtil.opcDaGetTree(dataSource);
|
|
|
- }else if(dataSourceType.getDataSourceTypeKey().equals(DataSourceTypeEnum.KEP_SERVER_REAL.getValue())){
|
|
|
+ } else if (dataSourceType.getDataSourceTypeKey().equals(DataSourceTypeEnum.KEP_SERVER_REAL.getValue())) {
|
|
|
if (Blank.isEmpty(dataSource.getIpAddress(), dataSource.getIpUserName(), dataSource.getIpPassword())) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "数据源ip,用户名,密码都不能为空");
|
|
|
}
|