mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
Merge branch 'dev' of https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web into dev
# Conflicts: # jsowell-netty/src/main/java/com/jsowell/netty/handler/yunkuaichong/TransactionRecordsRequestHandler.java
This commit is contained in:
@@ -678,20 +678,35 @@ public class AdapayService {
|
||||
// if (CollectionUtils.isNotEmpty(withdrawInfoVOS)) {
|
||||
// totalWithdraw = withdrawInfoVOS.stream().map(WithdrawInfoVO::getCashAmt).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
// }
|
||||
BigDecimal totalWithdraw = clearingWithdrawInfoService.queryTotalWithdraw(merchantId);
|
||||
vo.setTotalWithdraw(totalWithdraw);
|
||||
// BigDecimal totalWithdraw = clearingWithdrawInfoService.queryTotalWithdraw(merchantId);
|
||||
vo.setTotalWithdraw(clearingWithdrawInfoService.queryTotalWithdraw(merchantId));
|
||||
|
||||
// 在途金额
|
||||
BigDecimal pendingAmount = BigDecimal.ZERO;
|
||||
BigDecimal todayWithdrawalAmount = BigDecimal.ZERO;
|
||||
List<WithdrawInfoVO> withdrawInfoVOS = clearingWithdrawInfoService.selectByMerchantId(merchantId);
|
||||
log.info("==查询提现在途金额param:{}, result:{}", JSON.toJSONString(withdrawInfoVOS), JSON.toJSONString(pendingAmount));
|
||||
// log.info("==查询提现在途金额param:{}, result:{}", JSON.toJSONString(withdrawInfoVOS), JSON.toJSONString(pendingAmount));
|
||||
if (CollectionUtils.isNotEmpty(withdrawInfoVOS)) {
|
||||
pendingAmount = withdrawInfoVOS.stream()
|
||||
.filter(item -> Constants.ZERO.equals(item.getStatusDesc()))
|
||||
.map(WithdrawInfoVO::getCashAmt)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
||||
// 查询今天的提现金额
|
||||
for (WithdrawInfoVO withdrawInfoVO : withdrawInfoVOS) {
|
||||
// 如果applicationTime在当天,则加到todayWithdrawalAmount中
|
||||
if (DateUtils.isToday(withdrawInfoVO.getApplicationTime())) {
|
||||
todayWithdrawalAmount = todayWithdrawalAmount.add(withdrawInfoVO.getCashAmt());
|
||||
}
|
||||
}
|
||||
}
|
||||
vo.setPendingAmount(pendingAmount);
|
||||
|
||||
// BigDecimal todayWithdrawalAmount = clearingWithdrawInfoService.queryTodayWithdrawalAmount(merchantId);
|
||||
// 如果大于0,则重新更新LastAvlBalance
|
||||
if (todayWithdrawalAmount.compareTo(BigDecimal.ZERO) > 0) {
|
||||
vo.setLastAvlBalance(BigDecimal.ZERO.max(vo.getLastAvlBalance().subtract(todayWithdrawalAmount)));
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ public class AdapayAccountBalanceVO {
|
||||
// 冻结余额,当配置了自动结算功能,在每日发起结算时会将可用余额转为冻结金额。该部分金额不允许取现。
|
||||
private BigDecimal frzBalance;
|
||||
|
||||
// 昨日日终余额。
|
||||
// 昨日日终余额。(页面显示为可提现金额)
|
||||
private BigDecimal lastAvlBalance;
|
||||
|
||||
// 汇付会员id
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
package com.jsowell.pile.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@@ -100,4 +103,27 @@ public class AdapayUnsplitRecord {
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.JSON_STYLE)
|
||||
.append("id", id)
|
||||
.append("merchantCode", merchantCode)
|
||||
.append("payTime", payTime)
|
||||
.append("paymentId", paymentId)
|
||||
.append("orderNo", orderNo)
|
||||
.append("payAmount", payAmount)
|
||||
.append("confirmedSplitAmount", confirmedSplitAmount)
|
||||
.append("refundAmount", refundAmount)
|
||||
.append("paymentRevokeAmount", paymentRevokeAmount)
|
||||
.append("remainingSplitAmount", remainingSplitAmount)
|
||||
.append("orderCode", orderCode)
|
||||
.append("pileType", pileType)
|
||||
.append("dueRefundAmount", dueRefundAmount)
|
||||
.append("settleAmount", settleAmount)
|
||||
.append("refundFlag", refundFlag)
|
||||
.append("splitFlag", splitFlag)
|
||||
.append("updateTime", updateTime)
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,13 @@
|
||||
package com.jsowell.pile.mapper;
|
||||
|
||||
import com.jsowell.pile.domain.AdapayUnsplitRecord;
|
||||
import com.jsowell.pile.vo.AdapayUnsplitRecordVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface AdapayUnsplitRecordMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
@@ -29,4 +32,6 @@ public interface AdapayUnsplitRecordMapper {
|
||||
int batchInsert(@Param("list") List<AdapayUnsplitRecord> list);
|
||||
|
||||
List<AdapayUnsplitRecord> queryUnsplitOrders(@Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
List<AdapayUnsplitRecordVO> queryList();
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.jsowell.pile.service;
|
||||
|
||||
import com.jsowell.pile.domain.AdapayUnsplitRecord;
|
||||
import com.jsowell.pile.vo.AdapayUnsplitRecordVO;
|
||||
|
||||
import java.util.List;
|
||||
public interface AdapayUnsplitRecordService{
|
||||
|
||||
@@ -27,4 +29,6 @@ public interface AdapayUnsplitRecordService{
|
||||
int batchInsert(List<AdapayUnsplitRecord> list);
|
||||
|
||||
List<AdapayUnsplitRecord> queryUnsplitOrders(String startTime, String endTime);
|
||||
|
||||
List<AdapayUnsplitRecordVO> queryList();
|
||||
}
|
||||
|
||||
@@ -43,4 +43,5 @@ public interface ClearingWithdrawInfoService{
|
||||
PageResponse queryWithdrawList(QueryWithdrawListDTO dto) throws BaseAdaPayException;
|
||||
|
||||
BigDecimal queryTotalWithdraw(String merchantId);
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import com.github.pagehelper.PageInfo;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
||||
import com.jsowell.adapay.dto.QueryWithdrawListDTO;
|
||||
import com.jsowell.adapay.service.AdapayService;
|
||||
import com.jsowell.common.constant.Constants;
|
||||
import com.jsowell.common.core.page.PageResponse;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
@@ -13,11 +12,9 @@ import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.domain.ClearingWithdrawInfo;
|
||||
import com.jsowell.pile.mapper.ClearingWithdrawInfoMapper;
|
||||
import com.jsowell.pile.service.ClearingWithdrawInfoService;
|
||||
import com.jsowell.pile.service.PileMerchantInfoService;
|
||||
import com.jsowell.pile.vo.web.ClearingBillVO;
|
||||
import com.jsowell.pile.vo.web.WithdrawInfoVO;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@@ -642,11 +642,26 @@ public class MemberBasicInfoServiceImpl implements MemberBasicInfoService {
|
||||
List<String> merchantIdList = merchantInfoVOList.stream()
|
||||
.map(MerchantInfoVO::getMerchantId).collect(Collectors.toList());
|
||||
|
||||
List<String> queryMerchantIds;
|
||||
|
||||
// 权限校验一下
|
||||
if (StringUtils.isNotBlank(dto.getMerchantId())) {
|
||||
if (!merchantIdList.contains(dto.getMerchantId())) {
|
||||
throw new BusinessException("403", "没有权限查询该运营商数据");
|
||||
}
|
||||
// 只查当前筛选的运营商
|
||||
queryMerchantIds = Collections.singletonList(dto.getMerchantId());
|
||||
} else {
|
||||
// 查全部权限内的运营商
|
||||
queryMerchantIds = merchantIdList;
|
||||
}
|
||||
|
||||
// 分页
|
||||
int pageNum = dto.getPageNum() == null ? 1 : dto.getPageNum();
|
||||
int pageSize = dto.getPageSize() == null ? 10 : dto.getPageSize();
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
List<MerchantVipVO> resultList = memberBasicInfoMapper.queryMerchantVipList(merchantIdList, dto);
|
||||
List<MerchantVipVO> resultList = memberBasicInfoMapper.queryMerchantVipList(queryMerchantIds, dto);
|
||||
|
||||
if (CollectionUtils.isNotEmpty(resultList)) {
|
||||
for (MerchantVipVO merchantVipVO : resultList) {
|
||||
BigDecimal principalBalance = merchantVipVO.getPrincipalBalance() == null ? BigDecimal.ZERO : merchantVipVO.getPrincipalBalance();
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.jsowell.pile.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AdapayUnsplitRecordVO {
|
||||
// 订单号
|
||||
private String orderCode;
|
||||
|
||||
// 支付ID
|
||||
private String paymentId;
|
||||
|
||||
// 支付金额
|
||||
private String payAmount;
|
||||
|
||||
// 结算金额
|
||||
private String settleAmount;
|
||||
|
||||
// 确认分账金额
|
||||
private String confirmedSplitAmount;
|
||||
|
||||
// 待分账金额
|
||||
private String waitSplitAmount;
|
||||
|
||||
// 应退款金额
|
||||
private String refundAmount;
|
||||
|
||||
// 已退款金额
|
||||
private String paidAmount;
|
||||
|
||||
// 待退款金额
|
||||
private String refundPayAmount;
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.jsowell.web.controller.pile;
|
||||
import com.jsowell.pile.domain.AdapayUnsplitRecord;
|
||||
import com.jsowell.pile.mapper.AdapayUnsplitRecordMapper;
|
||||
import com.jsowell.pile.service.AdapayUnsplitRecordService;
|
||||
import com.jsowell.pile.vo.AdapayUnsplitRecordVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -73,4 +74,9 @@ public class AdapayUnsplitRecordServiceImpl implements AdapayUnsplitRecordServic
|
||||
return adapayUnsplitRecordMapper.queryUnsplitOrders(startTime, endTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdapayUnsplitRecordVO> queryList() {
|
||||
return adapayUnsplitRecordMapper.queryList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user