update 优化 代码生成 业务接口 增加事务回滚

2.X
疯狂的狮子li 3 years ago
parent 695bbac9de
commit 2bade9c472

@ -33,6 +33,7 @@ import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext; import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.Velocity; import org.apache.velocity.app.Velocity;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.File; import java.io.File;
@ -171,6 +172,7 @@ public class GenTableServiceImpl implements IGenTableService {
* @param genTable * @param genTable
* @return * @return
*/ */
@Transactional(rollbackFor = Exception.class)
@Override @Override
public void updateGenTable(GenTable genTable) { public void updateGenTable(GenTable genTable) {
String options = JsonUtils.toJsonString(genTable.getParams()); String options = JsonUtils.toJsonString(genTable.getParams());
@ -189,6 +191,7 @@ public class GenTableServiceImpl implements IGenTableService {
* @param tableIds ID * @param tableIds ID
* @return * @return
*/ */
@Transactional(rollbackFor = Exception.class)
@Override @Override
public void deleteGenTableByIds(Long[] tableIds) { public void deleteGenTableByIds(Long[] tableIds) {
List<Long> ids = Arrays.asList(tableIds); List<Long> ids = Arrays.asList(tableIds);
@ -201,6 +204,7 @@ public class GenTableServiceImpl implements IGenTableService {
* *
* @param tableList * @param tableList
*/ */
@Transactional(rollbackFor = Exception.class)
@Override @Override
public void importGenTable(List<GenTable> tableList) { public void importGenTable(List<GenTable> tableList) {
String operName = LoginHelper.getUsername(); String operName = LoginHelper.getUsername();
@ -326,6 +330,7 @@ public class GenTableServiceImpl implements IGenTableService {
* *
* @param tableName * @param tableName
*/ */
@Transactional(rollbackFor = Exception.class)
@Override @Override
public void synchDb(String tableName) { public void synchDb(String tableName) {
GenTable table = baseMapper.selectGenTableByName(tableName); GenTable table = baseMapper.selectGenTableByName(tableName);

Loading…
Cancel
Save