Commit ce89da23 by 丁伟峰

update/delete需要在一个事务中:@Transactional

1 parent b9e1eff6
......@@ -17,6 +17,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.Duration;
import java.time.LocalDateTime;
......@@ -153,6 +154,7 @@ public class BusinessTeamServiceImpl implements BusinessTeamService {
}
@Override
@Transactional
public Result<?> updateTeamBase(BusinessTeamUpdateDTO.Request req) {
OrgTeamEntity entity = orgTeamDao.getByTeamId(req.getTeamId());
if (entity == null) {
......@@ -249,6 +251,7 @@ public class BusinessTeamServiceImpl implements BusinessTeamService {
}
@Override
@Transactional
public Result<?> deleteTeam(BusinessTeamDeleteDTO.Request req) {
orgTeamDao.updateStatusByTeamId(req.getTeamId(), 0);
orgTeamEngineerDao.updateStatusAllEngineers(req.getTeamId(), 0);
......@@ -273,6 +276,7 @@ public class BusinessTeamServiceImpl implements BusinessTeamService {
}
@Override
@Transactional
public Result<?> updateSchedulingConfig(BusinessTeamConfigSubmitDTO.Request req) {
OrgTeamEntity entity = orgTeamDao.getByTeamId(req.getTeamId());
if (entity == null) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!