xin
2025-07-15 d264c42bfbdad92d0af17833482cdb84b1c4bcf9
接单插入骑手信息和订单门店地址
7 files modified
44 ■■■■ changed files
oying-system/src/main/java/com/oying/modules/sh/domain/Order.java 12 ●●●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/sh/mapper/OrderMapper.java 2 ●●●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/sh/service/OrderOperationLogService.java 2 ●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/sh/service/impl/OrderAddressSnapshotServiceImpl.java 2 ●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/sh/service/impl/OrderOperationLogServiceImpl.java 3 ●●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/sh/service/impl/OrderServiceImpl.java 10 ●●●● patch | view | raw | blame | history
oying-system/src/main/resources/mapper/sh/OrderMapper.xml 13 ●●●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/sh/domain/Order.java
@@ -97,6 +97,18 @@
    private String storeLogo;
    @NotBlank
    @ApiModelProperty(value = "门店详细地址")
    private String storeAddress;
    @NotNull
    @ApiModelProperty(value = "门店经度")
    private BigDecimal storeLongitude;
    @NotNull
    @ApiModelProperty(value = "门店纬度")
    private BigDecimal storeLatitude;
    @NotBlank
    @ApiModelProperty(value = "描述")
    private String orderDescribe;
oying-system/src/main/java/com/oying/modules/sh/mapper/OrderMapper.java
@@ -31,4 +31,6 @@
    void updateCloseStatus(String orderNum, String payState, String payMessage);
    void updateOrderStatus(String orderNum, Integer key, String value);
    void updateRider(String orderNum, Long riderId, String phone, String cardName);
}
oying-system/src/main/java/com/oying/modules/sh/service/OrderOperationLogService.java
@@ -36,7 +36,7 @@
    /**
     * 创建
     */
    void create(OrderResponse response, OrderStatusEnum statusEnum);
    void create(OrderResponse response, OrderStatusEnum statusEnum, String cardName);
    /**
    * 编辑
oying-system/src/main/java/com/oying/modules/sh/service/impl/OrderAddressSnapshotServiceImpl.java
@@ -80,7 +80,7 @@
            map.put("详细地址", orderAddressSnapshot.getDetail());
            map.put("经度", orderAddressSnapshot.getLongitude());
            map.put("纬度", orderAddressSnapshot.getLatitude());
            map.put("地址标签(家/公司/学校等)", orderAddressSnapshot.getTag());
            map.put("地址标签", orderAddressSnapshot.getTag());
            list.add(map);
        }
        FileUtil.downloadExcel(list, response);
oying-system/src/main/java/com/oying/modules/sh/service/impl/OrderOperationLogServiceImpl.java
@@ -52,7 +52,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void create(OrderResponse response, OrderStatusEnum statusEnum) {
    public void create(OrderResponse response, OrderStatusEnum statusEnum, String cardName) {
        String userType = ConstantsKey.BUYER;
        switch (statusEnum) {
            case ZERO:
@@ -66,6 +66,7 @@
                userType = ConstantsKey.MERCHANT;
                break;
            case THREE:
                orderMapper.updateRider(response.getOrder().getOrderNum(), SecurityUtils.getCurrentUserId(), SecurityUtils.getCurrentUsername(), cardName);
            case FIVE:
            case SIX:
            case SEVEN:
oying-system/src/main/java/com/oying/modules/sh/service/impl/OrderServiceImpl.java
@@ -137,6 +137,9 @@
        order.setStoreId(submit.getStoreId());
        order.setStoreName(store.getStoreName());
        order.setStoreLogo(store.getLogoImageUrl());
        order.setStoreAddress(store.getAddress());
        order.setStoreLongitude(BigDecimal.valueOf(store.getLongitude()));
        order.setStoreLatitude(BigDecimal.valueOf(store.getLatitude()));
        order.setOrderDescribe(DESCRIBE + submit.getStoreId());
        order.setOriginalPrice(amount);
        order.setPaidPrice(amount);
@@ -167,6 +170,7 @@
        UserAddress address = userAddressService.getById(submit.getAddressId());
        OrderAddressSnapshot addressSnapshot = getOrderAddressSnapshot(orderNum, address);
        addressSnapshotService.save(addressSnapshot);
        orderMapper.insert(order);
        productSnapshotService.saveBatch(snapshots);
@@ -174,7 +178,7 @@
        order.setProductSnapshots(new HashSet<>(snapshots));
        OrderResponse response = new OrderResponse(order, addressSnapshot, null);
        operationLogService.create(response, OrderStatusEnum.ZERO);
        operationLogService.create(response, OrderStatusEnum.ZERO, null);
        return order;
    }
@@ -251,7 +255,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void operationLog(OrderResponse order, OrderStatusEnum stateEnum) {
        operationLogService.create(order, stateEnum);
        operationLogService.create(order, stateEnum, null);
    }
    @Override
@@ -285,7 +289,7 @@
                swiftPassService.closeOrder(orderNum, anEnum);
                break;
        }
        operationLogService.create(response, OrderStatusEnum.NINE);
        operationLogService.create(response, OrderStatusEnum.NINE, null);
        orderMapper.updateCloseStatus(orderNum, PayStateEnum.CLOSED.getKey(), PayStateEnum.CLOSED.getValue());
    }
oying-system/src/main/resources/mapper/sh/OrderMapper.xml
@@ -16,6 +16,9 @@
        <result column="store_id" property="storeId"/>
        <result column="store_name" property="storeName"/>
        <result column="store_logo" property="storeLogo"/>
        <result column="store_address" property="storeAddress"/>
        <result column="store_longitude" property="storeLongitude"/>
        <result column="store_latitude" property="storeLatitude"/>
        <result column="order_describe" property="orderDescribe"/>
        <result column="order_original_price" property="originalPrice"/>
        <result column="order_paid_price" property="paidPrice"/>
@@ -61,7 +64,8 @@
    <sql id="Base_Column_List">
        o.order_id, o.order_num, o.order_store_num, o.order_status, o.order_status_describe,
        o.order_remark, o.order_time, o.send_price, o.send_type, o.user_id, o.username, o.store_id,
        o.store_name, o.store_logo, o.order_describe, o.original_price order_original_price, o.paid_price order_paid_price,
        o.store_name, o.store_logo, o.store_address, o.store_longitude, o.store_latitude,
        o.order_describe, o.original_price order_original_price, o.paid_price order_paid_price,
        o.actually_pay_price order_actually_pay_price, o.pay_state order_pay_state, o.pay_message, o.pay_type, o.pay_time, o.expire_time,
        o.openid, o.app_id, o.timestamp, o.nonce_str, o.package_val, o.sign_type, o.pay_sign,
        o.create_by, o.create_time, o.update_by, o.update_time, o.rider_id, o.rider_phone, o.rider_name
@@ -147,6 +151,13 @@
            order_status_describe = #{value}
        where order_num = #{orderNum}
    </update>
    <update id="updateRider">
        update sh_order
        set rider_id    = #{riderId},
            rider_phone = #{phone},
            rider_name  = #{cardName}
        where order_num = #{orderNum}
    </update>
    <select id="findAll" resultMap="BaseResultMap">
        select o.*,