update 查询所属运营商,带权限校验

This commit is contained in:
Guoqs
2024-06-13 15:44:46 +08:00
parent fe87fa038c
commit 53d83bf1af
6 changed files with 46 additions and 4 deletions

View File

@@ -25,6 +25,13 @@ public interface PileMerchantInfoMapper {
*/
public PileMerchantInfo selectPileMerchantInfoById(Long id);
/**
* 查询运营商列表
* @param merchantIdList
* @return
*/
List<PileMerchantInfo> selectPileMerchantInfoListByIdList(@Param("merchantIdList") List<String> merchantIdList);
/**
* 通过appid查询充电桩运营商信息
* @param appId
@@ -127,4 +134,5 @@ public interface PileMerchantInfoMapper {
* @return
*/
PileMerchantInfoVO queryMerchantInfoByStationId(String stationId);
}

View File

@@ -36,6 +36,8 @@ public interface PileMerchantInfoService {
List<PileMerchantInfo> selectPileMerchantInfoList(PileMerchantInfo pileMerchantInfo);
List<PileMerchantInfo> selectPileMerchantInfoListByIdList(List<String> merchantIdList);
/**
* 新增充电桩运营商信息
*
@@ -72,11 +74,16 @@ public interface PileMerchantInfoService {
/**
* 通过微信小程序appId查询一级运营商merchantId
* @param appId 微信小程序appId
* @param wechatAppId 微信小程序appId
* @return 一级运营商merchantId
*/
String getFirstLevelMerchantIdByWxAppId(String wechatAppId);
/**
* 通过支付宝小程序appId查询一级运营商merchantId
* @param alipayAppId 微信小程序appId
* @return 一级运营商merchantId
*/
String getFirstLevelMerchantIdByAliAppId(String alipayAppId);
MerchantInfoVO getMerchantInfoVO(String merchantId);

View File

@@ -32,6 +32,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
/**
* 充电桩运营商信息Service业务层处理
@@ -81,7 +82,13 @@ public class PileMerchantInfoServiceImpl implements PileMerchantInfoService {
return Lists.newArrayList();
}
pileMerchantInfo.setStationDeptIds(authorizedMap.getStationDeptIds());
pileMerchantInfo.setMerchantDeptIds(authorizedMap.getMerchantDeptIds());
// 当前登录用户的运营商权限列表
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);
}
@@ -104,6 +111,11 @@ public class PileMerchantInfoServiceImpl implements PileMerchantInfoService {
return list;
}
@Override
public List<PileMerchantInfo> selectPileMerchantInfoListByIdList(List<String> merchantIdList) {
return pileMerchantInfoMapper.selectPileMerchantInfoListByIdList(merchantIdList);
}
/**
* 新增充电桩运营商信息
*