|
|
|
@ -97,6 +97,12 @@ public class TablexController extends JeecgController<Tablex, ITablexService> { |
|
|
|
|
@ApiOperation(value="实体表-添加", notes="实体表-添加") |
|
|
|
|
@PostMapping(value = "/add") |
|
|
|
|
public Result<?> add(@RequestBody Tablex tablex) { |
|
|
|
|
List<Tablex> tablexList = tablexService.list(); |
|
|
|
|
for (Tablex tablex1 : tablexList){ |
|
|
|
|
if (tablex1.getModuleId().equals(tablex.getModuleId())){ |
|
|
|
|
return Result.error("该模块已有实体,添加失败"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (tablex.getModuleId() != null){ |
|
|
|
|
Modulex modulex = modulexService.getById(tablex.getModuleId()); |
|
|
|
|
tablex.setTableName(modulex.getModuleName()); |
|
|
|
@ -118,6 +124,12 @@ public class TablexController extends JeecgController<Tablex, ITablexService> { |
|
|
|
|
@ApiOperation(value="实体表-编辑", notes="实体表-编辑") |
|
|
|
|
@PutMapping(value = "/edit") |
|
|
|
|
public Result<?> edit(@RequestBody Tablex tablex) { |
|
|
|
|
List<Tablex> tablexList = tablexService.list(); |
|
|
|
|
for (Tablex tablex1 : tablexList){ |
|
|
|
|
if (tablex1.getModuleId().equals(tablex.getModuleId())){ |
|
|
|
|
return Result.error("该模块已有实体,编辑失败"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (tablex.getModuleId() != null){ |
|
|
|
|
Modulex modulex = modulexService.getById(tablex.getModuleId()); |
|
|
|
|
tablex.setTableName(modulex.getModuleName()); |
|
|
|
|