From 3f2a845c442f2773c1ffb8d55e0522409f4388a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A3=B7=E5=8F=B6?= <14103883+leaf-phos@user.noreply.gitee.com> Date: Mon, 28 Apr 2025 14:15:32 +0800 Subject: [PATCH] =?UTF-8?q?debug=E4=BA=BA=E5=B7=A5=E9=80=80=E6=AC=BE?= =?UTF-8?q?=E9=87=91=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/framework/aspectj/LogAspect.java | 1 + .../manager/factory/AsyncFactory.java | 12 +++++++----- .../order/service/impl/OrderServiceImpl.java | 13 +++++++------ .../com/ruoyi/bst/pay/mapper/PayMapper.java | 2 +- .../com/ruoyi/bst/pay/mapper/PayMapper.xml | 18 +++++++----------- .../ruoyi/system/operLog/domain/OperLog.java | 4 ++++ .../system/operLog/mapper/OperLogMapper.xml | 18 ++++++++++++------ .../web/app/AppCustomerServiceController.java | 3 +++ 8 files changed, 42 insertions(+), 29 deletions(-) diff --git a/common-ruoyi/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java b/common-ruoyi/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java index 97c227a..83789f0 100644 --- a/common-ruoyi/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java +++ b/common-ruoyi/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java @@ -188,6 +188,7 @@ public class LogAspect if (loginUser != null) { operLog.setOperName(loginUser.getNickName()); + operLog.setOperUserId(loginUser.getUserId()); UserVO currentUser = loginUser.getUser(); if (StringUtils.isNotNull(currentUser) && StringUtils.isNotNull(currentUser.getDept())) { diff --git a/common-ruoyi/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java b/common-ruoyi/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java index 8ba24a7..b7b60b9 100644 --- a/common-ruoyi/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java +++ b/common-ruoyi/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java @@ -1,5 +1,10 @@ package com.ruoyi.framework.manager.factory; +import java.util.TimerTask; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import com.ruoyi.common.constant.Constants; import com.ruoyi.common.utils.LogUtils; import com.ruoyi.common.utils.ServletUtils; @@ -8,14 +13,11 @@ import com.ruoyi.common.utils.ip.AddressUtils; import com.ruoyi.common.utils.ip.IpUtils; import com.ruoyi.common.utils.spring.SpringUtils; import com.ruoyi.system.logininfor.domain.Logininfor; +import com.ruoyi.system.logininfor.service.LogininforService; import com.ruoyi.system.operLog.domain.OperLog; import com.ruoyi.system.operLog.service.OperLogService; -import com.ruoyi.system.logininfor.service.LogininforService; -import eu.bitwalker.useragentutils.UserAgent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import java.util.TimerTask; +import eu.bitwalker.useragentutils.UserAgent; /** * 异步工厂(产生任务用) diff --git a/ruoyi-service/src/main/java/com/ruoyi/bst/order/service/impl/OrderServiceImpl.java b/ruoyi-service/src/main/java/com/ruoyi/bst/order/service/impl/OrderServiceImpl.java index 104e4b0..652ee18 100644 --- a/ruoyi-service/src/main/java/com/ruoyi/bst/order/service/impl/OrderServiceImpl.java +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/order/service/impl/OrderServiceImpl.java @@ -520,27 +520,28 @@ public class OrderServiceImpl implements OrderService // 退款原因 + String refundReason = null; if (RefundType.ADMIN.getCode().equals(type)) { - reason = String.format("【管理员退款】%s订单%s退款 %s 元", userName, order.getNo(), amount); + refundReason = String.format("【管理员退款】%s订单%s退款 %s 元", userName, order.getNo(), amount); } else { - reason = String.format("【自动退款】%s订单%s退款 %s 元", userName, order.getNo(), amount); + refundReason = String.format("【自动退款】%s订单%s退款 %s 元", userName, order.getNo(), amount); } if (StringUtils.isNotBlank(reason)) { - reason += ":" + reason; + refundReason += ":" + reason; } - String refundReason = reason; + String finalRefundReason = refundReason; Integer result = transactionTemplate.execute(status -> { // 分成退款 - boolean bonusRefund = bonusService.refundByBst(BonusBstType.ORDER, order.getId(), amount, order.getPayAmount(), refundReason); + boolean bonusRefund = bonusService.refundByBst(BonusBstType.ORDER, order.getId(), amount, order.getPayAmount(), finalRefundReason); ServiceUtil.assertion(!bonusRefund, "ID为%s的订单分成退款失败", order.getId()); // 支付退款 PayRefundDTO dto = new PayRefundDTO(); dto.setId(order.getPayId()); dto.setRefundAmount(amount); - dto.setRefundReason(refundReason); + dto.setRefundReason(finalRefundReason); dto.setUserId(userId); dto.setUserName(userName); dto.setType(type); diff --git a/ruoyi-service/src/main/java/com/ruoyi/bst/pay/mapper/PayMapper.java b/ruoyi-service/src/main/java/com/ruoyi/bst/pay/mapper/PayMapper.java index 1fdfc27..e9f95c2 100644 --- a/ruoyi-service/src/main/java/com/ruoyi/bst/pay/mapper/PayMapper.java +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/pay/mapper/PayMapper.java @@ -83,7 +83,7 @@ public interface PayMapper * @param amount 退款金额 * @return 结果 */ - int addRefundingAmount(@Param("id") Long id, @Param("amount") BigDecimal amount, @Param("type") String type); + int addRefundingAmount(@Param("id") Long id, @Param("amount") BigDecimal amount, @Param("refundType") String refundType); /** * 记录退款金额 diff --git a/ruoyi-service/src/main/java/com/ruoyi/bst/pay/mapper/PayMapper.xml b/ruoyi-service/src/main/java/com/ruoyi/bst/pay/mapper/PayMapper.xml index ca1b243..0d0627a 100644 --- a/ruoyi-service/src/main/java/com/ruoyi/bst/pay/mapper/PayMapper.xml +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/pay/mapper/PayMapper.xml @@ -73,7 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where bp.id = #{id} - + insert into bst_pay @@ -186,17 +186,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update bst_pay refunding = refunding + #{amount}, - - auto_refund = auto_refund + #{amount}, - - - admin_refund = admin_refund + #{amount}, - + auto_refund = if(#{refundType} = '1', auto_refund + #{amount}, auto_refund), + admin_refund = if(#{refundType} = '2', admin_refund + #{amount}, admin_refund), where id = #{id} and amount >= refunded + refunding + #{amount} - + update bst_pay @@ -205,7 +201,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where id = #{id} and refunding - #{amount} >= 0 - + - + - + @@ -114,6 +117,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND oper_time <= #{params.endTime} + + and oper_user_id = #{operUserId} + AND oper_time >= #{operTimeRange[0]} AND oper_time <= #{operTimeRange[1]} diff --git a/ruoyi-web/src/main/java/com/ruoyi/web/app/AppCustomerServiceController.java b/ruoyi-web/src/main/java/com/ruoyi/web/app/AppCustomerServiceController.java index d487e75..76897f8 100644 --- a/ruoyi-web/src/main/java/com/ruoyi/web/app/AppCustomerServiceController.java +++ b/ruoyi-web/src/main/java/com/ruoyi/web/app/AppCustomerServiceController.java @@ -10,6 +10,7 @@ import com.ruoyi.bst.area.domain.AreaVO; import com.ruoyi.bst.area.service.AreaService; import com.ruoyi.bst.customerService.domain.CustomerServiceQuery; import com.ruoyi.bst.customerService.domain.dto.CustomerServiceIndexQuery; +import com.ruoyi.bst.customerService.domain.enums.CustomerServiceStatus; import com.ruoyi.bst.customerService.service.CustomerServiceService; import com.ruoyi.common.annotation.Anonymous; import com.ruoyi.common.core.controller.BaseController; @@ -55,6 +56,7 @@ public class AppCustomerServiceController extends BaseController { if (areaId != null) { CustomerServiceQuery afterQuery = new CustomerServiceQuery(); afterQuery.setAreaId(areaId); + afterQuery.setIsEnabled(CustomerServiceStatus.ENABLE.getStatus()); ajax.put("after", customerServiceService.selectCustomerServiceList(afterQuery)); } @@ -70,6 +72,7 @@ public class AppCustomerServiceController extends BaseController { // 查询运营区客服 CustomerServiceQuery beforeQuery = new CustomerServiceQuery(); beforeQuery.setAreaId(area.getId()); + beforeQuery.setIsEnabled(CustomerServiceStatus.ENABLE.getStatus()); ajax.put("before", customerServiceService.selectCustomerServiceList(beforeQuery)); } }