wujiefeng 1 rok pred
rodič
commit
2547d3bd4c

+ 5 - 4
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/pay/ChinaumsSenselessPayService.java

@@ -293,12 +293,12 @@ public class ChinaumsSenselessPayService extends SuperService {
         return ResultContent.buildContent(collectionResultContent.getContent());
     }
 
-    public Object refund(String projectOid, String oid, String userId, BigDecimal total, String orderNo, String refundOrderNo, String remark) {
+    public ResultContent refund(String projectOid, String oid, String userId, BigDecimal total, String orderNo, String refundOrderNo, String remark) {
 
         String accountName = orgPayAccountService.queryOgPayAccount(oid, PaymentType.UnionFrictionlessPay);
         com.github.microservice.pay.client.ret.ResultContent<AccountModel> accountModelResultContent = payProductAccountService.get(accountName);
         if (!accountModelResultContent.getState().equals(ResultState.Success)){
-            return accountModelResultContent;
+            return ResultContent.buildFail(accountModelResultContent.getMsg());
         }
         ChinaumsSenselessConf conf = (ChinaumsSenselessConf) accountModelResultContent.getContent().getConf();
         String mid = conf.getMchId();
@@ -309,10 +309,11 @@ public class ChinaumsSenselessPayService extends SuperService {
         request.setMchntOrderId(orderNo);
         request.setVaMchntNo(mid);
         request.setRefundAmount(total.toString());
-        request.setRefundOrderId(refundOrderNo);
+        request.setTargetOrderId(refundOrderNo);
         request.setSysSource(JsonUtil.toJson(Map.of("userId", userId, "oid", oid, "projectOid", projectOid)));
         payProductParameter.setMeta(BeanUtil.bean2Map(request));
-        return senselessPayService.refund(payProductParameter);
+        com.github.microservice.pay.client.ret.ResultContent<Object> refundResultContent = senselessPayService.refund(payProductParameter);
+        return ResultContent.buildContent(refundResultContent.getContent());
     }
 
     private Object handlePay(String projectOid, String oid, String userId, BigDecimal total, String orderNo, String remark) {

+ 23 - 4
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/pay/OrgOverviewService.java

@@ -1,6 +1,7 @@
 package com.zhongshu.card.server.core.service.pay;
 
 import com.github.microservice.components.data.base.page.PageableModel;
+import com.github.microservice.pay.client.model.ledger.GeneralLedgerQueryModel;
 import com.github.microservice.pay.client.model.ledger.GeneralLedgerTreeModel;
 import com.github.microservice.pay.client.model.ledger.transaction.*;
 import com.github.microservice.pay.client.ret.ResultContent;
@@ -27,6 +28,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Pageable;
 import org.springframework.data.domain.Sort;
 import org.springframework.stereotype.Service;
+import org.springframework.util.Assert;
 
 import java.util.*;
 import java.util.stream.Collectors;
@@ -52,8 +54,21 @@ public class OrgOverviewService extends SuperService {
     /**
      * 查询用户流水
      */
-    public Object queryAccountTreeFlow(Pageable pageable, PayAccount payAccount, Long startTime, Long endTime){
-        ResultContent<GeneralLedgerTreeModel> descendantRet = generalLedgerService.descendant(payAccount.getLedgerId());
+    public Object queryAccountTreeFlow(Pageable pageable, Long startTime, Long endTime){
+        String currentUserId = getCurrentUserId();
+        String projectOid = getCurrentProjectOid();
+
+        if (StringUtils.isBlank(projectOid)){
+            return com.github.microservice.net.ResultContent.buildFail("projectOid is null");
+        }
+
+        PayAccount userParent = payAccountService.getUserParent(projectOid, currentUserId);
+        ResultContent<GeneralLedgerQueryModel> ledgerRet = generalLedgerService.get(userParent.getLedgerId());
+        if (!ledgerRet.getState().equals(ResultState.Success)){
+            return ledgerRet;
+        }
+
+        ResultContent<GeneralLedgerTreeModel> descendantRet = generalLedgerService.descendant(userParent.getLedgerId());
         if (!descendantRet.getState().equals(ResultState.Success)){
             return com.github.microservice.net.ResultContent.buildFail("获取用户账户及下级账户失败");
         }
@@ -67,14 +82,18 @@ public class OrgOverviewService extends SuperService {
         pageableModel.setSize(pageable.getPageSize());
         pageableModel.setSort("createTime");
 
-
+//        descendantQueryTransactionLogModel.setGeneralLedgerId(new String[]{userParent.getLedgerId()});
         descendantQueryTransactionLogModel.setPage(pageableModel);
-        descendantQueryTransactionLogModel.setParentGeneralLedgerId(payAccount.getLedgerId());
+        descendantQueryTransactionLogModel.setParentGeneralLedgerId(userParent.getLedgerId());
         descendantQueryTransactionLogModel.setStartTime(startTime);
         descendantQueryTransactionLogModel.setEndTime(endTime);
         return transactionLogService.aggregate(descendantQueryTransactionLogModel);
     }
 
+    /**
+     * 查询用户流水(按月)
+     */
+
     /**
      * 统计机构账户余额、待结算金额、提现中金额
      */