master
admin 2 years ago
parent 1720b4128b
commit a40a7aa9e6
  1. 6
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/controller/FieldxController.java
  2. 3
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/tablex/mapper/TablexMapper.java
  3. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/tablex/service/ITablexService.java
  4. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/tablex/service/impl/TablexServiceImpl.java

@ -152,6 +152,9 @@ public class FieldxController extends JeecgController<Fieldx, IFieldxService> {
}
}
fieldxService.save(fieldx);
// 更新table版本
Tablex tablex = tablexService.getById(fieldx.getTableId());
tablexService.updateVersion(fieldx.getTableId(),tablex.getVerison()+1);
tablexService.updateSql(fieldx.getTableId(),createSql(fieldx.getTableId()));
return Result.OK("添加成功!");
}
@ -205,6 +208,9 @@ public class FieldxController extends JeecgController<Fieldx, IFieldxService> {
}
}
fieldxService.updateById(fieldx);
// 更新table版本
Tablex tablex = tablexService.getById(fieldx.getTableId());
tablexService.updateVersion(fieldx.getTableId(),tablex.getVerison()+1);
tablexService.updateSql(fieldx.getTableId(),createSql(fieldx.getTableId()));
return Result.OK("编辑成功!");
}

@ -18,4 +18,7 @@ public interface TablexMapper extends BaseMapper<Tablex> {
@Update("update tablex set table_structure = #{sql} where id = #{tableId}")
void updateSql(String tableId, String sql);
@Update("update tablex set verison = #{i} where id = #{tableId}")
void updateVersion(String tableId, int i);
}

@ -13,4 +13,6 @@ public interface ITablexService extends IService<Tablex> {
void updateSql(String tableId, String sql);
void updateVersion(String tableId, int i);
}

@ -24,4 +24,9 @@ public class TablexServiceImpl extends ServiceImpl<TablexMapper, Tablex> impleme
public void updateSql(String tableId, String sql) {
tablexMapper.updateSql(tableId,sql);
}
@Override
public void updateVersion(String tableId, int i) {
tablexMapper.updateVersion(tableId,i);
}
}

Loading…
Cancel
Save