|
|
@@ -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);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询用户流水(按月)
|
|
|
+ */
|
|
|
+
|
|
|
/**
|
|
|
* 统计机构账户余额、待结算金额、提现中金额
|
|
|
*/
|