mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-06 02:50:13 +08:00
Revert "update"
This reverts commit 71be841f4d65a63a61059bb45bbc6e6f4bb35b42.
This commit is contained in:
@@ -108,9 +108,9 @@ public class MemberBasicInfoController extends BaseController {
|
|||||||
@GetMapping("/getMerchantListByAuth")
|
@GetMapping("/getMerchantListByAuth")
|
||||||
public RestApiResponse<?> getMerchantListByAuth() {
|
public RestApiResponse<?> getMerchantListByAuth() {
|
||||||
RestApiResponse<?> response = null;
|
RestApiResponse<?> response = null;
|
||||||
// LoginUserDetailVO loginUserDetail = UserUtils.getLoginUserDetail();
|
LoginUserDetailVO loginUserDetail = UserUtils.getLoginUserDetail();
|
||||||
// logger.info("获取登录用户信息:{}", JSON.toJSONString(loginUserDetail));
|
logger.info("获取登录用户信息:{}", JSON.toJSONString(loginUserDetail));
|
||||||
List<MerchantInfoVO> list = UserUtils.getMerchantInfoVOList();
|
List<MerchantInfoVO> list = loginUserDetail.getMerchantInfoVOList();
|
||||||
if (CollectionUtils.isEmpty(list)) {
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
list = new ArrayList<>();
|
list = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,9 +41,9 @@ public class MemberGroupController extends BaseController {
|
|||||||
@PreAuthorize("@ss.hasPermi('member:memberGroup:list')")
|
@PreAuthorize("@ss.hasPermi('member:memberGroup:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(MemberGroupDTO memberGroup) {
|
public TableDataInfo list(MemberGroupDTO memberGroup) {
|
||||||
// LoginUserDetailVO loginUserDetail = UserUtils.getLoginUserDetail();
|
LoginUserDetailVO loginUserDetail = UserUtils.getLoginUserDetail();
|
||||||
// logger.info("获取登录用户信息:{}", JSON.toJSONString(loginUserDetail));
|
logger.info("获取登录用户信息:{}", JSON.toJSONString(loginUserDetail));
|
||||||
List<MerchantInfoVO> merchantInfoVOList = UserUtils.getMerchantInfoVOList();
|
List<MerchantInfoVO> merchantInfoVOList = loginUserDetail.getMerchantInfoVOList();
|
||||||
List<String> collect = merchantInfoVOList.stream().map(MerchantInfoVO::getMerchantId).collect(Collectors.toList());
|
List<String> collect = merchantInfoVOList.stream().map(MerchantInfoVO::getMerchantId).collect(Collectors.toList());
|
||||||
memberGroup.setMerchantIdList(collect);
|
memberGroup.setMerchantIdList(collect);
|
||||||
startPage();
|
startPage();
|
||||||
|
|||||||
@@ -242,8 +242,8 @@ public class MemberBasicInfoServiceImpl implements MemberBasicInfoService {
|
|||||||
|
|
||||||
// 来自后管的充值,校验权限
|
// 来自后管的充值,校验权限
|
||||||
if (StringUtils.equals(dto.getFromWeb(), Constants.ONE)) {
|
if (StringUtils.equals(dto.getFromWeb(), Constants.ONE)) {
|
||||||
// LoginUserDetailVO loginUserDetail = UserUtils.getLoginUserDetail();
|
LoginUserDetailVO loginUserDetail = UserUtils.getLoginUserDetail();
|
||||||
List<MerchantInfoVO> merchantInfoVOList = UserUtils.getMerchantInfoVOList();
|
List<MerchantInfoVO> merchantInfoVOList = loginUserDetail.getMerchantInfoVOList();
|
||||||
List<String> collect = merchantInfoVOList.stream().map(MerchantInfoVO::getMerchantId).collect(Collectors.toList());
|
List<String> collect = merchantInfoVOList.stream().map(MerchantInfoVO::getMerchantId).collect(Collectors.toList());
|
||||||
if (!collect.contains(targetMerchantId)) {
|
if (!collect.contains(targetMerchantId)) {
|
||||||
throw new BusinessException(ReturnCodeEnum.CODE_PERMISSION_DENIED);
|
throw new BusinessException(ReturnCodeEnum.CODE_PERMISSION_DENIED);
|
||||||
@@ -520,8 +520,8 @@ public class MemberBasicInfoServiceImpl implements MemberBasicInfoService {
|
|||||||
// dto.setMerchantId(id);
|
// dto.setMerchantId(id);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// LoginUserDetailVO loginUserDetail = UserUtils.getLoginUserDetail();
|
LoginUserDetailVO loginUserDetail = UserUtils.getLoginUserDetail();
|
||||||
List<String> firstMerchantIdList = UserUtils.getFirstMerchantIdList();
|
List<String> firstMerchantIdList = loginUserDetail.getFirstMerchantIdList();
|
||||||
if (CollectionUtils.isNotEmpty(firstMerchantIdList)) {
|
if (CollectionUtils.isNotEmpty(firstMerchantIdList)) {
|
||||||
dto.setFirstMerchantIds(firstMerchantIdList);
|
dto.setFirstMerchantIds(firstMerchantIdList);
|
||||||
}
|
}
|
||||||
@@ -609,8 +609,8 @@ public class MemberBasicInfoServiceImpl implements MemberBasicInfoService {
|
|||||||
@Override
|
@Override
|
||||||
public List<MerchantVipVO> queryMerchantVipList(QueryMemberInfoDTO dto) {
|
public List<MerchantVipVO> queryMerchantVipList(QueryMemberInfoDTO dto) {
|
||||||
// 获取后管登录用户的权限
|
// 获取后管登录用户的权限
|
||||||
// LoginUserDetailVO loginUserDetail = UserUtils.getLoginUserDetail();
|
LoginUserDetailVO loginUserDetail = UserUtils.getLoginUserDetail();
|
||||||
List<MerchantInfoVO> merchantInfoVOList = UserUtils.getMerchantInfoVOList();
|
List<MerchantInfoVO> merchantInfoVOList = loginUserDetail.getMerchantInfoVOList();
|
||||||
List<String> merchantIdList = merchantInfoVOList.stream()
|
List<String> merchantIdList = merchantInfoVOList.stream()
|
||||||
.map(MerchantInfoVO::getMerchantId).collect(Collectors.toList());
|
.map(MerchantInfoVO::getMerchantId).collect(Collectors.toList());
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.jsowell.pile.service.impl;
|
package com.jsowell.pile.service.impl;
|
||||||
|
|
||||||
import com.github.pagehelper.PageInfo;
|
|
||||||
import com.jsowell.common.constant.Constants;
|
import com.jsowell.common.constant.Constants;
|
||||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||||
import com.jsowell.common.exception.BusinessException;
|
import com.jsowell.common.exception.BusinessException;
|
||||||
@@ -90,13 +89,12 @@ public class PileAuthCardServiceImpl implements PileAuthCardService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<PileAuthCardVO> getPileAuthCardInfoList(PileAuthCardDTO dto) {
|
public List<PileAuthCardVO> getPileAuthCardInfoList(PileAuthCardDTO dto) {
|
||||||
// LoginUserDetailVO loginUserDetail = UserUtils.getLoginUserDetail();
|
LoginUserDetailVO loginUserDetail = UserUtils.getLoginUserDetail();
|
||||||
List<MerchantInfoVO> merchantInfoVOList = UserUtils.getMerchantInfoVOList();
|
List<MerchantInfoVO> merchantInfoVOList = loginUserDetail.getMerchantInfoVOList();
|
||||||
List<String> merchantIdList = merchantInfoVOList.stream().map(MerchantInfoVO::getMerchantId).collect(Collectors.toList());
|
List<String> merchantIdList = merchantInfoVOList.stream().map(MerchantInfoVO::getMerchantId).collect(Collectors.toList());
|
||||||
dto.setMerchantIdList(merchantIdList);
|
dto.setMerchantIdList(merchantIdList);
|
||||||
PageUtils.startPage();
|
PageUtils.startPage();
|
||||||
List<PileAuthCardVO> pileAuthCardInfoList = pileAuthCardMapper.getPileAuthCardInfoList(dto);
|
return pileAuthCardMapper.getPileAuthCardInfoList(dto);
|
||||||
return pileAuthCardInfoList;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ import com.jsowell.pile.service.PileStationInfoService;
|
|||||||
import com.jsowell.pile.vo.base.LoginUserDetailVO;
|
import com.jsowell.pile.vo.base.LoginUserDetailVO;
|
||||||
import com.jsowell.pile.vo.base.MerchantInfoVO;
|
import com.jsowell.pile.vo.base.MerchantInfoVO;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@@ -90,7 +89,53 @@ public class UserUtils {
|
|||||||
return resultVO;
|
return resultVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前会员中的运营商列表(带权限校验)
|
||||||
|
*/
|
||||||
|
/*public static List<MerchantInfoVO> getMerchantListByAuth() {
|
||||||
|
List<MerchantInfoVO> resultList = Lists.newArrayList();
|
||||||
|
// 获取登录用户 所有有权限运营商
|
||||||
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
|
if (Objects.isNull(loginUser)) {
|
||||||
|
return resultList;
|
||||||
|
}
|
||||||
|
// 获取登录用户对应的user对象
|
||||||
|
SysUser user = loginUser.getUser();
|
||||||
|
if (Objects.isNull(user)) {
|
||||||
|
return resultList;
|
||||||
|
}
|
||||||
|
// 获取所属部门id
|
||||||
|
SysDept dept = user.getDept();
|
||||||
|
if (Objects.isNull(dept)) {
|
||||||
|
return resultList;
|
||||||
|
}
|
||||||
|
String deptLevel = dept.getDeptLevel();
|
||||||
|
String deptId = String.valueOf(dept.getDeptId());
|
||||||
|
if (Constants.ZERO.equals(deptLevel)) {
|
||||||
|
// 平台级权限 查询所有生效的运营商
|
||||||
|
resultList = pileMerchantInfoService.selectAll();
|
||||||
|
} else if (Constants.ONE.equals(deptLevel)) {
|
||||||
|
// 一级运营商权限 查询该一级运营商下面的所有运营商
|
||||||
|
PileMerchantInfo merchantInfo = pileMerchantInfoService.queryInfoByDeptId(deptId);
|
||||||
|
resultList = pileMerchantInfoService.selectListByFirstMerchant(merchantInfo.getId() + "");
|
||||||
|
} else if (Constants.TWO.equals(deptLevel) ) {
|
||||||
|
// 二级运营商权限 返回自身运营商
|
||||||
|
MerchantInfoVO merchantInfoVO = pileMerchantInfoService.queryMerchantInfoVOByDeptId(deptId);
|
||||||
|
if (Objects.nonNull(merchantInfoVO)) {
|
||||||
|
resultList.add(merchantInfoVO);
|
||||||
|
}
|
||||||
|
} else if (Constants.THREE.equals(deptLevel)) {
|
||||||
|
// 站点权限 返回自身运营商
|
||||||
|
PileStationInfo stationInfo = pileStationInfoService.queryInfoByDeptId(deptId);
|
||||||
|
if (Objects.nonNull(stationInfo)) {
|
||||||
|
MerchantInfoVO merchantInfoVO = pileMerchantInfoService.getMerchantInfoVO(stationInfo.getMerchantId() + "");
|
||||||
|
if (Objects.nonNull(merchantInfoVO)) {
|
||||||
|
resultList.add(merchantInfoVO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return resultList;
|
||||||
|
}*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取登录用户信息
|
* 获取登录用户信息
|
||||||
@@ -176,22 +221,4 @@ public class UserUtils {
|
|||||||
resultVO.setFirstMerchantIdList(firstMerchantIdList);
|
resultVO.setFirstMerchantIdList(firstMerchantIdList);
|
||||||
return resultVO;
|
return resultVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取当前登录用户中有权限的运营商列表
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static List<MerchantInfoVO> getMerchantInfoVOList() {
|
|
||||||
LoginUserDetailVO loginUserDetail = UserUtils.getLoginUserDetail();
|
|
||||||
return loginUserDetail.getMerchantInfoVOList();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取当前登录用户有权限的一级运营商idList
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static List<String> getFirstMerchantIdList() {
|
|
||||||
LoginUserDetailVO loginUserDetail = UserUtils.getLoginUserDetail();
|
|
||||||
return loginUserDetail.getFirstMerchantIdList();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user