|
|
@@ -1,12 +1,13 @@
|
|
|
package com.sckw.payment.service;
|
|
|
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
-import com.sckw.core.model.constant.NumberConstant;
|
|
|
import com.sckw.core.common.enums.enums.DictEnum;
|
|
|
import com.sckw.core.exception.BusinessException;
|
|
|
import com.sckw.core.model.constant.Global;
|
|
|
+import com.sckw.core.model.constant.NumberConstant;
|
|
|
import com.sckw.core.model.enums.LogisticsOrderEnum;
|
|
|
import com.sckw.core.model.page.PageRes;
|
|
|
import com.sckw.core.utils.IdWorker;
|
|
|
@@ -19,8 +20,12 @@ import com.sckw.order.api.dubbo.TradeOrderInfoService;
|
|
|
import com.sckw.order.api.model.UpdateOrderStatusParam;
|
|
|
import com.sckw.payment.api.model.constant.ChannelEnum;
|
|
|
import com.sckw.payment.api.model.dto.WalletDto;
|
|
|
+import com.sckw.payment.api.model.dto.WalletVo;
|
|
|
import com.sckw.payment.api.model.dto.common.R;
|
|
|
-import com.sckw.payment.dao.*;
|
|
|
+import com.sckw.payment.dao.KwpLedgerLogisticsMapper;
|
|
|
+import com.sckw.payment.dao.KwpSettlementLogisticsMapper;
|
|
|
+import com.sckw.payment.dao.KwpSettlementLogisticsTrackMapper;
|
|
|
+import com.sckw.payment.dao.KwpSettlementWalletMapper;
|
|
|
import com.sckw.payment.model.*;
|
|
|
import com.sckw.payment.model.constant.*;
|
|
|
import com.sckw.payment.model.dto.LedgerUnitDto;
|
|
|
@@ -594,7 +599,7 @@ public class KwpSettlementWalletService {
|
|
|
* @param id
|
|
|
* @return
|
|
|
*/
|
|
|
- public WalletDto getConfirmLogisticsPayment(Long id) {
|
|
|
+ public Object getConfirmLogisticsPayment(Long id) {
|
|
|
SettlementLogisticsDto byId = kwpSettlementLogisticsService.detail(id, LogisticsUnitType.CARRIER, LogisticsUnitType.SHIPPER);
|
|
|
if (Objects.isNull(byId)) {
|
|
|
throw new BusinessException("结算单不存在");
|
|
|
@@ -616,7 +621,7 @@ public class KwpSettlementWalletService {
|
|
|
* @param id 结算单id
|
|
|
* @return
|
|
|
*/
|
|
|
- public WalletDto getConfirmTradePayment(Long id) {
|
|
|
+ public Object getConfirmTradePayment(Long id) {
|
|
|
SettlementTradeDto byId = kwpSettlementTradeService.getById(id, TradeUnitType.SELL);
|
|
|
if (Objects.isNull(byId)) {
|
|
|
throw new BusinessException("结算单不存在");
|
|
|
@@ -638,7 +643,7 @@ public class KwpSettlementWalletService {
|
|
|
* @param trading 交易方式
|
|
|
* @return
|
|
|
*/
|
|
|
- private WalletDto getWalletBalance(List<LedgerUnitDto> listById, String trading) {
|
|
|
+ private WalletVo getWalletBalance(List<LedgerUnitDto> listById, String trading) {
|
|
|
Long uid = null;
|
|
|
Long filter = null;
|
|
|
for (LedgerUnitDto ledgerUnitDto : listById) {
|
|
|
@@ -661,7 +666,18 @@ public class KwpSettlementWalletService {
|
|
|
throw new BusinessException("交易双方暂未开通电子钱包");
|
|
|
}
|
|
|
List<WalletDto> data = wallet.getData();
|
|
|
- return data.get(NumberConstant.ZERO);
|
|
|
+ WalletDto walletDto = data.get(NumberConstant.ZERO);
|
|
|
+ if (Objects.isNull(walletDto)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ WalletVo walletVo = BeanUtil.toBean(walletDto, WalletVo.class);
|
|
|
+ walletVo.setFreeze(Objects.nonNull(walletDto.getFreeze()) ? BigDecimal.valueOf(walletDto.getFreeze() / 100D) : new BigDecimal("0"));
|
|
|
+ walletVo.setApMoney(Objects.nonNull(walletDto.getApMoney()) ? BigDecimal.valueOf(walletDto.getApMoney() / 100D) : new BigDecimal("0"));
|
|
|
+ walletVo.setTotalMoney(Objects.nonNull(walletDto.getTotalMoney()) ? BigDecimal.valueOf(walletDto.getTotalMoney() / 100D) : new BigDecimal("0"));
|
|
|
+ walletVo.setMoney(Objects.nonNull(walletDto.getMoney()) ? BigDecimal.valueOf(walletDto.getMoney() / 100D) : new BigDecimal("0"));
|
|
|
+ walletVo.setChargingMoney(Objects.nonNull(walletDto.getChargingMoney()) ? BigDecimal.valueOf(walletDto.getChargingMoney() / 100D) : new BigDecimal("0"));
|
|
|
+ walletVo.setWithdrawingMoney(Objects.nonNull(walletDto.getWithdrawingMoney()) ? BigDecimal.valueOf(walletDto.getWithdrawingMoney() / 100D) : new BigDecimal("0"));
|
|
|
+ return walletVo;
|
|
|
}
|
|
|
|
|
|
/**
|