Merge #113 into master from cc_20260429_bug

feat:问题修改

* cc_20260429_bug: (1 commits squashed)

  - feat:问题修改

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

CR-link: https://codeup.aliyun.com/692ea314dec569489f6f167c/hangzhou/java/custom_zxjp/change/113
This commit is contained in:
正新
2026-04-29 07:00:35 +00:00
parent 0b98bd4bb6
commit 585a978f32
4 changed files with 22 additions and 12 deletions

View File

@@ -286,13 +286,12 @@ public class AdjustmentOrderServiceImpl implements AdjustmentOrderService {
}
OutStoreIdRequest outStoreIdRequest = new OutStoreIdRequest();
outStoreIdRequest.setOutStoreId(adjustmentOrder.getStoreId());
List<AccountInfoDTO> accountInfoList = walletApiService.getAccountInfo(outStoreIdRequest);
AccountInfoDTO accountInfoDTO = walletApiService.getOnlineAccountInfo(outStoreIdRequest);
if (CollectionUtils.isEmpty(accountInfoList)){
if (Objects.isNull(accountInfoDTO)){
throw new ServiceException(ErrorCodeEnum.NOT_EXIST_WANG_SHANG_ACCOUNT);
}
AccountInfoDTO accountInfoDTO = accountInfoList.get(0);
Integer splitType = request.getSplitType();
if (splitType==null){

View File

@@ -270,9 +270,8 @@ public class PreAllocationRecordServiceImpl implements PreAllocationRecordServic
}
if (StringUtil.isNotEmpty(shopInfo.getStoreId())){
List<AccountInfoDTO> accountInfo = walletApiService.getAccountInfo(new OutStoreIdRequest(shopInfo.getStoreId()));
if (CollectionUtils.isNotEmpty(accountInfo)){
AccountInfoDTO accountInfoDTO = accountInfo.get(0);
AccountInfoDTO accountInfoDTO = walletApiService.getOnlineAccountInfo(new OutStoreIdRequest(shopInfo.getStoreId()));
if (Objects.nonNull(accountInfoDTO)){
String totalAmount = accountInfoDTO.getTotalAmount();
BigDecimal total = new BigDecimal(totalAmount);
//校验本次缴纳金额
@@ -735,12 +734,11 @@ public class PreAllocationRecordServiceImpl implements PreAllocationRecordServic
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(record.getShopId());
OutStoreIdRequest outStoreIdRequest = new OutStoreIdRequest();
outStoreIdRequest.setOutStoreId(shopInfo.getStoreId());
List<AccountInfoDTO> accountInfoList = walletApiService.getAccountInfo(outStoreIdRequest);
if (CollectionUtils.isEmpty(accountInfoList)){
AccountInfoDTO accountInfoDTO = walletApiService.getOnlineAccountInfo(outStoreIdRequest);
if (Objects.isNull(accountInfoDTO)){
throw new ServiceException(ErrorCodeEnum.NOT_EXIST_WANG_SHANG_ACCOUNT);
}
//校验金额
AccountInfoDTO accountInfoDTO = accountInfoList.get(0);
String totalAmount = accountInfoDTO.getTotalAmount();
Boolean amountSupport = BigDecimalUtils.greaterThanOrEqual(new BigDecimal(totalAmount), record.getPayAmount());
if (!amountSupport){

View File

@@ -2,6 +2,7 @@ package com.cool.store.service.wallet;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.dto.wallet.*;
import com.cool.store.enums.wechat.WalletTypeEnum;
import com.cool.store.http.WalletHttpClientRest;
import com.cool.store.request.wallet.*;
import com.cool.store.utils.StringUtil;
@@ -10,6 +11,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Objects;
/**
* @Author suzhuhong
@@ -79,6 +81,18 @@ public class WalletApiService {
return walletHttpClientRest.postWithSign(walletBaseUrl+"/open/crm/account/v1/addTag", request, AddTagDTO.class);
}
/**
* 获取网商账户(如果多个 取出来第一个)
* @param request
* @return
*/
public AccountInfoDTO getOnlineAccountInfo(OutStoreIdRequest request){
List<AccountInfoDTO> accountInfo = getAccountInfo(request);
return accountInfo.stream().filter(v -> Objects.nonNull(v.getWalletType()) && v.getWalletType().equals(WalletTypeEnum.ONLINE_BANK.getType())).findFirst().orElse(null);
}
/**
* 获取账户信息
* @param request