Commit 71ea4320 by 梁家彪

修改数据库汇聚添加方式

parent 94de6fdc
......@@ -48,6 +48,9 @@ public class DataCollectService extends ServiceImpl<DataCollectDao, DataCollectS
@Resource
private DataCollectSettingApiParaDao dataCollectSettingApiParaDao;
@Resource
private QueryDbDao queryDbDao;
public PageVo<DataCollectSetting> getList(DataCollectReq req) {
return PagingUtils.paging(req, dataCollectDao, new LambdaQueryWrapper<>(), DataCollectSetting.class);
}
......@@ -80,6 +83,16 @@ public class DataCollectService extends ServiceImpl<DataCollectDao, DataCollectS
if(dataCollectSettingAddReq.getDataType() != 3){
HashMap<String, Object> map = new HashMap();
BeanUtil.copyProperties(dataCollectSettingAddReq.getDataFromSetting(), map);
if(dataCollectSettingAddReq.getDataType() == 1){
QueryDb db = queryDbDao.selectById((Integer) map.get("databaseId"));
map.put("dbName", db.getDbName());
map.put("dbIp", db.getDbIp());
map.put("dbPort", db.getDbPort());
map.put("username", db.getUsername());
map.put("password", db.getPassword());
map.put("dbType", db.getDbType());
map.remove("databaseId");
}
map.put("dataCollectSettingId", dataCollectSettingAddReq.getId());
AssertUtils.isTrue(getDao(dataCollectSettingAddReq.getDataType()).insert(map)==1, "添加失败");
}else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment