xin
2025-08-28 bb05129db40db646a59ddc90cb097edf063140c1
订单-sql优化
4 files modified
11 ■■■■ changed files
oying-system/src/main/java/com/oying/modules/hwc/service/impl/CallbackServiceImpl.java 3 ●●●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/sh/service/impl/OrderReturnServiceImpl.java 4 ●●● patch | view | raw | blame | history
oying-system/src/main/resources/mapper/sh/OrderOperationLogMapper.xml 2 ●●● patch | view | raw | blame | history
oying-system/src/main/resources/mapper/sh/OrderReturnMapper.xml 2 ●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/hwc/service/impl/CallbackServiceImpl.java
@@ -1,6 +1,5 @@
package com.oying.modules.hwc.service.impl;
import com.oying.exception.BadRequestException;
import com.oying.modules.hwc.service.CallbackService;
import com.oying.modules.hwc.utils.SignUtil;
import com.oying.modules.hwc.utils.XmlUtils;
@@ -78,7 +77,6 @@
            response.getWriter().write(respString);
        } catch (Exception e) {
            log.error("汇旺财支付回调失败:{}", map.toString());
            throw new BadRequestException("操作失败,原因:" + e.getMessage());
        }
    }
@@ -114,7 +112,6 @@
            response.getWriter().write(respString);
        } catch (Exception e) {
            log.error("汇旺财退款回调失败:{}", map.toString());
            System.out.println("操作失败,原因:" + e.getMessage());
        }
    }
}
oying-system/src/main/java/com/oying/modules/sh/service/impl/OrderReturnServiceImpl.java
@@ -79,7 +79,8 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public synchronized void create(ReturnOrder resources) {
        Order order = orderService.queryByOrderNum(resources.getOrderNum());
        OrderResponse response = orderService.getByOrderNum(resources.getOrderNum());
        Order order = response.getOrder();
        if (order == null) {
            throw new BadRequestException("订单不存在!");
        }
@@ -137,6 +138,7 @@
            }
        }
        productSnapshotService.saveBatch(productSnapshots);
        operationLogService.create(response, OrderStatusEnum.FIFTEEN, null);
    }
    private static OrderReturnProductSnapshot getSnapshot(OrderProductSnapshot snapshot, String returnNum) {
oying-system/src/main/resources/mapper/sh/OrderOperationLogMapper.xml
@@ -44,7 +44,7 @@
        from sh_order_operation_log
        where order_num = #{orderNum}
        <if test="type!= null and type != ''">
            operation_type = #{type}
           and operation_type = #{type}
        </if>
        order by log_id
    </select>
oying-system/src/main/resources/mapper/sh/OrderReturnMapper.xml
@@ -158,7 +158,7 @@
        ) o
        left join sh_order_return_product_snapshot as p on p.return_num = o.return_num
        <include refid="Where_Sql_Product"/>
        order by o.order_id desc
        order by o.return_id desc
    </select>
    <select id="getByReturnNum" resultMap="BaseResultMap">
        select o.* from ( select