员工账号接口实现

This commit is contained in:
张松 2025-02-12 15:36:04 +08:00
parent 119ef4397d
commit 8a4d083bc8
4 changed files with 4 additions and 3 deletions

View File

@ -34,7 +34,7 @@ public class ShopStaff implements Serializable {
* 使用系统用户 sys_user id
*/
@Id(keyType = KeyType.Auto)
private Integer id;
private Long id;
/**
* 员工编号

View File

@ -15,5 +15,5 @@ public interface SysUserService extends IService<SysUser> {
Boolean updateSysUserPwd(long sysUserId, String accountPwd);
Boolean removeUserAndRole(Integer id);
Boolean removeUserAndRole(Long id);
}

View File

@ -42,6 +42,7 @@ public class ShopStaffServiceImpl extends ServiceImpl<ShopStaffMapper, ShopStaff
SysUser sysUser = sysUserService.addUser(shopStaffAddDTO.getName(), shopStaffAddDTO.getAccountName(), shopStaffAddDTO.getAccountPwd(), shopStaffAddDTO.getPhone(), shopStaffAddDTO.getRoleId());
ShopStaff shopStaff = BeanUtil.copyProperties(shopStaffAddDTO, ShopStaff.class);
shopStaff.setShopId(StpKit.ADMIN.getLoginIdAsLong());
shopStaff.setId(sysUser.getId());
return save(shopStaff);
}

View File

@ -67,7 +67,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> imp
}
@Override
public Boolean removeUserAndRole(Integer id) {
public Boolean removeUserAndRole(Long id) {
sysUsersRolesMapper.deleteByQuery(new QueryWrapper().eq(SysUsersRoles::getUserId, id));
return removeById(id);
}