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

@@ -235,4 +235,5 @@ public class CommonConstants {
public static final Integer INDEX_ZERO = 0;
public static final Integer INDEX_ONE = 1;
public static final Integer INDEX_TWO = 2;
}

View File

@@ -31,10 +31,7 @@ import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.*;
import java.util.stream.Collectors;
/**
@@ -79,6 +76,17 @@ public class ShopInfoDAO {
return shopInfoMapper.selectOne(shopInfoDO);
}
public List<ShopInfoDO> getShopInfoByStoreIds(List<String> storeIds) {
if (CollectionUtils.isEmpty(storeIds)) {
return Collections.emptyList();
}
Example example = new Example(ShopInfoDO.class);
example.createCriteria()
.andIn("storeId", storeIds)
.andEqualTo("deleted", false);
return shopInfoMapper.selectByExample(example);
}
public List<ShopInfoDO> getShopList(Long lineId){
if(Objects.isNull(lineId)){
return new ArrayList<>();

View File

@@ -80,4 +80,7 @@ public class AccountInfoDTO {
@ApiModelProperty("失败原因(仅网商在创建失败或激活失败时返回)")
private String errMsg;
@ApiModelProperty("crm门店id")
private String outStoreId;
}

View File

@@ -1,6 +1,7 @@
package com.cool.store.dto.wallet;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
@@ -16,4 +17,6 @@ public class AddTagDTO {
private Integer addTagType;
@ApiModelProperty("网商状态1.打标成功 2.打标失败 3.处理中")
private Integer wsStatus;
}

View File

@@ -0,0 +1,89 @@
package com.cool.store.vo.wallet;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 门店签约人账户
* @Author suzhuhong
* @Date 2025/11/13 16:54
* @Version 1.0
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class AccountPageVO {
@ApiModelProperty(value = "结算卡业务类型 枚举值1对公 2对私", required = true)
private Integer accountType;
@ApiModelProperty(value = "营业执照号码")
private String licenseNo;
@ApiModelProperty(value = "工商注册名称")
private String licenseName;
@ApiModelProperty(value = "法人姓名")
private String legalName;
@ApiModelProperty(value = "法人证件号码")
private String legalNo;
@ApiModelProperty(value = "法人联系电话")
private String legalPhone;
@ApiModelProperty(value = "门店编号", required = true)
private String storeSn;
@ApiModelProperty(value = "账户编号", required = true)
private String accountNo;
@ApiModelProperty(value = "账户名称", required = true)
private String accountName;
@ApiModelProperty(value = "账户别名", required = true)
private String accountAliasName;
@ApiModelProperty(value = "结算银行卡号", required = true)
private String accountCardNo;
@ApiModelProperty(value = "结算卡银行预留手机号", required = true)
private String accountPhone;
@ApiModelProperty(value = "开户支行名称", required = true)
private String bankName;
@ApiModelProperty(value = "支行编号", required = true)
private String bankNo;
@ApiModelProperty(value = "总行名称")
private String headBankName;
@ApiModelProperty(value = "账户状态 1:待提交 2:待鉴权 3:鉴权中 4:开通 5:开通失败", required = true)
private Integer accountStatus;
@ApiModelProperty(value = "账户余额", required = true)
private String totalAmount;
@ApiModelProperty(value = "打标状态 0 未打标 1 已打标", required = true)
private Integer labelingStatus;
@ApiModelProperty(value = "是否签约人账户 0 否 1 是", required = true)
private Integer isLegal;
@ApiModelProperty("工商类型 1.企业 2.个体工商户 3.小微商户(自然人)")
private Integer businessType;
@ApiModelProperty("钱包类型 1平安 2网商")
private Integer walletType;
@ApiModelProperty("失败原因(仅网商在创建失败或激活失败时返回)")
private String errMsg;
@ApiModelProperty("crm门店id")
private String storeId;
@ApiModelProperty("门店名称")
private String storeName;
}

View File

@@ -0,0 +1,83 @@
package com.cool.store.vo.wallet;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 门店签约人账户
* @Author suzhuhong
* @Date 2025/11/13 16:54
* @Version 1.0
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class AllAccountInfoVO {
@ApiModelProperty(value = "结算卡业务类型 枚举值1对公 2对私", required = true)
private Integer accountType;
@ApiModelProperty(value = "营业执照号码")
private String licenseNo;
@ApiModelProperty(value = "工商注册名称")
private String licenseName;
@ApiModelProperty(value = "法人姓名")
private String legalName;
@ApiModelProperty(value = "法人证件号码")
private String legalNo;
@ApiModelProperty(value = "法人联系电话")
private String legalPhone;
@ApiModelProperty(value = "门店编号", required = true)
private String storeSn;
@ApiModelProperty(value = "账户编号", required = true)
private String accountNo;
@ApiModelProperty(value = "账户名称", required = true)
private String accountName;
@ApiModelProperty(value = "账户别名", required = true)
private String accountAliasName;
@ApiModelProperty(value = "结算银行卡号", required = true)
private String accountCardNo;
@ApiModelProperty(value = "结算卡银行预留手机号", required = true)
private String accountPhone;
@ApiModelProperty(value = "开户支行名称", required = true)
private String bankName;
@ApiModelProperty(value = "支行编号", required = true)
private String bankNo;
@ApiModelProperty(value = "总行名称")
private String headBankName;
@ApiModelProperty(value = "账户状态 1:待提交 2:待鉴权 3:鉴权中 4:开通 5:开通失败", required = true)
private Integer accountStatus;
@ApiModelProperty(value = "账户余额", required = true)
private String totalAmount;
@ApiModelProperty(value = "打标状态 0 未打标 1 已打标", required = true)
private Integer labelingStatus;
@ApiModelProperty(value = "是否签约人账户 0 否 1 是", required = true)
private Integer isLegal;
@ApiModelProperty("工商类型 1.企业 2.个体工商户 3.小微商户(自然人)")
private Integer businessType;
@ApiModelProperty("钱包类型 1平安 2网商")
private Integer walletType;
@ApiModelProperty("失败原因(仅网商在创建失败或激活失败时返回)")
private String errMsg;
}

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

View File

@@ -8,6 +8,7 @@ import com.cool.store.response.ResponseResult;
import com.cool.store.service.wallet.WalletService;
import com.cool.store.vo.wallet.AccountBillPageVO;
import com.cool.store.vo.wallet.AccountInfoVO;
import com.cool.store.vo.wallet.AccountPageVO;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -46,7 +47,7 @@ public class WalletController {
@ApiOperation("分页查询所有门店账户列表 支持条件查询")
@PostMapping("/getAllAccountList")
public ResponseResult<PageInfo<AccountInfoDTO>> getAllAccountList(@RequestBody CoolAccountBatchQueryRequest request) {
public ResponseResult<PageInfo<AccountPageVO>> getAllAccountList(@RequestBody CoolAccountBatchQueryRequest request) {
return ResponseResult.success(walletService.getAllAccountList(request));
}