最近搜索

SpringBoot AOP aop 切面 记录日志

浏览:5
管理员 2026-02-26 20:37



这个是记录到info日志里面的。



<!-- pom.xml -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-aop</artifactId>
</dependency>



package java456.com.config;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Field;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;

/**
 * AOP切面:记录Controller层请求的URL、IP、参数、返回值等信息
 */
@Aspect
@Component
public class RequestAspect {

    // 对接logback的日志对象(建议用INFO级别,输出到你配置的info日志文件)
    private static final Logger logger = LoggerFactory.getLogger(RequestAspect.class);

    /**
         *   execution(public * java456.com.controller.xcx_api.API_XCX_Order_Controller.*(..))
         *   public  匹配公有方法(如果去掉 public,会匹配所有访问修饰符的方法:私有 / 保护 / 公有)
         *   第一个 * 匹配任意返回值类型(比如 String、Integer、void、Order 等,不管方法返回什么都匹配)
         *   java456.com.controller.xcx_api.API_XCX_Order_Controller   精准匹配这个指定类(只拦截这个类里的方法)
         *   第二个 * 匹配这个类里的任意方法名(比如 createOrder、getOrder、cancelOrder 等,不管方法叫什么都匹配)
         *    (..)     匹配方法的任意参数(0 个参数、1 个参数、多个参数,不管参数类型是什么都匹配)
         *
         *
         *  如果想 java456.com.controller包下面所有的控制器呢。
         *  @Pointcut("execution(public * java456.com.controller.**. *(..))")
         *  
         */
        @Pointcut("execution(public * java456.com.controller.xcx_api.API_XCX_Order_Controller.*(..))")
        public void log() {
        }

    /**
     * 方法执行前:记录请求URL、IP、方法、参数等
     */
    @Before("log()")
    public void deBefore(JoinPoint joinPoint) {
        try {
            // 1. 获取HttpServletRequest对象(兼容异步请求,避免空指针)
            ServletRequestAttributes sra = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
            if (sra == null) {
                logger.warn("【请求日志】无法获取HttpServletRequest(异步请求?)");
                return;
            }
            HttpServletRequest request = sra.getRequest();

            // 2. 解析核心请求信息
            String url = request.getRequestURI(); // 请求URI(如/api/user/list)
            String ip = getClientIp(request); // 真实客户端IP(修复原代码getRemoteHost的缺陷)
            String method = request.getMethod(); // 请求方法(GET/POST等)
            String classMethod = joinPoint.getSignature().getDeclaringTypeName() + "." + joinPoint.getSignature().getName(); // 执行的方法名
            Object[] args = joinPoint.getArgs(); // 方法参数

            // 3. 解析方法参数为 "key=value" 格式的字符串
            String argsStr = parseArgsToKeyValue(args);

            // 4. 拼接日志(用logger输出,而非System.out,对接logback配置)
            logger.info("【请求开始】URL:{} | IP:{} | 请求方法:{} | 执行方法:{} | 方法参数:{} | 用户信息:{}",
                    url, ip, method, classMethod, args, argsStr);

        } catch (Exception e) {
            logger.error("【请求日志】记录请求信息失败", e);
        }
    }

    /**
     * 方法执行后:记录请求结束(可选)
     */
    @After("log()")
    public void doAfter(JoinPoint joinPoint) {
        try {
            ServletRequestAttributes sra = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
            if (sra != null) {
                String url = sra.getRequest().getRequestURI();
                logger.info("【请求结束】URL:{}", url);
            }
        } catch (Exception e) {
            logger.error("【请求日志】记录请求结束信息失败", e);
        }
    }

    /**
     * 方法返回后:记录返回值
     */
    @AfterReturning(returning = "result", pointcut = "log()")
    public void doReturn(Object result) {
        try {
            ServletRequestAttributes sra = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
            if (sra != null) {
                String url = sra.getRequest().getRequestURI();
                // 注意:如果返回值是大对象(如List<XXX>),建议只记录关键信息,避免日志过大
                logger.info("【请求返回】URL:{} | 返回值:{}", url, result);
            }
        } catch (Exception e) {
            logger.error("【请求日志】记录返回值失败", e);
        }
    }

