|
@@ -16,15 +16,13 @@ import com.zhongshu.card.client.type.SettleStatus;
|
|
|
import com.zhongshu.card.server.core.domain.pay.PayAccount;
|
|
import com.zhongshu.card.server.core.domain.pay.PayAccount;
|
|
|
import com.zhongshu.card.server.core.util.CommonUtil;
|
|
import com.zhongshu.card.server.core.util.CommonUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
+import org.bson.Document;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.web.PagedModel;
|
|
import org.springframework.data.web.PagedModel;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
-import java.util.HashSet;
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
-import java.util.Map;
|
|
|
|
|
-import java.util.Set;
|
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
|
|
@Slf4j
|
|
@Slf4j
|
|
|
@Service
|
|
@Service
|
|
@@ -53,7 +51,15 @@ public class SettleService {
|
|
|
queryModel.setEndTime(endTime);
|
|
queryModel.setEndTime(endTime);
|
|
|
queryModel.setGeneralLedgerId(new String[]{waitSettleAccount.getLedgerId()});
|
|
queryModel.setGeneralLedgerId(new String[]{waitSettleAccount.getLedgerId()});
|
|
|
//过滤出对应支付渠道的账单
|
|
//过滤出对应支付渠道的账单
|
|
|
- queryModel.setFilter(Map.of("meta.paymentType", paymentType, "meta.settleStatus", SettleStatus.WaitSettle));
|
|
|
|
|
|
|
+// queryModel.setFilter(Map.of("meta.paymentType", paymentType, "meta.settleStatus", SettleStatus.WaitSettle));
|
|
|
|
|
+ queryModel.setFilter(Map.of("meta.paymentType", paymentType, "$or", Arrays.asList(
|
|
|
|
|
+ new Document()
|
|
|
|
|
+ .append("meta.settleStatus", new Document()
|
|
|
|
|
+ .append("$exists", false)
|
|
|
|
|
+ ),
|
|
|
|
|
+ new Document()
|
|
|
|
|
+ .append("meta.settleStatus", "WaitSettle")
|
|
|
|
|
+ )));
|
|
|
ResultContent<TransactionLogAggregateRetModel> aggregateResult = transactionLogService.aggregate(queryModel);
|
|
ResultContent<TransactionLogAggregateRetModel> aggregateResult = transactionLogService.aggregate(queryModel);
|
|
|
if (!aggregateResult.getState().equals(ResultState.Success)){
|
|
if (!aggregateResult.getState().equals(ResultState.Success)){
|
|
|
log.info("资金结算:查询待结算账单失败");
|
|
log.info("资金结算:查询待结算账单失败");
|
|
@@ -64,7 +70,7 @@ public class SettleService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//收入-支出=可提现金额
|
|
//收入-支出=可提现金额
|
|
|
- Long settleAmount = aggregateResult.getContent().getStatistics().getCreditCount() - aggregateResult.getContent().getStatistics().getDebitCount();
|
|
|
|
|
|
|
+ long settleAmount = aggregateResult.getContent().getStatistics().getCreditCount() - aggregateResult.getContent().getStatistics().getDebitCount();
|
|
|
//转账 机构待结算子账户- 机构待提现子账户+
|
|
//转账 机构待结算子账户- 机构待提现子账户+
|
|
|
PayAccount settleAccount = payAccountService.getOrgChildren(projectOid, oid, PaymentChannelType.Settle);
|
|
PayAccount settleAccount = payAccountService.getOrgChildren(projectOid, oid, PaymentChannelType.Settle);
|
|
|
|
|
|