diff --git a/jsowell-admin/src/main/java/com/jsowell/service/PileService.java b/jsowell-admin/src/main/java/com/jsowell/service/PileService.java index 6cc2c0f96..3da853897 100644 --- a/jsowell-admin/src/main/java/com/jsowell/service/PileService.java +++ b/jsowell-admin/src/main/java/com/jsowell/service/PileService.java @@ -210,7 +210,7 @@ public class PileService { CompletableFuture> billingPriceFuture = CompletableFuture.supplyAsync(() -> pileBillingTemplateService.queryBillingPrice(pileInfoVO.getStationId())); // 查询运营商信息 - CompletableFuture merchantInfoVOFuture = CompletableFuture.supplyAsync(() -> pileMerchantInfoService.getMerchantInfo(pileInfoVO.getMerchantId())); + CompletableFuture merchantInfoVOFuture = CompletableFuture.supplyAsync(() -> pileMerchantInfoService.getMerchantInfoVO(pileInfoVO.getMerchantId())); CompletableFuture all = CompletableFuture.allOf(connectorInfoListFuture, merchantInfoVOFuture, billingPriceFuture); // .join()和.get()都会阻塞并获取线程的执行情况 diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/IPileMerchantInfoService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/IPileMerchantInfoService.java index a9abebfff..39be4910b 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/IPileMerchantInfoService.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/IPileMerchantInfoService.java @@ -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 diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/MemberBasicInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/MemberBasicInfoServiceImpl.java index d6262183c..289fb17d1 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/MemberBasicInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/MemberBasicInfoServiceImpl.java @@ -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; } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBasicInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBasicInfoServiceImpl.java index f2eeddf97..e18d560d7 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBasicInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBasicInfoServiceImpl.java @@ -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()); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileMerchantInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileMerchantInfoServiceImpl.java index ce7e2a774..0352eee02 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileMerchantInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileMerchantInfoServiceImpl.java @@ -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 diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java index b930b684d..ef608ec96 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java @@ -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()), diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/service/impl/LianLianServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/service/impl/LianLianServiceImpl.java index 07bc316de..6ad604458 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/service/impl/LianLianServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/service/impl/LianLianServiceImpl.java @@ -24,7 +24,6 @@ import com.jsowell.common.util.JWTUtils; import com.jsowell.common.util.PageUtils; import com.jsowell.common.util.StringUtils; import com.jsowell.pile.domain.*; -import com.jsowell.pile.domain.ykcCommond.IssueQRCodeCommand; import com.jsowell.pile.domain.ykcCommond.StartChargingCommand; import com.jsowell.pile.domain.ykcCommond.StopChargingCommand; import com.jsowell.pile.dto.*; @@ -48,7 +47,6 @@ import com.jsowell.thirdparty.lianlian.vo.*; import com.jsowell.thirdparty.yongchengboche.dto.YCBCGetTokenDTO; import com.jsowell.thirdparty.yongchengboche.service.YCBCService; import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.lang3.RandomStringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -111,7 +109,7 @@ public class LianLianServiceImpl implements LianLianService { @Override public void pushMerchantInfo(Long merchantId) { // 通过id查询运营商信息 - MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfo(String.valueOf(merchantId)); + MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfoVO(String.valueOf(merchantId)); // 组装联联平台所需要的数据格式 OperatorInfo operatorInfo = OperatorInfo.builder() .OperatorID(Constants.OPERATORID_LIANLIAN) // 组织机构代码 diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/zhongdianlian/service/impl/ZDLServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/zhongdianlian/service/impl/ZDLServiceImpl.java index 5f8ed7f38..1ec4bbfbf 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/zhongdianlian/service/impl/ZDLServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/zhongdianlian/service/impl/ZDLServiceImpl.java @@ -135,7 +135,7 @@ public class ZDLServiceImpl implements ZDLService { .build(); // 截取运营商组织机构代码(去除最后一位后的最后九位) - MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfo(String.valueOf(pileStationInfo.getMerchantId())); + MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfoVO(String.valueOf(pileStationInfo.getMerchantId())); String organizationCode = merchantInfo.getOrganizationCode(); if (organizationCode.length() == 18) { String equipmentOwnerId = StringUtils.substring(organizationCode, organizationCode.length() - 10, organizationCode.length() - 1);