This commit is contained in:
Guoqs
2024-07-01 11:06:43 +08:00
parent 485eb4b3ad
commit be48eb217b
3 changed files with 23 additions and 11 deletions

View File

@@ -42,8 +42,8 @@ public class PileMerchantInfoController extends BaseController {
@PreAuthorize("@ss.hasPermi('pile:merchant:list')")
@GetMapping("/list")
public TableDataInfo list(PileMerchantInfo pileMerchantInfo) {
// startPage();
List<PileMerchantInfo> list = pileMerchantInfoService.selectPileMerchantInfoListWithAuth(pileMerchantInfo);
startPage();
List<PileMerchantInfo> list = pileMerchantInfoService.pagePileMerchantInfoListWithAuth(pileMerchantInfo);
return getDataTable(list);
}
@@ -65,9 +65,9 @@ public class PileMerchantInfoController extends BaseController {
*/
// @PreAuthorize("@ss.hasPermi('pile:merchant:list')")
@GetMapping("/getMerchantList")
public TableDataInfo getMerchantList(PileMerchantInfo pileMerchantInfo) {
public AjaxResult getMerchantList(PileMerchantInfo pileMerchantInfo) {
List<PileMerchantInfo> list = pileMerchantInfoService.selectPileMerchantInfoListWithAuth(pileMerchantInfo);
return getDataTable(list);
return AjaxResult.success(list);
}
/**

View File

@@ -34,7 +34,9 @@ public interface PileMerchantInfoService {
*/
List<PileMerchantInfo> selectPileMerchantInfoListWithAuth(PileMerchantInfo pileMerchantInfo);
List<PileMerchantInfo> selectPileMerchantInfoList(PileMerchantInfo pileMerchantInfo);
List<PileMerchantInfo> pagePileMerchantInfoListWithAuth(PileMerchantInfo pileMerchantInfo);
List<PileMerchantInfo> selectPileMerchantInfoList(PileMerchantInfo pileMerchantInfo);
List<PileMerchantInfo> selectPileMerchantInfoListByIdList(List<String> merchantIdList);

View File

@@ -78,13 +78,23 @@ public class PileMerchantInfoServiceImpl implements PileMerchantInfoService {
*/
@Override
public List<PileMerchantInfo> selectPileMerchantInfoListWithAuth(PileMerchantInfo pileMerchantInfo) {
// AuthorizedDeptVO authorizedMap = UserUtils.getAuthorizedMap();
// if (authorizedMap == null) {
// // 为空表示没有权限,返回空数组
// return Lists.newArrayList();
// }
// pileMerchantInfo.setStationDeptIds(authorizedMap.getStationDeptIds());
// 当前登录用户的运营商权限列表
List<MerchantInfoVO> list = UserUtils.getMerchantInfoVOList();
if (CollectionUtils.isNotEmpty(list)) {
List<String> collect = list.stream().map(MerchantInfoVO::getDeptId).collect(Collectors.toList());
pileMerchantInfo.setMerchantDeptIds(collect);
}
return selectPileMerchantInfoList(pileMerchantInfo);
}
/**
* 分页查询充电桩运营商信息列表
* 带权限校验
* @param pileMerchantInfo 充电桩运营商信息
* @return 充电桩运营商信息
*/
@Override
public List<PileMerchantInfo> pagePileMerchantInfoListWithAuth(PileMerchantInfo pileMerchantInfo) {
// 当前登录用户的运营商权限列表
List<MerchantInfoVO> list = UserUtils.getMerchantInfoVOList();
if (CollectionUtils.isNotEmpty(list)) {