|
|
@@ -1,5 +1,7 @@
|
|
|
package com.crm.manager.controller;
|
|
|
|
|
|
+import com.crm.login.rely.backend.controller.BaseLoginController;
|
|
|
+import com.crm.manager.service.MerchantRoleService;
|
|
|
import com.crm.manager.service.UserRoleService;
|
|
|
import com.crm.rely.backend.core.constant.Constants;
|
|
|
import com.crm.rely.backend.core.constant.ManagerConstant;
|
|
|
@@ -16,6 +18,8 @@ import com.crm.rely.backend.core.entity.user.role.UserRoleSearchEntity;
|
|
|
import com.crm.rely.backend.core.entity.user.role.UserRoleUpdateEntity;
|
|
|
import com.crm.rely.backend.exception.ControllerException;
|
|
|
import com.crm.rely.backend.util.DateUtil;
|
|
|
+import com.crm.rely.backend.util.HttpServletRequestUtil;
|
|
|
+import org.apache.catalina.servlet4preview.http.HttpServletRequest;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
@@ -30,11 +34,14 @@ import java.util.List;
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping("/user/role")
|
|
|
-public class UserRoleController {
|
|
|
+public class UserRoleController extends BaseLoginController {
|
|
|
|
|
|
@Autowired
|
|
|
private UserRoleService roleInfoService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private MerchantRoleService merchantRoleService;
|
|
|
+
|
|
|
/**
|
|
|
* 添加角色
|
|
|
*
|
|
|
@@ -58,7 +65,11 @@ public class UserRoleController {
|
|
|
|
|
|
@PostMapping("/add/detail/list")
|
|
|
public BaseResultDto<List<UserNodeDisplayDto>> getDetailList() throws Exception {
|
|
|
-
|
|
|
+ InfoEntity infoEntity = HttpServletRequestUtil.getLoginInfo(InfoEntity.class, httpServletRequest, redisService
|
|
|
+ , true);
|
|
|
+ if(infoEntity.getIbInfo().getMerchantId() != null && infoEntity.getIbInfo().getIsMerchantAdmin().equals(1)){
|
|
|
+ return BaseResultDto.success(merchantRoleService.merchantDetailList(infoEntity.getIbInfo().getMerchantId()));
|
|
|
+ }
|
|
|
List<UserNodeDisplayDto> userNodeDisplayEntities = roleInfoService.getUserNodeDisplay(-1L);
|
|
|
|
|
|
return BaseResultDto.success(userNodeDisplayEntities);
|