    // ---------------------- 辅助方法 ----------------------
    /**
     * 获取客户端真实IP(修复原代码getRemoteHost()只能拿到本机IP的问题)
     */
    private String getClientIp(HttpServletRequest request) {
        String ip = request.getHeader("X-Forwarded-For");
        if (ip == null || ip.isEmpty() || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("Proxy-Client-IP");
        }
        if (ip == null || ip.isEmpty() || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("WL-Proxy-Client-IP");
        }
        if (ip == null || ip.isEmpty() || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getRemoteAddr(); // 最后兜底(可能是网关IP)
        }
        // 处理多IP场景(X-Forwarded-For格式:192.168.1.1, 10.0.0.1)
        return ip != null && ip.contains(",") ? ip.split(",")[0].trim() : ip;
    }


    /**
     * 辅助方法:将方法参数解析为 "key1=value1 | key2=value2" 格式的字符串
     * 支持基本类型、自定义对象(反射获取字段)、HttpServletRequest/Response等特殊对象过滤
     */
    private String parseArgsToKeyValue(Object[] args) {
        if (args == null || args.length == 0) {
            return "无参数";
        }

        StringBuilder argsStr = new StringBuilder();
        for (Object arg : args) {
            if (arg == null) {
                argsStr.append("null | ");
                continue;
            }

            Class<?> argClass = arg.getClass();
            // 过滤掉HttpServletRequest/Response等无意义的对象
            if (arg instanceof HttpServletRequest || arg instanceof HttpServletResponse) {
                continue;
            }

            // 处理基本类型/字符串(直接拼接)
            if (argClass.isPrimitive() || arg instanceof String || arg instanceof Number || arg instanceof Boolean) {
                argsStr.append(arg).append(" | ");
            }
            // 处理自定义对象(反射获取字段和值)
            else {
                try {
                    Field[] fields = argClass.getDeclaredFields();
                    for (Field field : fields) {
                        field.setAccessible(true); // 允许访问私有字段
                        String fieldName = field.getName();
                        Object fieldValue = field.get(arg);
                        argsStr.append(fieldName).append("=").append(fieldValue).append(" | ");
                    }
                } catch (IllegalAccessException e) {
                    argsStr.append("解析对象失败:").append(argClass.getSimpleName()).append(" | ");
                }
            }
        }

        // 去掉最后一个多余的 " | "
        if (argsStr.length() > 0) {
            argsStr.delete(argsStr.length() - 3, argsStr.length());
        }
        return argsStr.toString();
    }



}


使用aop最大的好处就是, 不用修改业务代码。 我就也可以记录日志。



image.png


