From 13218a0ae968a32885b7f084b37ad6c9a5c6a62e Mon Sep 17 00:00:00 2001 From: huangqizhen <15552608129@163.com> Date: Wed, 19 Nov 2025 18:14:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B8=81=E7=A7=8D=E4=B8=8E?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E6=9C=AA=E9=99=A4100=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../serviceImpl/cash/CashRefundServiceImpl.java | 22 +++++++++++++++++++--- .../resources/cashMapper/CashCollectionMapper.xml | 8 ++++++-- src/main/resources/cashMapper/CashRefundMapper.xml | 2 +- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/example/demo/serviceImpl/cash/CashRefundServiceImpl.java b/src/main/java/com/example/demo/serviceImpl/cash/CashRefundServiceImpl.java index b0eb762..506096b 100644 --- a/src/main/java/com/example/demo/serviceImpl/cash/CashRefundServiceImpl.java +++ b/src/main/java/com/example/demo/serviceImpl/cash/CashRefundServiceImpl.java @@ -67,18 +67,20 @@ public class CashRefundServiceImpl implements RefundService { if (list.isEmpty()) { return new PageInfo<>(list); } - System.out.println("135"); + // 批量收集ID Set relatedIds = new HashSet<>(); Set marketIds = new HashSet<>(); Set submitterIds = new HashSet<>(); Set auditIds = new HashSet<>(); + Set executorIds = new HashSet<>(); list.forEach(item -> { if (item.getRelatedId() != null) relatedIds.add(item.getRelatedId()); if (item.getMarket() != null) marketIds.add(item.getMarket()); if (item.getSubmitterId() != null) submitterIds.add(item.getSubmitterId()); if (item.getAuditId() != null) auditIds.add(item.getAuditId()); + if (item.getExecutor() != null) executorIds.add(item.getExecutor()); }); // 批量查询 @@ -93,6 +95,8 @@ public class CashRefundServiceImpl implements RefundService { Map auditMap = cashRefundMapper.getAuditBatch(auditIds) .stream().collect(Collectors.toMap(LhlAudit::getId, Function.identity())); + Map executorNameMap = auditMapper.getNamesByJwcodes(executorIds) + .stream().collect(Collectors.toMap(Admin::getAccount, Admin::getAdminName)); // 处理数据 list.forEach(item -> { @@ -101,12 +105,15 @@ public class CashRefundServiceImpl implements RefundService { processCashCollection(item, cashCollection); } + String marketName = marketNameMap.get(item.getMarket()); String submitter = submitterNameMap.get(item.getSubmitterId()); LhlAudit lhlAudit = auditMap.get(item.getAuditId()); + String executorName = executorNameMap.get(String.valueOf(item.getExecutor())); item.setMarketName(marketName != null ? marketName : ""); item.setSubmitter(submitter != null ? submitter : ""); + item.setExecutorName(executorName != null ? executorName : ""); if (lhlAudit != null) { item.setAreaServise(lhlAudit.getAreaServise()); @@ -127,13 +134,15 @@ public class CashRefundServiceImpl implements RefundService { BigDecimal free = new BigDecimal(freeGold).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP); BigDecimal permanent = new BigDecimal(permanentGold).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP); + + item.setGold(permanent); item.setFree(free); item.setActivity(cashCollection.getActivity()); item.setPaymentCurrency(cashCollection.getPaymentCurrency()); - item.setPaymentAmount(cashCollection.getPaymentAmount()); + item.setPaymentAmount(cashCollection.getPaymentAmount().divide(new BigDecimal(100), 2, RoundingMode.HALF_UP)); item.setReceivedCurrency(cashCollection.getReceivedCurrency()); - item.setReceivedAmount(cashCollection.getReceivedAmount()); + item.setReceivedAmount(cashCollection.getReceivedAmount().divide(new BigDecimal(100), 2, RoundingMode.HALF_UP)); item.setPayType(cashCollection.getPayType()); item.setPayTime(cashCollection.getPayTime()); item.setPayBankCode(cashCollection.getBankCode()); @@ -382,12 +391,14 @@ CashRecordDone cashRecordDone1 = new CashRecordDone(); Set marketIds = new HashSet<>(); Set submitterIds = new HashSet<>(); Set auditIds = new HashSet<>(); + Set executorIds = new HashSet<>(); list.forEach(item -> { if (item.getRelatedId() != null) relatedIds.add(item.getRelatedId()); if (item.getMarket() != null) marketIds.add(item.getMarket()); if (item.getSubmitterId() != null) submitterIds.add(item.getSubmitterId()); if (item.getAuditId() != null) auditIds.add(item.getAuditId()); + if (item.getExecutor() != null) executorIds.add(item.getExecutor()); }); // 批量查询 @@ -402,6 +413,8 @@ CashRecordDone cashRecordDone1 = new CashRecordDone(); Map auditMap = cashRefundMapper.getAuditBatch(auditIds) .stream().collect(Collectors.toMap(LhlAudit::getId, Function.identity())); + Map executorNameMap = auditMapper.getNamesByJwcodes(executorIds) + .stream().collect(Collectors.toMap(Admin::getAccount, Admin::getAdminName)); // 处理数据 list.forEach(item -> { @@ -410,12 +423,15 @@ CashRecordDone cashRecordDone1 = new CashRecordDone(); processCashCollection(item, cashCollection); } + String marketName = marketNameMap.get(item.getMarket()); String submitter = submitterNameMap.get(item.getSubmitterId()); LhlAudit lhlAudit = auditMap.get(item.getAuditId()); + String executorName = executorNameMap.get(String.valueOf(item.getExecutor())); item.setMarketName(marketName != null ? marketName : ""); item.setSubmitter(submitter != null ? submitter : ""); + item.setExecutorName(executorName != null ? executorName : ""); if (lhlAudit != null) { item.setAreaServise(lhlAudit.getAreaServise()); diff --git a/src/main/resources/cashMapper/CashCollectionMapper.xml b/src/main/resources/cashMapper/CashCollectionMapper.xml index e696c54..2db20e8 100644 --- a/src/main/resources/cashMapper/CashCollectionMapper.xml +++ b/src/main/resources/cashMapper/CashCollectionMapper.xml @@ -259,16 +259,20 @@ select cr.id, cr.jwcode, cr.name, cr.market, cr.order_code, cr.bank_code, cr.goods_name, cr.good_num, cr.num_unit, cr.permanent_gold, cr.free_gold, - cr.payment_currency, cr.payment_amount, cr.received_currency, cr.received_amount, cr.handling_charge, + cr.payment_amount, cr.received_amount, cr.handling_charge, cr.pay_type, cr.received_market, cr.pay_time, cr.received_time, cr.audit_id, cr.status, cr.submitter_id, cr.submitter_market, cr.voucher, cr.remark, cr.audit_time, a1.admin_name as submitterName, a2.admin_name as auditName, - ra.activity_name as activity + ra.activity_name as activity, + r1.rate_name as paymentCurrency, + r2.rate_name as receivedCurrency from cash_record_collection cr left join admin a1 on cr.submitter_id = a1.id left join admin a2 on cr.audit_id = a2.id left join recharge_activity ra on ra.id = cr.activity + left join rate r1 on r1.id = cr.payment_currency + left join rate r2 on r2.id = cr.received_currency where 1 = 0 OR cr.id IN diff --git a/src/main/resources/cashMapper/CashRefundMapper.xml b/src/main/resources/cashMapper/CashRefundMapper.xml index a504a15..2aaac2b 100644 --- a/src/main/resources/cashMapper/CashRefundMapper.xml +++ b/src/main/resources/cashMapper/CashRefundMapper.xml @@ -320,7 +320,7 @@ crr.refund_currency, crr.refund_amount, crr.refund_channels, - crr.voucher, + crr.refund_voucher, crr.refund_time, crr.executor, crr.status,