fix:店员可编辑店长问题处理

This commit is contained in:
Chopper711 2023-03-17 08:29:15 +08:00
parent a81faf4ba4
commit f3e11fd368
2 changed files with 5 additions and 0 deletions

View File

@ -148,6 +148,7 @@ public enum ResultCode {
CLERK_ALREADY_EXIT_ERROR(20030, "店员已经存在"),
CLERK_DISABLED_ERROR(20031, "店员已禁用"),
CLERK_CURRENT_SUPPER(20032, "无法删除当前登录店员"),
CANT_EDIT_CLERK_SHOPKEEPER(20033, "无法在店员管理编辑店员信息"),
/**
* 权限
*/

View File

@ -148,6 +148,10 @@ public class ClerkServiceImpl extends ServiceImpl<ClerkMapper, Clerk> implements
@Override
public Clerk updateClerk(ClerkEditDTO clerkEditDTO) {
Clerk clerk = this.getById(clerkEditDTO.getId());
if(clerk.getShopkeeper()){
throw new ServiceException(ResultCode.CANT_EDIT_CLERK_SHOPKEEPER);
}
if (clerk != null) {
//校验当前店员是否是当前店铺的
if (!clerk.getStoreId().equals(UserContext.getCurrentUser().getStoreId())) {