员工接口修改
This commit is contained in:
@@ -19,6 +19,7 @@ import com.mybatisflex.core.query.QueryWrapper;
|
|||||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -41,6 +42,7 @@ public class ShopStaffServiceImpl extends ServiceImpl<ShopStaffMapper, ShopStaff
|
|||||||
private ShopStaffPermissionService shopStaffPermissionService;
|
private ShopStaffPermissionService shopStaffPermissionService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean add(ShopStaffAddDTO shopStaffAddDTO) {
|
public Boolean add(ShopStaffAddDTO shopStaffAddDTO) {
|
||||||
SysUser sysUser = sysUserService.addUser(shopStaffAddDTO.getName(), StpKit.USER.getLoginIdAsString() + "@" +shopStaffAddDTO.getAccountName(),
|
SysUser sysUser = sysUserService.addUser(shopStaffAddDTO.getName(), StpKit.USER.getLoginIdAsString() + "@" +shopStaffAddDTO.getAccountName(),
|
||||||
shopStaffAddDTO.getAccountPwd(), shopStaffAddDTO.getPhone(), shopStaffAddDTO.getRoleId());
|
shopStaffAddDTO.getAccountPwd(), shopStaffAddDTO.getPhone(), shopStaffAddDTO.getRoleId());
|
||||||
@@ -50,7 +52,9 @@ public class ShopStaffServiceImpl extends ServiceImpl<ShopStaffMapper, ShopStaff
|
|||||||
save(shopStaff);
|
save(shopStaff);
|
||||||
|
|
||||||
// 权限添加
|
// 权限添加
|
||||||
addPermission(shopStaff, shopStaffAddDTO.getShopPermissionIds());
|
if (shopStaffAddDTO.getShopPermissionIds() != null && !shopStaffAddDTO.getShopPermissionIds().isEmpty()) {
|
||||||
|
addPermission(shopStaff, shopStaffAddDTO.getShopPermissionIds());
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user