-02-26 15:19:53.349 [INFO ] java456.com.config.RequestAspect - 【请求开始】URL:/api/xcx/order/find/id | IP:111.0.233.126 | 请求方法:GET | 执行方法:java456.com.controller.xcx_api.API_XCX_Order_Controller.findById | 方法参数:[997, org.springframework.boot.web.servlet.support.ErrorPageFilter$ErrorWrapperResponse@3de721fb] | 用户信息:997
2026-02-26 15:19:53.391 [INFO ] java456.com.config.RequestAspect - 【请求返回】URL:/api/xcx/order/find/id | 返回值:{success=true, order=Order(id=997, state=1, dingjin=1200.00, yukuan=3588.00, amount=4788.00, projectListTotalJine=0.00, chengben=0.00, taocanChengben=0.00, projectChengben=0.00, tuiJine=null, youhui=588.00, chajia=588.00, xianjin=0.00, type=0, tuiId=778, orderNum=202602220010, personNum=12, jinbi=100, price=null, danPrice=null, fangChaNum=0, baoxian=0, shouhou=0, goDate=Thu Mar 05 00:00:00 CST 2026, remark=, xcxUserId=778, trueName=沈一凡, phone=13588872918, sfz=34050319830102063X, goodsId=51, goodsTaocanId=45, shuangNum=6, daNum=0, sanNum=0, danNum=0, payDateTime=Thu Feb 26 13:02:13 CST 2026, createDateTime=Sun Feb 22 17:25:32 CST 2026, updateDateTime=null, lng=116.2855070421007, lat=30.470388997395833, ip=114.104.105.213, address=安徽省安庆市太湖县, qr=/static/erweima/order/20260222/20260222172532.jpg, editInfo=null,2026-02-22 18:15_778_胡青松修改推荐人为自己,之前推荐人null,;用户id859用户姓名刘晓慧2026-02-26 12:53:41:优惠:0.00->588,优惠备注:->稍后补差价;用户id859用户姓名刘晓慧2026-02-26 12:56:57:差价:0.00->588,差价备注:->2补差, title=【杭州星海君澜酒店】以南宋文化为基础,纯中式红木中国风和江南时尚风情,2早4正2宿+棋牌+KTV,附近:塘栖古镇+杭州西湖, xcxQr=/static/xcx_qr/order/20260222/20260222172532724.jpg, openid=null, zfState=null, total_sum=null, order_date_list=null, jieSuanMingXi=null, xcxUser=XcxUser(id=778, trueName=胡青松, phone=18557518779, sex=0, openid=oAzSc7eY3-zIhmWXI3Car1n8ARhk, sfz=34050319830102063X, state=1, createDateTime=Fri Sep 26 13:43:44 CST 2025, updateDateTime=Sun Feb 15 16:49:19 CST 2026, remark=, headimgurl=/static/xcx_upload/xcx_user_head/20260124/b05fdeb5cc9c4da8b79b3d765e96db5d.jpeg, nav1=8,9, nav2=null, userId=null, jinbi=2800, permissions=order:xcx_edit, num=28, tuiId=null, bindDateTime=null, user=null, tuiUser=null), goodsTaoCan=GoodsTaoCan(id=45, date1=Thu Jan 01 00:00:00 CST 2026, date2=Thu Dec 31 00:00:00 CST 2026, orderNo=2, goodsId=51, days=2, zao=null, zheng=null, name=3天2晚, info=2早2正, price=399.00, personNum=10, state=1, danPrice=180.00, weeks=6, weekPrice=20.00, fangchaWeeks=6, fangchaWeeksPrice=200, chooseOne=0, type=0, parentId=null, date=null), goods=Goods(id=51, title=【杭州星海君澜酒店】以南宋文化为基础,纯中式红木中国风和江南时尚风情,2早4正2宿+棋牌+KTV,附近:塘栖古镇+杭州西湖, content=null, imageUrl=/static/upload_image/goods_cover/20251111/20251111162632.jpg, clickHit=null, state=null, isTop=null, goodsTypeId=null, userId=null, recommend=null, moon=, dan=null, tag=null, price=null, orderNo=null, createDateTime=null, updateDateTime=null, lng=null, lat=null, name=杭州星海君澜酒店, address=null, remark=null, baoxian=null, jinbi=null, xuzhi=null, yuJine=100.00, yuding=1, qrUrl=null, jingdian=null, sheshi=null, jiaotong=null, yule=null, fang=1,2,3, goodsBannerList=null, goodsTaoCanList=null, user=null, goodsType=null, goodsProjectPriceList=[], fangList=[{"name":"双床房","num":2,"select_num":0}, {"name":"大床房","num":2,"select_num":0}, {"name":"三人房","num":3,"select_num":0}]), tuiUser=XcxUser(id=778, trueName=胡青松, phone=18557518779, sex=0, openid=oAzSc7eY3-zIhmWXI3Car1n8ARhk, sfz=34050319830102063X, state=1, createDateTime=Fri Sep 26 13:43:44 CST 2025, updateDateTime=Sun Feb 15 16:49:19 CST 2026, remark=, headimgurl=/static/xcx_upload/xcx_user_head/20260124/b05fdeb5cc9c4da8b79b3d765e96db5d.jpeg, nav1=8,9, nav2=null, userId=null, jinbi=2800, permissions=order:xcx_edit, num=28, tuiId=null, bindDateTime=null, user=null, tuiUser=null), zfOderList=[ZfOrder(id=1730, state=1, orderNum=202602220010_04, jine=1200.00, type=0, backAmount=1200.00, orderId=997, goodsId=51, goodsTaocanId=45, tuiJine=null, payDateTime=Sun Feb 22 17:28:16 CST 2026, createDateTime=Sun Feb 22 17:28:03 CST 2026, openid=oAzSc7QErqTJZvgYEi_RJRIoCF1I, order=null, goods=null, goodsTaoCan=null), ZfOrder(id=1979, state=1, orderNum=202602220010_11, jine=3000.00, type=1, backAmount=3000.00, orderId=997, goodsId=51, goodsTaocanId=45, tuiJine=null, payDateTime=Thu Feb 26 12:55:20 CST 2026, createDateTime=Thu Feb 26 12:55:02 CST 2026, openid=oAzSc7TpQptWzQjs4I_vJmxn11ao, order=null, goods=null, goodsTaoCan=null), ZfOrder(id=1982, state=1, orderNum=202602220010_14, jine=588.00, type=1, backAmount=588.00, orderId=997, goodsId=51, goodsTaocanId=45, tuiJine=null, payDateTime=Thu Feb 26 13:02:13 CST 2026, createDateTime=Thu Feb 26 13:02:00 CST 2026, openid=oAzSc7TpQptWzQjs4I_vJmxn11ao, order=null, goods=null, goodsTaoCan=null)], refundList=[], orderDataList=[OrderData(id=118, state=null, jine=588.00, type=1, title=2补差, remark=null, orderId=997, createDateTime=Thu Feb 26 12:56:57 CST 2026), OrderData(id=117, state=null, jine=588.00, type=2, title=稍后补差价, remark=null, orderId=997, createDateTime=Thu Feb 26 12:53:42 CST 2026)], orderDayList=[OrderDay(id=2234, orderId=997, dayPrice=399.00, personNum=12, weekPrice=0.00, fangcha=0, danPrice=180.00, total=4788.00, goDate=Thu Mar 05 00:00:00 CST 2026, type=0), OrderDay(id=2235, orderId=997, dayPrice=0.00, personNum=12, weekPrice=0.00, fangcha=0, danPrice=180.00, total=0.00, goDate=Fri Mar 06 00:00:00 CST 2026, type=0)], orderProjectList=[], project_list=null, youhui_remark=null, chajia_remark=null)}
2026-02-26 15:19:53.392 [INFO ] java456.com.config.RequestAspect - 【请求结束】URL:/api/xcx/order/find/id
2026-02-26 15:19:55.715 [INFO ] java456.com.config.RequestAspect - 【请求开始】URL:/api/xcx/order/find/id | IP:125.120.13.83 | 请求方法:GET | 执行方法:java456.com.controller.xcx_api.API_XCX_Order_Controller.findById | 方法参数:[1060, org.springframework.boot.web.servlet.support.ErrorPageFilter$ErrorWrapperResponse@4db64a9f] | 用户信息:1060
2026-02-26 15:19:56.141 [INFO ] java456.com.config.RequestAspect - 【请求开始】URL:/api/xcx/order/find/id | IP:111.0.233.126 | 请求方法:GET | 执行方法:java456.com.controller.xcx_api.API_XCX_Order_Controller.findById | 方法参数:[997, org.springframework.boot.web.servlet.support.ErrorPageFilter$ErrorWrapperResponse@70e7d16b] | 用户信息:997
2026-02-26 15:19:56.400 [INFO ] java456.com.config.RequestAspect - 【请求返回】URL:/api/xcx/order/find/id | 返回值:{success=true, order=Order(id=1060, state=1, dingjin=0.00, yukuan=3992.00, amount=3992.00, projectListTotalJine=0.00, chengben=0.00, taocanChengben=0.00, projectChengben=0.00, tuiJine=null, youhui=0.00, chajia=0.00, xianjin=0.00, type=0, tuiId=778, orderNum=202602250009, personNum=8, jinbi=100, price=null, danPrice=null, fangChaNum=0, baoxian=0, shouhou=0, goDate=Wed Feb 25 00:00:00 CST 2026, remark=, xcxUserId=778, trueName=方美丽, phone=15397108123, sfz=34050319830102063X, goodsId=101, goodsTaocanId=133, shuangNum=4, daNum=0, sanNum=0, danNum=0, payDateTime=Wed Feb 25 10:32:50 CST 2026, createDateTime=Wed Feb 25 10:09:04 CST 2026, updateDateTime=null, lng=120.15068004557293, lat=30.15402683376736, ip=125.122.167.150, address=浙江省杭州市滨江区冠山路, qr=/static/erweima/order/20260225/20260225100904.jpg, editInfo=null;用户id:7_2026-02-25 11:10:推荐人id:null->778, title=【杭州白马湖建国饭店】2天1晚299元/人起●3天2晚449元/人起●棋牌畅玩●高品质五钻酒店, xcxQr=/static/xcx_qr/order/20260225/20260225100904802.jpg, openid=null, zfState=null, total_sum=null, order_date_list=null, jieSuanMingXi=null, xcxUser=XcxUser(id=778, trueName=胡青松, phone=18557518779, sex=0, openid=oAzSc7eY3-zIhmWXI3Car1n8ARhk, sfz=34050319830102063X, state=1, createDateTime=Fri Sep 26 13:43:44 CST 2025, updateDateTime=Sun Feb 15 16:49:19 CST 2026, remark=, headimgurl=/static/xcx_upload/xcx_user_head/20260124/b05fdeb5cc9c4da8b79b3d765e96db5d.jpeg, nav1=8,9, nav2=null, userId=null, jinbi=2800, permissions=order:xcx_edit, num=28, tuiId=null, bindDateTime=null, user=null, tuiUser=null), goodsTaoCan=GoodsTaoCan(id=133, date1=Thu Jan 01 00:00:00 CST 2026, date2=Thu Dec 31 00:00:00 CST 2026, orderNo=3, goodsId=101, days=2, zao=null, zheng=null, name=3天2晚(3正), info=2早3正, price=499.00, personNum=2, state=1, danPrice=125.00, weeks=null, weekPrice=null, fangchaWeeks=null, fangchaWeeksPrice=null, chooseOne=0, type=0, parentId=null, date=null), goods=Goods(id=101, title=【杭州白马湖建国饭店】2天1晚299元/人起●3天2晚449元/人起●棋牌畅玩●高品质五钻酒店, content=null, imageUrl=/static/upload_image/goods_cover/20250828/20250828031629.jpg, clickHit=null, state=null, isTop=null, goodsTypeId=null, userId=null, recommend=null, moon=, dan=null, tag=null, price=null, orderNo=null, createDateTime=null, updateDateTime=null, lng=null, lat=null, name=杭州白马湖建国饭店, address=null, remark=null, baoxian=null, jinbi=null, xuzhi=null, yuJine=100.00, yuding=1, qrUrl=null, jingdian=null, sheshi=null, jiaotong=null, yule=null, fang=1,2, goodsBannerList=null, goodsTaoCanList=null, user=null, goodsType=null, goodsProjectPriceList=[], fangList=[{"name":"双床房","num":2,"select_num":0}, {"name":"大床房","num":2,"select_num":0}]), tuiUser=XcxUser(id=778, trueName=胡青松, phone=18557518779, sex=0, openid=oAzSc7eY3-zIhmWXI3Car1n8ARhk, sfz=34050319830102063X, state=1, createDateTime=Fri Sep 26 13:43:44 CST 2025, updateDateTime=Sun Feb 15 16:49:19 CST 2026, remark=, headimgurl=/static/xcx_upload/xcx_user_head/20260124/b05fdeb5cc9c4da8b79b3d765e96db5d.jpeg, nav1=8,9, nav2=null, userId=null, jinbi=2800, permissions=order:xcx_edit, num=28, tuiId=null, bindDateTime=null, user=null, tuiUser=null), zfOderList=[ZfOrder(id=1871, state=1, orderNum=202602250009_05, jine=3992.00, type=2, backAmount=3992.00, orderId=1060, goodsId=101, goodsTaocanId=133, tuiJine=null, payDateTime=Wed Feb 25 10:32:50 CST 2026, createDateTime=Wed Feb 25 10:32:36 CST 2026, openid=oAzSc7UGDR-Ha47-xhNaarv2ywLI, order=null, goods=null, goodsTaoCan=null)], refundList=[], orderDataList=[], orderDayList=[OrderDay(id=1974, orderId=1060, dayPrice=499.00, personNum=8, weekPrice=0.00, fangcha=0, danPrice=125.00, total=3992.00, goDate=Wed Feb 25 00:00:00 CST 2026, type=0), OrderDay(id=1975, orderId=1060, dayPrice=0.00, personNum=8, weekPrice=0.00, fangcha=0, danPrice=125.00, total=0.00, goDate=Thu Feb 26 00:00:00 CST 2026, type=0)], orderProjectList=[], project_list=null, youhui_remark=null, chajia_remark=null)}
2026-02-26 15:19:56.400 [INFO ] java456.com.config.RequestAspect - 【请求结束】URL:/api/xcx/order/find/id
2026-02-26 15:19:57.222 [INFO ] java456.com.config.RequestAspect - 【请求返回】URL:/api/xcx/order/find/id | 返回值:{success=true, order=Order(id=997, state=1, dingjin=1200.00, yukuan=3588.00, amount=4788.00, projectListTotalJine=0.00, chengben=0.00, taocanChengben=0.00, projectChengben=0.00, tuiJine=null, youhui=588.00, chajia=588.00, xianjin=0.00, type=0, tuiId=778, orderNum=202602220010, personNum=12, jinbi=100, price=null, danPrice=null, fangChaNum=0, baoxian=0, shouhou=0, goDate=Thu Mar 05 00:00:00 CST 2026, remark=, xcxUserId=778, trueName=沈一凡, phone=13588872918, sfz=34050319830102063X, goodsId=51, goodsTaocanId=45, shuangNum=6, daNum=0, sanNum=0, danNum=0, payDateTime=Thu Feb 26 13:02:13 CST 2026, createDateTime=Sun Feb 22 17:25:32 CST 2026, updateDateTime=null, lng=116.2855070421007, lat=30.470388997395833, ip=114.104.105.213, address=安徽省安庆市太湖县, qr=/static/erweima/order/20260222/20260222172532.jpg, editInfo=null,2026-02-22 18:15_778_胡青松修改推荐人为自己,之前推荐人null,;用户id859用户姓名刘晓慧2026-02-26 12:53:41:优惠:0.00->588,优惠备注:->稍后补差价;用户id859用户姓名刘晓慧2026-02-26 12:56:57:差价:0.00->588,差价备注:->2补差, title=【杭州星海君澜酒店】以南宋文化为基础,纯中式红木中国风和江南时尚风情,2早4正2宿+棋牌+KTV,附近:塘栖古镇+杭州西湖, xcxQr=/static/xcx_qr/order/20260222/20260222172532724.jpg, openid=null, zfState=null, total_sum=null, order_date_list=null, jieSuanMingXi=null, xcxUser=XcxUser(id=778, trueName=胡青松, phone=18557518779, sex=0, openid=oAzSc7eY3-zIhmWXI3Car1n8ARhk, sfz=34050319830102063X, state=1, createDateTime=Fri Sep 26 13:43:44 CST 2025, updateDateTime=Sun Feb 15 16:49:19 CST 2026, remark=, headimgurl=/static/xcx_upload/xcx_user_head/20260124/b05fdeb5cc9c4da8b79b3d765e96db5d.jpeg, nav1=8,9, nav2=null, userId=null, jinbi=2800, permissions=order:xcx_edit, num=28, tuiId=null, bindDateTime=null, user=null, tuiUser=null), goodsTaoCan=GoodsTaoCan(id=45, date1=Thu Jan 01 00:00:00 CST 2026, date2=Thu Dec 31 00:00:00 CST 2026, orderNo=2, goodsId=51, days=2, zao=null, zheng=null, name=3天2晚, info=2早2正, price=399.00, personNum=10, state=1, danPrice=180.00, weeks=6, weekPrice=20.00, fangchaWeeks=6, fangchaWeeksPrice=200, chooseOne=0, type=0, parentId=null, date=null), goods=Goods(id=51, title=【杭州星海君澜酒店】以南宋文化为基础,纯中式红木中国风和江南时尚风情,2早4正2宿+棋牌+KTV,附近:塘栖古镇+杭州西湖, content=null, imageUrl=/static/upload_image/goods_cover/20251111/20251111162632.jpg, clickHit=null, state=null, isTop=null, goodsTypeId=null, userId=null, recommend=null, moon=, dan=null, tag=null, price=null, orderNo=null, createDateTime=null, updateDateTime=null, lng=null, lat=null, name=杭州星海君澜酒店, address=null, remark=null, baoxian=null, jinbi=null, xuzhi=null, yuJine=100.00, yuding=1, qrUrl=null, jingdian=null, sheshi=null, jiaotong=null, yule=null, fang=1,2,3, goodsBannerList=null, goodsTaoCanList=null, user=null, goodsType=null, goodsProjectPriceList=[], fangList=[{"name":"双床房","num":2,"select_num":0}, {"name":"大床房","num":2,"select_num":0}, {"name":"三人房","num":3,"select_num":0}]), tuiUser=XcxUser(id=778, trueName=胡青松, phone=18557518779, sex=0, openid=oAzSc7eY3-zIhmWXI3Car1n8ARhk, sfz=34050319830102063X, state=1, createDateTime=Fri Sep 26 13:43:44 CST 2025, updateDateTime=Sun Feb 15 16:49:19 CST 2026, remark=, headimgurl=/static/xcx_upload/xcx_user_head/20260124/b05fdeb5cc9c4da8b79b3d765e96db5d.jpeg, nav1=8,9, nav2=null, userId=null, jinbi=2800, permissions=order:xcx_edit, num=28, tuiId=null, bindDateTime=null, user=null, tuiUser=null), zfOderList=[ZfOrder(id=1730, state=1, orderNum=202602220010_04, jine=1200.00, type=0, backAmount=1200.00, orderId=997, goodsId=51, goodsTaocanId=45, tuiJine=null, payDateTime=Sun Feb 22 17:28:16 CST 2026, createDateTime=Sun Feb 22 17:28:03 CST 2026, openid=oAzSc7QErqTJZvgYEi_RJRIoCF1I, order=null, goods=null, goodsTaoCan=null), ZfOrder(id=1979, state=1, orderNum=202602220010_11, jine=3000.00, type=1, backAmount=3000.00, orderId=997, goodsId=51, goodsTaocanId=45, tuiJine=null, payDateTime=Thu Feb 26 12:55:20 CST 2026, createDateTime=Thu Feb 26 12:55:02 CST 2026, openid=oAzSc7TpQptWzQjs4I_vJmxn11ao, order=null, goods=null, goodsTaoCan=null), ZfOrder(id=1982, state=1, orderNum=202602220010_14, jine=588.00, type=1, backAmount=588.00, orderId=997, goodsId=51, goodsTaocanId=45, tuiJine=null, payDateTime=Thu Feb 26 13:02:13 CST 2026, createDateTime=Thu Feb 26 13:02:00 CST 2026, openid=oAzSc7TpQptWzQjs4I_vJmxn11ao, order=null, goods=null, goodsTaoCan=null)], refundList=[], orderDataList=[OrderData(id=118, state=null, jine=588.00, type=1, title=2补差, remark=null, orderId=997, createDateTime=Thu Feb 26 12:56:57 CST 2026), OrderData(id=117, state=null, jine=588.00, type=2, title=稍后补差价, remark=null, orderId=997, createDateTime=Thu Feb 26 12:53:42 CST 2026)], orderDayList=[OrderDay(id=2234, orderId=997, dayPrice=399.00, personNum=12, weekPrice=0.00, fangcha=0, danPrice=180.00, total=4788.00, goDate=Thu Mar 05 00:00:00 CST 2026, type=0), OrderDay(id=2235, orderId=997, dayPrice=0.00, personNum=12, weekPrice=0.00, fangcha=0, danPrice=180.00, total=0.00, goDate=Fri Mar 06 00:00:00 CST 2026, type=0)], orderProjectList=[], project_list=null, youhui_remark=null, chajia_remark=null)}
2026-02-26 15:19:57.222 [INFO ] java456.com.config.RequestAspect - 【请求结束】URL:/api/xcx/order/find/id
2026-02-26 15:19:58.728 [INFO ] java456.com.config.RequestAspect - 【请求开始】URL:/api/xcx/order/find/id | IP:125.120.13.83 | 请求方法:GET | 执行方法:java456.com.controller.xcx_api.API_XCX_Order_Controller.findById | 方法参数:[1060, org.springframework.boot.web.servlet.support.ErrorPageFilter$ErrorWrapperResponse@6793fa6d] | 用户信息:1060
2026-02-26 15:19:58.768 [INFO ] java456.com.config.RequestAspect - 【请求返回】URL:/api/xcx/order/find/id | 返回值:{success=true, order=Order(id=1060, state=1, dingjin=0.00, yukuan=3992.00, amount=3992.00, projectListTotalJine=0.00, chengben=0.00, taocanChengben=0.00, projectChengben=0.00, tuiJine=null, youhui=0.00, chajia=0.00, xianjin=0.00, type=0, tuiId=778, orderNum=202602250009, personNum=8, jinbi=100, price=null, danPrice=null, fangChaNum=0, baoxian=0, shouhou=0, goDate=Wed Feb 25 00:00:00 CST 2026, remark=, xcxUserId=778, trueName=方美丽, phone=15397108123, sfz=34050319830102063X, goodsId=101, goodsTaocanId=133, shuangNum=4, daNum=0, sanNum=0, danNum=0, payDateTime=Wed Feb 25 10:32:50 CST 2026, createDateTime=Wed Feb 25 10:09:04 CST 2026, updateDateTime=null, lng=120.15068004557293, lat=30.15402683376736, ip=125.122.167.150, address=浙江省杭州市滨江区冠山路, qr=/static/erweima/order/20260225/20260225100904.jpg, editInfo=null;用户id:7_2026-02-25 11:10:推荐人id:null->778, title=【杭州白马湖建国饭店】2天1晚299元/人起●3天2晚449元/人起●棋牌畅玩●高品质五钻酒店, xcxQr=/static/xcx_qr/order/20260225/20260225100904802.jpg, openid=null, zfState=null, total_sum=null, order_date_list=null, jieSuanMingXi=null, xcxUser=XcxUser(id=778, trueName=胡青松, phone=18557518779, sex=0, openid=oAzSc7eY3-zIhmWXI3Car1n8ARhk, sfz=34050319830102063X, state=1, createDateTime=Fri Sep 26 13:43:44 CST 2025, updateDateTime=Sun Feb 15 16:49:19 CST 2026, remark=, headimgurl=/static/xcx_upload/xcx_user_head/20260124/b05fdeb5cc9c4da8b79b3d765e96db5d.jpeg, nav1=8,9, nav2=null, userId=null, jinbi=2800, permissions=order:xcx_edit, num=28, tuiId=null, bindDateTime=null, user=null, tuiUser=null), goodsTaoCan=GoodsTaoCan(id=133, date1=Thu Jan 01 00:00:00 CST 2026, date2=Thu Dec 31 00:00:00 CST 2026, orderNo=3, goodsId=101, days=2, zao=null, zheng=null, name=3天2晚(3正), info=2早3正, price=499.00, personNum=2, state=1, danPrice=125.00, weeks=null, weekPrice=null, fangchaWeeks=null, fangchaWeeksPrice=null, chooseOne=0, type=0, parentId=null, date=null), goods=Goods(id=101, title=【杭州白马湖建国饭店】2天1晚299元/人起●3天2晚449元/人起●棋牌畅玩●高品质五钻酒店, content=null, imageUrl=/static/upload_image/goods_cover/20250828/20250828031629.jpg, clickHit=null, state=null, isTop=null, goodsTypeId=null, userId=null, recommend=null, moon=, dan=null, tag=null, price=null, orderNo=null, createDateTime=null, updateDateTime=null, lng=null, lat=null, name=杭州白马湖建国饭店, address=null, remark=null, baoxian=null, jinbi=null, xuzhi=null, yuJine=100.00, yuding=1, qrUrl=null, jingdian=null, sheshi=null, jiaotong=null, yule=null, fang=1,2, goodsBannerList=null, goodsTaoCanList=null, user=null, goodsType=null, goodsProjectPriceList=[], fangList=[{"name":"双床房","num":2,"select_num":0}, {"name":"大床房","num":2,"select_num":0}]), tuiUser=XcxUser(id=778, trueName=胡青松, phone=18557518779, sex=0, openid=oAzSc7eY3-zIhmWXI3Car1n8ARhk, sfz=34050319830102063X, state=1, createDateTime=Fri Sep 26 13:43:44 CST 2025, updateDateTime=Sun Feb 15 16:49:19 CST 2026, remark=, headimgurl=/static/xcx_upload/xcx_user_head/20260124/b05fdeb5cc9c4da8b79b3d765e96db5d.jpeg, nav1=8,9, nav2=null, userId=null, jinbi=2800, permissions=order:xcx_edit, num=28, tuiId=null, bindDateTime=null, user=null, tuiUser=null), zfOderList=[ZfOrder(id=1871, state=1, orderNum=202602250009_05, jine=3992.00, type=2, backAmount=3992.00, orderId=1060, goodsId=101, goodsTaocanId=133, tuiJine=null, payDateTime=Wed Feb 25 10:32:50 CST 2026, createDateTime=Wed Feb 25 10:32:36 CST 2026, openid=oAzSc7UGDR-Ha47-xhNaarv2ywLI, order=null, goods=null, goodsTaoCan=null)], refundList=[], orderDataList=[], orderDayList=[OrderDay(id=1974, orderId=1060, dayPrice=499.00, personNum=8, weekPrice=0.00, fangcha=0, danPrice=125.00, total=3992.00, goDate=Wed Feb 25 00:00:00 CST 2026, type=0), OrderDay(id=1975, orderId=1060, dayPrice=0.00, personNum=8, weekPrice=0.00, fangcha=0, danPrice=125.00, total=0.00, goDate=Thu Feb 26 00:00:00 CST 2026, type=0)], orderProjectList=[], project_list=null, youhui_remark=null, chajia_remark=null)}
2026-02-26 15:19:58.768 [INFO ] java456.com.config.RequestAspect - 【请求结束】URL:/api/xcx/order/find/id



联系站长

站长微信:xiaomao0055

站长QQ:14496453