updateupdate 查询运营商列表

This commit is contained in:
2023-11-10 17:20:16 +08:00
parent 84b93e9a3c
commit 9e2f933082
8 changed files with 32 additions and 11 deletions

View File

@@ -76,7 +76,7 @@ public interface IPileMerchantInfoService {
*/
String getFirstLevelMerchantIdByAppId(String appId);
MerchantInfoVO getMerchantInfo(String merchantId);
MerchantInfoVO getMerchantInfoVO(String merchantId);
/**
* 根据运营商部门ids 查询所有站点id
@@ -87,6 +87,8 @@ public interface IPileMerchantInfoService {
PileMerchantInfo queryInfoByDeptId(String deptId);
MerchantInfoVO queryMerchantInfoVOByDeptId(String deptId);
/**
* 通过ids查询信息列表
* @param dto

View File

@@ -453,17 +453,29 @@ public class MemberBasicInfoServiceImpl implements IMemberBasicInfoService {
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(String.valueOf(dept.getDeptId()));
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;
}

View File

@@ -422,7 +422,7 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService {
.merchantId(String.valueOf(basicInfo.getMerchantId()))
.build();
// 查站点信息
MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfo(String.valueOf(basicInfo.getMerchantId()));
MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfoVO(String.valueOf(basicInfo.getMerchantId()));
if (merchantInfo != null) {
pileInfoVO.setMerchantName(merchantInfo.getMerchantName());
}

View File

@@ -307,7 +307,7 @@ public class PileMerchantInfoServiceImpl implements IPileMerchantInfoService {
}
@Override
public MerchantInfoVO getMerchantInfo(String merchantId) {
public MerchantInfoVO getMerchantInfoVO(String merchantId) {
PileMerchantInfo pileMerchantInfo = selectPileMerchantInfoById(Long.parseLong(merchantId));
if (pileMerchantInfo == null) {
return null;
@@ -351,6 +351,15 @@ public class PileMerchantInfoServiceImpl implements IPileMerchantInfoService {
return pileMerchantInfoMapper.queryInfoByDeptId(deptId);
}
@Override
public MerchantInfoVO queryMerchantInfoVOByDeptId(String deptId) {
PileMerchantInfo merchantInfo = queryInfoByDeptId(deptId);
if (Objects.isNull(merchantInfo)) {
return null;
}
return conversion2MerchantInfoVO(merchantInfo);
}
/**
* 通过ids查询信息列表
* @param dto

View File

@@ -251,7 +251,7 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
@Override
@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
public int fastCreateStation(FastCreateStationDTO dto) {
MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfo(dto.getMerchantId());
MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfoVO(dto.getMerchantId());
if (merchantInfo == null) {
return 0;
}
@@ -345,7 +345,7 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
/*
修改组织部门
*/
MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfo(newMerchantId);
MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfoVO(newMerchantId);
if (merchantInfo != null) {
// 创建一个新的站点对应部门
SysDept dept = sysDeptService.createStationDept(Long.valueOf(merchantInfo.getDeptId()),