diff --git a/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/MemberBasicInfoController.java b/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/MemberBasicInfoController.java index 24188560d..0b696f331 100644 --- a/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/MemberBasicInfoController.java +++ b/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/MemberBasicInfoController.java @@ -22,6 +22,7 @@ import com.jsowell.pile.service.IMemberBasicInfoService; import com.jsowell.pile.service.IMemberPlateNumberRelationService; import com.jsowell.pile.service.IMemberTransactionRecordService; import com.jsowell.pile.util.UserUtils; +import com.jsowell.pile.vo.base.LoginUserDetailVO; import com.jsowell.pile.vo.base.MerchantInfoVO; import com.jsowell.pile.vo.uniapp.MemberVO; import com.jsowell.pile.vo.uniapp.MemberWalletLogVO; @@ -77,6 +78,8 @@ public class MemberBasicInfoController extends BaseController { // List list = memberBasicInfoService.getMerchantListByAuth(deptIds); // List list = memberBasicInfoService.getMerchantListByAuth(); List list = UserUtils.getMerchantListByAuth(); + LoginUserDetailVO loginUserDetail = UserUtils.getLoginUserDetail(); + logger.info("获取登录用户信息:{}", JSON.toJSONString(loginUserDetail)); if (CollectionUtils.isEmpty(list)) { list = new ArrayList<>(); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/util/UserUtils.java b/jsowell-pile/src/main/java/com/jsowell/pile/util/UserUtils.java index 17727d482..9c49d2973 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/util/UserUtils.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/util/UserUtils.java @@ -161,18 +161,18 @@ public class UserUtils { String deptId = String.valueOf(dept.getDeptId()); List merchantInfoVOList = Lists.newArrayList(); List firstMerchantIdList = Lists.newArrayList(); - if (Constants.ZERO.equals(deptLevel)) { - // 平台级权限 查询所有生效的运营商 + if (Constants.ZERO.equals(deptLevel)) { // 平台级权限 + // 查询所有生效的运营商 merchantInfoVOList = pileMerchantInfoService.selectAll(); // 获取一级运营商id List collect = merchantInfoVOList.stream() - .map(MerchantInfoVO::getMerchantLevel) - .filter("1"::equals) + .filter(x -> Constants.ONE.equals(x.getMerchantLevel())) + .map(MerchantInfoVO::getMerchantId) .collect(Collectors.toList()); firstMerchantIdList.addAll(collect); - } else if (Constants.ONE.equals(deptLevel)) { - // 一级运营商权限 查询该一级运营商下面的所有运营商 + } else if (Constants.ONE.equals(deptLevel)) { // 一级运营商权限 + // 查询该一级运营商下面的所有运营商 PileMerchantInfo merchantInfo = pileMerchantInfoService.queryInfoByDeptId(deptId); if (Objects.nonNull(merchantInfo)) { String firstMerchantId = merchantInfo.getId().toString(); @@ -180,25 +180,38 @@ public class UserUtils { firstMerchantIdList.add(firstMerchantId); merchantInfoVOList = pileMerchantInfoService.selectListByFirstMerchant(firstMerchantId); } - } else if (Constants.TWO.equals(deptLevel)) { - // 二级运营商权限 返回自身运营商 + } else if (Constants.TWO.equals(deptLevel)) { // 二级运营商权限 + // 返回自身运营商 MerchantInfoVO merchantInfoVO = pileMerchantInfoService.queryMerchantInfoVOByDeptId(deptId); if (Objects.nonNull(merchantInfoVO)) { merchantInfoVOList.add(merchantInfoVO); + + // 获取一级运营商id + PileMerchantInfo firstLevelMerchant = pileMerchantInfoService.getFirstLevelMerchantByMerchantId(merchantInfoVO.getMerchantId()); + if (Objects.nonNull(firstLevelMerchant)) { + firstMerchantIdList.add(firstLevelMerchant.getId() + ""); + } } - } else if (Constants.THREE.equals(deptLevel)) { - // 站点权限 返回自身运营商 + } else if (Constants.THREE.equals(deptLevel)) { // 站点权限 + // 返回站点所属运营商 PileStationInfo stationInfo = pileStationInfoService.queryInfoByDeptId(deptId); if (Objects.nonNull(stationInfo)) { - MerchantInfoVO merchantInfoVO = pileMerchantInfoService.getMerchantInfoVO(stationInfo.getMerchantId() + ""); + String merchantId = stationInfo.getMerchantId() + ""; + // 查询站点所属运营商 + MerchantInfoVO merchantInfoVO = pileMerchantInfoService.getMerchantInfoVO(merchantId); if (Objects.nonNull(merchantInfoVO)) { merchantInfoVOList.add(merchantInfoVO); } + + // 获取一级运营商id + PileMerchantInfo firstLevelMerchant = pileMerchantInfoService.getFirstLevelMerchantByMerchantId(merchantId); + if (Objects.nonNull(firstLevelMerchant)) { + firstMerchantIdList.add(firstLevelMerchant.getId() + ""); + } } } resultVO.setMerchantInfoVOList(merchantInfoVOList); - - - return null; + resultVO.setFirstMerchantIdList(firstMerchantIdList); + return resultVO; } } \ No newline at end of file