|
|
@ -49,6 +49,7 @@ import org.jeecgframework.poi.excel.entity.TemplateExportParams; |
|
|
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
|
|
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
|
|
|
import org.jeecg.common.system.base.controller.JeecgController; |
|
|
|
import org.jeecg.common.system.base.controller.JeecgController; |
|
|
|
import org.jeecgframework.poi.excel.view.JeecgTemplateExcelView; |
|
|
|
import org.jeecgframework.poi.excel.view.JeecgTemplateExcelView; |
|
|
|
|
|
|
|
import org.jetbrains.annotations.NotNull; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
@ -194,14 +195,14 @@ public class TablexController extends JeecgController<Tablex, ITablexService> { |
|
|
|
@AutoLog(value = "实体表-编辑") |
|
|
|
@AutoLog(value = "实体表-编辑") |
|
|
|
@ApiOperation(value = "实体表-编辑", notes = "实体表-编辑") |
|
|
|
@ApiOperation(value = "实体表-编辑", notes = "实体表-编辑") |
|
|
|
@PutMapping(value = "/edit") |
|
|
|
@PutMapping(value = "/edit") |
|
|
|
public Result<?> edit(@RequestBody Tablex tablex) { |
|
|
|
public Result<?> edit(@NotNull @RequestBody Tablex tablex) { |
|
|
|
tablex.setVerison(tablex.getVerison() + 1); |
|
|
|
tablex.setVerison(tablex.getVerison() + 1); |
|
|
|
List<Tablex> tablexList = tablexService.list(); |
|
|
|
// List<Tablex> tablexList = tablexService.list();
|
|
|
|
for (Tablex tablex1 : tablexList) { |
|
|
|
// for (Tablex tablex1 : tablexList) {
|
|
|
|
if (tablex1.getModuleId().equals(tablex.getModuleId())) { |
|
|
|
// if (tablex1.getModuleId().equals(tablex.getModuleId())) {
|
|
|
|
return Result.error("该模块已有实体,编辑失败"); |
|
|
|
// return Result.error("该模块已有实体,编辑失败");
|
|
|
|
} |
|
|
|
// }
|
|
|
|
} |
|
|
|
// }
|
|
|
|
if (tablex.getModuleId() != null) { |
|
|
|
if (tablex.getModuleId() != null) { |
|
|
|
Modulex modulex = modulexService.getById(tablex.getModuleId()); |
|
|
|
Modulex modulex = modulexService.getById(tablex.getModuleId()); |
|
|
|
tablex.setTableName(modulex.getModuleName()); |
|
|
|
tablex.setTableName(modulex.getModuleName()); |
|
|
|