Merge #72 into master from cc_20260323_minor_req

fix:钱包线上支付校验使用网商钱包账户;分账信息初始化状态修改

* cc_20260323_minor_req: (7 commits squashed)

  - fix:机会点接口新增筛选条件

  - fix:字段隐藏

  - fix:字段隐藏

  - fix:初始化钱包分账信息状态改为未支付

  - Merge branch 'master' into cc_20260323_minor_req

  - fix:初始化钱包分账信息状态改为未支付

  - fix:钱包线上支付校验使用网商钱包账户

Signed-off-by: 王非凡 <accounts_67eba0c5fee9c49c80c8e2b4@mail.teambition.com>
Merged-by: 正新 <accounts_6964c7bcd2a2c377c5bbd01b@mail.teambition.com>

CR-link: https://codeup.aliyun.com/692ea314dec569489f6f167c/hangzhou/java/custom_zxjp/change/72
This commit is contained in:
王非凡
2026-03-24 09:36:35 +00:00
committed by 正新
parent a13ba2175c
commit 1f3d5a0df7
6 changed files with 14 additions and 12 deletions

View File

@@ -56,7 +56,7 @@ public class ShopAllocationInfoDAO {
}
for (ShopAllocationInfoDO shopAllocationInfoDO : list) {
if (Objects.isNull(shopAllocationInfoDO.getStatus())) {
shopAllocationInfoDO.setStatus(AllocationPayStatusEnum.PAYING.getStatus());
shopAllocationInfoDO.setStatus(AllocationPayStatusEnum.UNPAID.getStatus());
}
}
shopAllocationInfoMapper.insertOrUpdateBatch(list);

View File

@@ -1,5 +1,6 @@
package com.cool.store.dto;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -14,14 +15,13 @@ import lombok.Data;
@Data
public class UserSimpleDTO {
@ApiModelProperty("用户id")
@JsonIgnore
private String userId;
@ApiModelProperty("名称")
private String name;
@ApiModelProperty("手机号")
private String mobile;
@JsonIgnore
private String storeId;
public UserSimpleDTO(String userId, String storeId) {

View File

@@ -34,6 +34,7 @@ public class OpportunityListRequest{
@ApiModelProperty("机会点名称")
private String name;
@ApiModelProperty("机会点优先级过滤:`0` 全部,`3` 高,`2` 中,`1` 低")
private Integer level;
}

View File

@@ -79,7 +79,7 @@ public class ShopAllocationInfoServiceImpl implements ShopAllocationInfoService
v.setShopId(shopId);
v.setCreateUserId(userId);
v.setUpdateUserId(userId);
v.setStatus(AllocationPayStatusEnum.PAYING.getStatus());
v.setStatus(AllocationPayStatusEnum.UNPAID.getStatus());
});
shopAllocationInfoDAO.insertOrUpdateBatch(infoList);
}
@@ -142,7 +142,7 @@ public class ShopAllocationInfoServiceImpl implements ShopAllocationInfoService
.payeeName(Objects.nonNull(allocationCompanyDO) ? allocationCompanyDO.getPayeeName() : null)
.payeeCode(Objects.nonNull(allocationCompanyDO) ? allocationCompanyDO.getPayeeCode() : null)
.amount(Objects.nonNull(standardConfigDO) ? standardConfigDO.getAmount() : BigDecimal.ZERO)
.status(AllocationPayStatusEnum.PAYING.getStatus())
.status(AllocationPayStatusEnum.UNPAID.getStatus())
.build();
})
.collect(Collectors.toList());

View File

@@ -101,13 +101,15 @@ public class WalletPayInfoServiceImpl implements WalletPayInfoService {
throw new ServiceException(ErrorCodeEnum.THE_USER_IS_PAYING);
}
try {
// 使用网商钱包支付
Integer walletType = 2;
// 查询所有费用
List<ShopAllocationInfoDO> list = shopAllocationInfoDAO.getByShopId(request.getShopId());
Map<String, BigDecimal> allocationAmountMap = CollStreamUtil.toMap(list, ShopAllocationInfoDO::getExpenseType, ShopAllocationInfoDO::getAmount);
Map<String, ShopAllocationInfoDO> allocationInfoMap = CollStreamUtil.toMap(list, ShopAllocationInfoDO::getExpenseType, v -> v);
// 支付校验
verifyPay(request, shopInfo, allocationAmountMap);
verifyPay(request, shopInfo, allocationAmountMap, walletType);
// 批量发起转账
PartnerUserInfoVO user = PartnerUserHolder.getUser();
@@ -124,7 +126,7 @@ public class WalletPayInfoServiceImpl implements WalletPayInfoService {
assert feeItem != null;
return new BatchTransferRequest.TransDataRequest(payNo, feeItem.getFeeItemId(), shopAllocationInfoDO.getPayeeCode(), null, payAmount.toString(), feeItem.getDesc());
});
BatchTransferRequest transRequest = new BatchTransferRequest(2, shopInfo.getStoreId(), request.getPayPwd(), transDataList);
BatchTransferRequest transRequest = new BatchTransferRequest(walletType, shopInfo.getStoreId(), request.getPayPwd(), transDataList);
BatchTransferDTO batchTransferDTO = walletApiService.batchTransfer(transRequest);
if (CollectionUtils.isEmpty(batchTransferDTO.getTransArray())) {
throw new ServiceException(ErrorCodeEnum.WALLET_TRANS_FAIL);
@@ -246,7 +248,7 @@ public class WalletPayInfoServiceImpl implements WalletPayInfoService {
/**
* 支付校验
*/
private void verifyPay(WalletPayRequest request, ShopInfoDO shopInfo, Map<String, BigDecimal> allocationAmountMap) {
private void verifyPay(WalletPayRequest request, ShopInfoDO shopInfo, Map<String, BigDecimal> allocationAmountMap, Integer walletType) {
// 校验费用类型
for (String expenseType : request.getExpenseTypes()) {
if (!DictConstants.PING_AN_DEFAULT_ALLOCATION_EXPENSE_TYPE_CODES.contains(expenseType)) {
@@ -284,7 +286,7 @@ public class WalletPayInfoServiceImpl implements WalletPayInfoService {
}
// 校验余额
List<AccountInfoDTO> accountInfo = walletApiService.getAccountInfo(new OutStoreIdRequest(shopInfo.getStoreId()));
AccountInfoDTO accountInfoDTO = accountInfo.stream().filter(v -> CommonConstants.INDEX_ONE.equals(v.getWalletType()) && CommonConstants.INDEX_ZERO.equals(v.getLabelingStatus())).findFirst().orElse(null);
AccountInfoDTO accountInfoDTO = accountInfo.stream().filter(v -> Objects.nonNull(v.getWalletType()) && v.getWalletType().equals(walletType)).findFirst().orElse(null);
if (Objects.isNull(accountInfoDTO)) {
throw new ServiceException(ErrorCodeEnum.NOT_EXIST_PING_AN_ACCOUNT);
}

View File

@@ -516,7 +516,6 @@ public class StoreServiceImpl implements StoreService {
.filter(v -> userInfoMap.containsKey(v.getUserId()))
.peek(v -> {
EnterpriseUserDO user = userInfoMap.get(v.getUserId());
v.setMobile(user.getMobile());
v.setName(user.getName());
}).collect(Collectors.groupingBy(UserSimpleDTO::getStoreId));
}