fix:门店账户分页接口新增字段;打标接口完善

This commit is contained in:
wangff
2025-11-26 10:11:08 +08:00
parent ec43537f66
commit e079a8b83c
9 changed files with 216 additions and 10 deletions

View File

@@ -149,7 +149,7 @@ public interface WalletService {
* @param request 批量查询账户信息Request
* @return 账户信息VO列表
*/
PageInfo<AccountInfoDTO> getAllAccountList(CoolAccountBatchQueryRequest request);
PageInfo<AccountPageVO> getAllAccountList(CoolAccountBatchQueryRequest request);
/**
* 批量查询账户交易流水

View File

@@ -1,5 +1,7 @@
package com.cool.store.service.wallet.impl;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollStreamUtil;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.CommonConstants;
@@ -213,8 +215,8 @@ public class WalletServiceImpl implements WalletService {
private void executeAddTag(AccountAddTagRequest tagRequest) {
AddTagDTO addTagDTO = walletApiService.addTag(tagRequest);
log.info("打标接口调用成功response:{}", JSONObject.toJSONString(addTagDTO));
// TODO: 如果网商创建失败,缓存标记
if (false) {
// 如果网商创建失败,缓存标记
if (CommonConstants.INDEX_TWO.equals(addTagDTO.getWsStatus())) {
redisUtilPool.setString(MessageFormat.format(RedisConstant.WALLET_ONLINE_BANK_TAG_FAIL, tagRequest.getOutStoreId()), "1");
} else {
// 网商创建成功,记录已激活状态
@@ -457,10 +459,26 @@ public class WalletServiceImpl implements WalletService {
}
@Override
public PageInfo<AccountInfoDTO> getAllAccountList(CoolAccountBatchQueryRequest request) {
public PageInfo<AccountPageVO> getAllAccountList(CoolAccountBatchQueryRequest request) {
AccountBatchQueryRequest accountBatchQueryRequest = request.convertToAccountBatchQueryRequest();
AccountPageDTO accountList = walletApiService.getAccountList(accountBatchQueryRequest);
return toPageInfo(accountList.getPageData(), AccountInfoDTO.class, accountList.getPage());
List<AccountPageVO> list = BeanUtil.toList(accountList.getPageData(), AccountPageVO.class, CopyOptions.create().setFieldMapping(Collections.singletonMap("outStoreId", "storeId")));
PageInfo<AccountPageVO> page = toPageInfo(list, AccountPageVO.class, accountList.getPage());
List<String> storeIds = CollStreamUtil.toList(page.getList(), AccountPageVO::getStoreId);
Map<String, String> storeNameMap = getStoreNameMap(storeIds);
page.getList().forEach(v -> v.setStoreName(storeNameMap.get(v.getStoreId())));
return page;
}
private Map<String, String> getStoreNameMap(List<String> storeIds) {
Map<String, String> storeNameMap = new HashMap<>();
List<StoreDO> stores = storeDao.getEffectiveStoreByStoreIds(storeIds);
Map<String, String> storeMap = CollStreamUtil.toMap(stores, StoreDO::getStoreId, StoreDO::getStoreName);
storeNameMap.putAll(storeMap);
List<ShopInfoDO> shops = shopInfoDAO.getShopInfoByStoreIds(storeIds);
Map<String, String> shopMap = CollStreamUtil.toMap(shops, ShopInfoDO::getStoreId, ShopInfoDO::getShopName);
storeNameMap.putAll(shopMap);
return storeNameMap;
}
@Override