Browse Source

feat: 表关联问题

upgrade-final
Zhenfei.Li 5 years ago
parent
commit
0dd30e4b62
  1. 11
      src/main/java/com/fr/plugin/decision/request/handler/UpgradeHandler.java

11
src/main/java/com/fr/plugin/decision/request/handler/UpgradeHandler.java

@ -10,6 +10,7 @@ import com.finebi.burger.api.service.FineTableService;
import com.finebi.common.api.cell.context.CellCreator;
import com.finebi.common.authority.api.FineAuthorityUtils;
import com.finebi.common.authority.decision.role.FineAuthorityUser;
import com.finebi.common.impl.vo.relation.FineBusinessRelation;
import com.finebi.common.impl.vo.table.FineDBBusinessTable;
import com.finebi.foundation.api.reponse.FineRespond;
import com.finebi.foundation.api.service.FineService;
@ -137,11 +138,8 @@ public class UpgradeHandler extends HWAbstractHandler {
if (StringUtils.equals("success", dmlResult.getString("status")) && dmlResult.getBoolean("addLink")) {
ExcelLinkService.getInstance().addLink(name, connection, schema, tableName, createUser);
FineLoggerFactory.getLogger().info("HW_excel导入:FineDB 新增数据成功" + name);
List<FineBusinessRelation> fineBusinessRelations = CellCreator.getCellProvider().relationPathCell().getRelationsByTableNameWithoutAuth(fineBusinessTable.getName());
CellCreator.getCellProvider().tableCell().removeTable(fineBusinessTable.getName(), FineAuthorityUser.ROOT_USER_ID);
}
} catch(Exception e){
e.printStackTrace();
}
ObjectMapper mapper = new ObjectMapper();
JSONObject table = JSONObject.create().put("tableName", fineBusinessTable.getName()).put("connectionName", connection);
@ -154,6 +152,7 @@ public class UpgradeHandler extends HWAbstractHandler {
String tableString = tablesBean.toString();
FineBusinessTable[] businessTables = createBusinessTablesFromDBNewAddTableInfo(mapper.readValue(tableString, DataBaseAddTableRequestBean.class), authorityUser.getUserId());
TableAddResponseBean responed = getTableService().addNewTable(packid, authorityUser, businessTables);
CellCreator.getCellProvider().relationPathCell().addRelations(fineBusinessRelations, authorityUser);
addDbResult.put(FineRespond.success(responed));
} catch (JsonMappingException e) {
e.printStackTrace();
@ -166,6 +165,10 @@ public class UpgradeHandler extends HWAbstractHandler {
catch(Exception e){
e.printStackTrace();
}
}
} catch(Exception e){
e.printStackTrace();
}
}
});

Loading…
Cancel
Save