Commit 61fe456c authored by shiyu's avatar shiyu

事务回滚

parent 0175ca86
...@@ -25,6 +25,8 @@ import org.slf4j.Logger; ...@@ -25,6 +25,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
...@@ -106,6 +108,8 @@ public class QdUserSignInServiceImpl implements QdUserSignInService { ...@@ -106,6 +108,8 @@ public class QdUserSignInServiceImpl implements QdUserSignInService {
return Result.failed(); return Result.failed();
} }
@Transactional
@Override @Override
public Result signIn(QdUserSignInRequestDto dto) { public Result signIn(QdUserSignInRequestDto dto) {
try { try {
...@@ -240,6 +244,7 @@ public class QdUserSignInServiceImpl implements QdUserSignInService { ...@@ -240,6 +244,7 @@ public class QdUserSignInServiceImpl implements QdUserSignInService {
return Result.success(); return Result.success();
} catch (Exception e) { } catch (Exception e) {
logger.error("乾岛签到失败 error:{}", e); logger.error("乾岛签到失败 error:{}", e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
} }
return Result.failed(); return Result.failed();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment