mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-05 06:51:23 +08:00
Added @Transactional
This commit is contained in:
@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.cfive.pinnacle.utils.WebUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -53,6 +54,7 @@ public class StaffServiceImpl extends ServiceImpl<StaffMapper, Staff> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public boolean modifyStaff(User user) {
|
||||
Long departmentId = user.getDepartmentId();
|
||||
Staff newStaff = user.getStaff();
|
||||
@@ -77,6 +79,7 @@ public class StaffServiceImpl extends ServiceImpl<StaffMapper, Staff> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public boolean modifySelf(Staff staff) {
|
||||
User user = WebUtil.getLoginUser().getUser();
|
||||
Staff oldStaff = user.getStaff();
|
||||
|
||||
@@ -77,6 +77,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public boolean modifyPasswd(String oldPasswd, String newPasswd) {
|
||||
if (!passwordEncoder.matches(oldPasswd, userMapper.getOneWithPowerByUsername(WebUtil.getLoginUser().getUsername()).getPasswd())) {
|
||||
throw new OldPasswordNotMatchException();
|
||||
|
||||
Reference in New Issue
Block a user