fix: asset未找到type时 指定other id 由-1改为9

This commit is contained in:
tanghao
2021-07-30 13:56:29 +08:00
parent 763cbe3e93
commit 702d9fa493
3 changed files with 1873 additions and 2 deletions

View File

@@ -167,7 +167,7 @@ public class AssetAssetServiceImpl extends ServiceImpl<AssetAssetDao, AssetAsset
assetAsset.setPid(-1);
assetAsset.setBrandId(modelAndBrand.get(asset.getModelId()));
Integer typeId = assetTypeNameAndId.get(modelIdAndTypeName.get(asset.getModelId()));
assetAsset.setTypeId(ToolUtil.isNotEmpty(typeId)?typeId:-1);
assetAsset.setTypeId(ToolUtil.isNotEmpty(typeId)?typeId:9);
assetAsset.setModelId(asset.getModelId());
assetAsset.setStateId(asset.getState());
assetAsset.setDcId(asset.getIdcId());

View File

@@ -67,6 +67,6 @@ 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, '')");
sqlDao.execute("INSERT INTO asset_type_conf(`id`,`pid`, `vm`, `vmh`, `name`, `remark`, `build_in`, `auth_protocol`, `snmp_enable`, `snmp_collect`, `ssh_collect`, `ssh_collect_script`) VALUES (9,0, '0', '0', 'Other', '', '1', 0, 0, 0, 0, '')");
}
}

File diff suppressed because one or more lines are too long