fix: 修改asset_type值处理逻辑
This commit is contained in:
@@ -4,6 +4,7 @@ import cn.hutool.log.Log;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nis.dao.AssetTypeConfDao;
|
||||
import com.nis.dao.DcDao;
|
||||
import com.nis.dao.SqlDao;
|
||||
import com.nis.entity.AssetTypeConf;
|
||||
import com.nis.entity.Dc;
|
||||
import com.nis.entity.Idc;
|
||||
@@ -30,6 +31,9 @@ public class AssetTypeConfServiceImpl extends ServiceImpl<AssetTypeConfDao, Asse
|
||||
@Autowired
|
||||
private SysDictService sysDictService;
|
||||
|
||||
@Autowired
|
||||
private SqlDao sqlDao;
|
||||
|
||||
@Override
|
||||
public void handler() {
|
||||
// 初始化数据
|
||||
@@ -37,7 +41,7 @@ public class AssetTypeConfServiceImpl extends ServiceImpl<AssetTypeConfDao, Asse
|
||||
}
|
||||
|
||||
public void initData() {
|
||||
List<SysDictEntity> types = sysDictService.queryDatas("assetType");
|
||||
/*List<SysDictEntity> types = sysDictService.queryDatas("assetType");
|
||||
List<AssetTypeConf> list = this.list();
|
||||
List<AssetTypeConf> assetTypeConfs = new ArrayList<AssetTypeConf>();
|
||||
Map<String, AssetTypeConf> nameAndData = list.stream().collect(Collectors.toMap(AssetTypeConf::getName, Function.identity()));
|
||||
@@ -62,6 +66,7 @@ public class AssetTypeConfServiceImpl extends ServiceImpl<AssetTypeConfDao, Asse
|
||||
|
||||
if(ToolUtil.isNotEmpty(assetTypeConfs)) {
|
||||
this.saveBatch(assetTypeConfs);
|
||||
}
|
||||
}*/
|
||||
sqlDao.execute("INSERT INTO asset_type_conf(`pid`, `vm`, `vmh`, `name`, `remark`, `build_in`, `auth_protocol`, `snmp_enable`, `snmp_collect`, `ssh_collect`, `ssh_collect_script`) VALUES (0, '0', '0', 'Other', '', '1', 0, 0, 0, 0, '')");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user