diff --git a/shandan-basedata/src/main/java/com/keyware/shandan/dynacmicform/core/basic/services/DynamicFormService.java b/shandan-basedata/src/main/java/com/keyware/shandan/dynacmicform/core/basic/services/DynamicFormService.java index 4afecec..27d871e 100644 --- a/shandan-basedata/src/main/java/com/keyware/shandan/dynacmicform/core/basic/services/DynamicFormService.java +++ b/shandan-basedata/src/main/java/com/keyware/shandan/dynacmicform/core/basic/services/DynamicFormService.java @@ -12,6 +12,7 @@ import com.keyware.shandan.dynacmicform.core.db.parser.TableInfoParser; import com.keyware.shandan.dynacmicform.core.db.pojo.Table; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.List; @@ -37,6 +38,7 @@ public class DynamicFormService { * @return boolean * @throws Exception 异常 */ + @Transactional(rollbackFor = Exception.class) public boolean saveForm(FormInfoPo form) throws Exception { FormInfoPo oldForm = formInfoService.getById(form.getId()); Table table = TableInfoParser.parseTable(form); @@ -70,6 +72,7 @@ public class DynamicFormService { * @param id * @return */ + @Transactional(rollbackFor = Exception.class) public boolean delete(Integer id) { FormInfoPo form = formInfoService.getById(id); boolean ok = formInfoService.removeById(id);