|
|
@@ -212,23 +212,10 @@ public class FsUserAdminController extends BaseController {
|
|
|
@PutMapping("/redStatus")
|
|
|
@ApiOperation("修改会员红包领取开关(red_status:1开启 0关闭)")
|
|
|
public AjaxResult updateRedStatus(@Valid @RequestBody FsUserRedStatusParam param) {
|
|
|
- LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
- Long companyId = loginUser.getCompany().getCompanyId();
|
|
|
FsUser fsUser = fsUserService.selectFsUserById(param.getUserId());
|
|
|
if (fsUser == null) {
|
|
|
return AjaxResult.error("用户不存在");
|
|
|
}
|
|
|
- boolean allowed = Objects.equals(fsUser.getCompanyId(), companyId);
|
|
|
- if (!allowed) {
|
|
|
- FsUserCompanyUser query = new FsUserCompanyUser();
|
|
|
- query.setUserId(param.getUserId());
|
|
|
- query.setCompanyId(companyId);
|
|
|
- List<FsUserCompanyUser> rel = fsUserCompanyUserService.selectFsUserCompanyUserList(query);
|
|
|
- allowed = rel != null && !rel.isEmpty();
|
|
|
- }
|
|
|
- if (!allowed) {
|
|
|
- return AjaxResult.error("无权限操作该用户");
|
|
|
- }
|
|
|
FsUser update = new FsUser();
|
|
|
update.setUserId(param.getUserId());
|
|
|
update.setRedStatus(param.getRedStatus());
|