|
@@ -74,18 +74,17 @@ public class KwpBizWalletService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//查询当前登录企业
|
|
//查询当前登录企业
|
|
|
- EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(LoginUserHolder.getEntId());
|
|
|
|
|
- if (entCacheResDto == null) {
|
|
|
|
|
|
|
+ EntTypeResDto entTypeResDto = remoteSystemService.queryEntTypeById(LoginUserHolder.getEntId());
|
|
|
|
|
+ if (entTypeResDto == null) {
|
|
|
throw new RuntimeException("entId:" + LoginUserHolder.getEntId() + ", 企业信息不存在!");
|
|
throw new RuntimeException("entId:" + LoginUserHolder.getEntId() + ", 企业信息不存在!");
|
|
|
}
|
|
}
|
|
|
List<KwpBizWalletPageResponse> walletList = new ArrayList<>();
|
|
List<KwpBizWalletPageResponse> walletList = new ArrayList<>();
|
|
|
- int entType = Integer.parseInt(entCacheResDto.getEntTypes());
|
|
|
|
|
- if (entType == EntTypeEnum.SUPPLIER.getCode()) {
|
|
|
|
|
|
|
+ if (entTypeResDto.getType() == EntTypeEnum.SUPPLIER.getCode()) {
|
|
|
//供应商及子企业
|
|
//供应商及子企业
|
|
|
- walletList = querySupWallet(entCacheResDto);
|
|
|
|
|
- } else if (entType == EntTypeEnum.PURCHASER.getCode()) {
|
|
|
|
|
|
|
+ walletList = querySupWallet(entTypeResDto);
|
|
|
|
|
+ } else if (entTypeResDto.getType() == EntTypeEnum.PURCHASER.getCode()) {
|
|
|
//采购商企业
|
|
//采购商企业
|
|
|
- walletList = queryProWallet(entCacheResDto.getId());
|
|
|
|
|
|
|
+ walletList = queryProWallet(entTypeResDto.getEntId());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//模糊查询过滤
|
|
//模糊查询过滤
|
|
@@ -104,16 +103,16 @@ public class KwpBizWalletService {
|
|
|
/**
|
|
/**
|
|
|
* 查询供应商企业钱包信息
|
|
* 查询供应商企业钱包信息
|
|
|
*
|
|
*
|
|
|
- * @param entCacheResDto
|
|
|
|
|
|
|
+ * @param entTypeResDto
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- private List<KwpBizWalletPageResponse> querySupWallet(EntCacheResDto entCacheResDto) {
|
|
|
|
|
|
|
+ private List<KwpBizWalletPageResponse> querySupWallet(EntTypeResDto entTypeResDto) {
|
|
|
List<Long> entIds = new ArrayList<>();
|
|
List<Long> entIds = new ArrayList<>();
|
|
|
- entIds.add(entCacheResDto.getId());
|
|
|
|
|
|
|
+ entIds.add(entTypeResDto.getEntId());
|
|
|
//查询供应商的子级企业
|
|
//查询供应商的子级企业
|
|
|
- List<KwsEntDeptDto> kwsEntDeptDtoList = remoteSystemService.queryEntDeptByPid(entCacheResDto.getParentId());
|
|
|
|
|
- List<Long> parentId = kwsEntDeptDtoList.stream().map(KwsEntDeptDto::getEntId).collect(Collectors.toList());
|
|
|
|
|
- entIds.addAll(parentId);
|
|
|
|
|
|
|
+ List<KwsEntDeptDto> kwsEntDeptDtoList = remoteSystemService.queryEntDeptByPid(entTypeResDto.getEntId());
|
|
|
|
|
+ List<Long> subEntId = kwsEntDeptDtoList.stream().map(KwsEntDeptDto::getEntId).collect(Collectors.toList());
|
|
|
|
|
+ entIds.addAll(subEntId);
|
|
|
|
|
|
|
|
//查询供应企业所关联的钱包数据
|
|
//查询供应企业所关联的钱包数据
|
|
|
LambdaQueryWrapper<KwpBizWallet> queryWrapper = Wrappers.<KwpBizWallet>lambdaQuery()
|
|
LambdaQueryWrapper<KwpBizWallet> queryWrapper = Wrappers.<KwpBizWallet>lambdaQuery()
|