浏览代码

海博订单模块

fubojin 6 天之前
父节点
当前提交
fd4a039d5e

+ 8 - 0
yami-shop-bean/src/main/java/com/yami/shop/bean/param/OrderParam.java

@@ -41,6 +41,14 @@ public class OrderParam {
      * 订单状态 参考com.yami.shop.bean.enums.OrderStatus
      */
     @ApiModelProperty("订单状态 1:待付款 2:待发货 3:待收货 4:待评价 5:成功 6:失败 7:待成团")
+    //'海博订单状态:0-待支付,
+    // 20-订单已接单(待拣货),
+    // 30-订单待配送(拣货完成/自提类订单为待自提),
+    // 40-订单配送中 ,
+    // 50-订单取消待审核,
+    // 60-订单已取消,
+    // 70-订单已送达,
+    // 80-订单已完成'
     private Integer status;
 
 //    @ApiModelProperty("付款方式 0:积分支付 1:微信支付 2:支付宝 3:微信扫码支付 4:微信H5支付 5:微信公众号支付 6:支付宝H5支付 7:支付宝APP支付 8:微信APP支付")

+ 1 - 1
yami-shop-platform/src/main/java/com/yami/shop/platform/task/OrderRefundTask.java

@@ -173,7 +173,7 @@ public class OrderRefundTask {
                         order.setOrderId(orderRefundDto.getOrderId());
                         // 更新到发货状态
                         Date date = new Date();
-                        order.setStatus(OrderStatus.CONSIGNMENT.value());
+                        order.setHbOrderStatus(OrderStatus.CONSIGNMENT.value());
                         order.setUpdateTime(date);
                         order.setDvyTime(date);
                         Integer type = null;

+ 2 - 2
yami-shop-platform/src/main/java/com/yami/shop/platform/task/OrderTask.java

@@ -135,10 +135,10 @@ public class OrderTask {
 //        List<Order> orders =orderService.list(new QueryWrapper<Order>().lambda().like(Order::getOrderNumber,"1879830276981526528"));
         for (Order order:orders){
             //创建物流订单
-            if (!Objects.equals(order.getStatus(), OrderStatus.PADYED.value()) && Objects.equals(order.getDvyType(), DvyType.FETCH.value())){
+            if (!Objects.equals(order.getHbOrderStatus(), OrderStatus.PADYED.value()) && Objects.equals(order.getDvyType(), DvyType.FETCH.value())){
                 System.out.println("订单不处于已付款状态,无法进行发货");
                 continue;
-            }else if (!Objects.equals(order.getStatus(), OrderStatus.PADYED.value())){
+            }else if (!Objects.equals(order.getHbOrderStatus(), OrderStatus.PADYED.value())){
                 System.out.println("订单不处于待发货状态,无法进行发货");
                 continue;
             }

+ 2 - 1
yami-shop-service/src/main/java/com/yami/shop/service/impl/ShopCategoryServiceImpl.java

@@ -60,7 +60,8 @@ public class ShopCategoryServiceImpl extends ServiceImpl<ShopCategoryMapper, Sho
                 .eq(ShopCategory::getIsDelete, 0)
                 .eq(shopId != null, ShopCategory::getShopId, shopId));
         // 构建树形结构
-        return buildCategoryTree(shopCategories, "0"); // 假设根节点的parentCode为"0"
+        return shopCategories; // 假设根节点的parentCode为"0"
+//        return buildCategoryTree(shopCategories, "0"); // 假设根节点的parentCode为"0"
     }
 
     /**

+ 28 - 28
yami-shop-service/src/main/resources/mapper/OrderMapper.xml

@@ -11,7 +11,7 @@
         <result column="actual_total" jdbcType="DECIMAL" property="actualTotal"/>
         <result column="pay_type" jdbcType="INTEGER" property="payType"/>
         <result column="remarks" jdbcType="VARCHAR" property="remarks"/>
-        <result column="status" jdbcType="INTEGER" property="status"/>
+        <result column="hb_order_status" jdbcType="INTEGER" property="hbOrderStatus"/>
         <result column="dvy_type" jdbcType="VARCHAR" property="dvyType"/>
         <result column="dvy_id" jdbcType="BIGINT" property="dvyId"/>
         <result column="dvy_flow_id" jdbcType="VARCHAR" property="dvyFlowId"/>
@@ -84,7 +84,6 @@
         <result column="actual_total" jdbcType="DECIMAL" property="actualTotal"/>
         <result column="pay_type" jdbcType="INTEGER" property="payType"/>
         <result column="remarks" jdbcType="VARCHAR" property="remarks"/>
-        <result column="status" jdbcType="INTEGER" property="status"/>
         <result column="dvy_type" jdbcType="VARCHAR" property="dvyType"/>
         <result column="dvy_id" jdbcType="BIGINT" property="dvyId"/>
         <result column="dvy_flow_id" jdbcType="VARCHAR" property="dvyFlowId"/>
@@ -99,6 +98,7 @@
         <result column="finally_time" jdbcType="TIMESTAMP" property="finallyTime"/>
         <result column="cancel_time" jdbcType="TIMESTAMP" property="cancelTime"/>
         <result column="is_payed" jdbcType="BIT" property="isPayed"/>
+        <result column="hb_order_status" jdbcType="INTEGER" property="hbOrderStatus"/>
         <result column="delete_status" jdbcType="INTEGER" property="deleteStatus"/>
         <result column="refund_status" jdbcType="INTEGER" property="refundStatus"/>
         <result column="order_type" jdbcType="INTEGER" property="orderType"/>
@@ -139,7 +139,7 @@
         <result column="actual_total" jdbcType="DECIMAL" property="actualTotal"/>
         <result column="pay_type" jdbcType="INTEGER" property="payType"/>
         <result column="remarks" jdbcType="VARCHAR" property="remarks"/>
-        <result column="status" jdbcType="INTEGER" property="status"/>
+        <result column="hb_order_status" jdbcType="INTEGER" property="hbOrderStatus"/>
         <result column="dvy_type" jdbcType="VARCHAR" property="dvyType"/>
         <result column="dvy_id" jdbcType="BIGINT" property="dvyId"/>
         <result column="nick_name" jdbcType="BIGINT" property="nickName"/>
@@ -212,19 +212,19 @@
     select o.*,oi.*,tor.return_money_sts,oi.prod_name oi_prod_name,oi.actual_total as oi_actual_total from tz_order o
       join tz_order_item oi on o.order_number = oi.order_number
       left join tz_order_refund tor on tor.order_id = o.order_id
-    where o.status = #{orderStatus} and (refund_status IS NULL OR o.refund_status &lt;&gt; 1)
+    where o.hb_order_status = #{orderStatus} and (refund_status IS NULL OR o.refund_status &lt;&gt; 1)
     and o.update_time &lt; #{lessThanUpdateTime}
   </select>
 
     <update id="cancelOrders">
-        update tz_order set `status`=6,cancel_time = NOW(),update_time=NOW()  where order_id in
+        update tz_order set `hb_order_status`=60,cancel_time = NOW(),update_time=NOW()  where order_id in
         <foreach collection="orders" item="order" open="(" close=")" separator=",">
             #{order.orderId}
         </foreach>
     </update>
 
     <update id="receiptOrder">
-        update tz_order set `status`=5,finally_time = NOW(),update_time=NOW() where order_id in
+        update tz_order set `hb_order_status`=80,finally_time = NOW(),update_time=NOW() where order_id in
         <foreach collection="orders" item="order" open="(" close=")" separator=",">
             #{order.orderId}
         </foreach>
@@ -239,7 +239,7 @@
     </update>
 
     <select id="listOrdersDetialByOrder" resultMap="orderAndOrderItemAndUserAddrMap">
-        select o.*,oi.*,oi.prod_name as item_prod_name,o.prod_name as order_prod_name,uao.* ,oi.status as oi_status
+        select o.*,oi.*,oi.prod_name as item_prod_name,o.prod_name as order_prod_name,uao.* ,oi.hb_order_status as oi_status
         from tz_order o
         left join tz_order_item oi on o.order_number = oi.order_number
         left join tz_user_addr_order uao on o.addr_order_id = uao.addr_order_id
@@ -251,15 +251,15 @@
         <if test="order.orderNumber != null and order.orderNumber != ''">
             and o.order_number like concat('%',#{order.orderNumber},'%')
         </if>
-        <if test="order.status != null">
-            and o.status = #{order.status}
+        <if test="order.hb_order_status != null">
+            and o.hb_order_status = #{order.orderStatus}
         </if>
         <if test="order.shopId != null">
             and o.shop_id = #{order.shopId}
         </if>
         <if test="order.isPayed != null">
             and o.is_payed = #{order.isPayed}
-            and o.status != 6
+            and o.hb_order_status != 60
         </if>
         <if test="startTime != null">
             and o.create_time &gt; #{startTime}
@@ -362,7 +362,7 @@
 
     <select id="listOrdersDetialByOrderParam" resultMap="orderAndOrderItemAndUserAddrMap">
         SELECT *,oi.prod_name as item_prod_name,oi.actual_total as oi_actual_total,IF(r.refund_type = 2,r.return_money_sts,IF(ar.refund_type = 1,ar.return_money_sts,NULL)) AS oi_return_money_sts,
-        temp.prod_name as order_prod_name,oi.status as oi_status, IF(os.pay_score IS NULL,0,os.pay_score) as pay_score
+        temp.prod_name as order_prod_name,oi.hb_order_status as oi_status, IF(os.pay_score IS NULL,0,os.pay_score) as pay_score
         FROM
         (
         SELECT o.*,sd.shop_name,uao.receiver,uao.mobile,u.user_mobile,u.nick_name FROM tz_order o
@@ -389,8 +389,8 @@
 <!--            <if test="orderParam.type!=null and orderParam.type==6 and orderParam.content != null and orderParam.content != ''">-->
 <!--                and u.dvy_flow_id = #{orderParam.content}-->
 <!--            </if>-->
-            <if test="orderParam.status != null">
-                and o.status = #{orderParam.status}
+            <if test="orderParam.hb_order_status != null">
+                and o.hb_order_status = #{orderParam.hbOrderStatus}
             </if>
 <!--            <if test="orderParam.payType != null">-->
 <!--                and o.pay_type = #{orderParam.payType}-->
@@ -400,7 +400,7 @@
             </if>
             <if test="orderParam.isPayed != null">
                 and o.is_payed = #{orderParam.isPayed}
-                and o.status != 6
+                and o.hb_order_status != 60
             </if>
             <if test="orderParam.startTime != null">
                 and o.create_time &gt; #{orderParam.startTime}
@@ -455,15 +455,15 @@
             <if test="orderParam.orderNumber != null and orderParam.orderNumber != ''">
                 and o.order_number = #{orderParam.orderNumber}
             </if>
-            <if test="orderParam.status != null">
-                and o.status = #{orderParam.status}
+            <if test="orderParam.orderStatus != null">
+                and o.hb_order_status = #{orderParam.orderStatus}
             </if>
             <if test="orderParam.shopId != null">
                 and o.shop_id = #{orderParam.shopId}
             </if>
             <if test="orderParam.isPayed != null">
                 and o.is_payed = #{orderParam.isPayed}
-                and o.status != 6
+                and o.hb_order_status != 60
             </if>
             <if test="orderParam.startTime != null">
                 and o.create_time &gt; #{orderParam.startTime}
@@ -504,12 +504,12 @@
             count(o.order_number) as expense_number,
             ifnull(SUM(o.actual_total),0) as expense_amount
         from tz_order o
-        where o.user_id=#{userId} and o.shop_id = #{shopId} and (o.status = 4 or o.status = 5)
+        where o.user_id=#{userId} and o.shop_id = #{shopId} and (o.hb_order_status = 45 or o.hb_order_status = 80)
     </select>
 
     <select id="listMyOrderByUserIdAndStatus" resultMap="MyOrderMap">
         SELECT
-        o.order_type,o.actual_total,o.status,o.order_number,o.freight_amount,o.create_time,o.order_id,
+        o.order_type,o.actual_total,o.hb_order_status,o.order_number,o.freight_amount,o.create_time,o.order_id,
         o.hb_order_status,
         o.hb_logistic_status,
         o.offset_points,
@@ -571,12 +571,12 @@
     <select id="getOrderCount" resultType="com.yami.shop.bean.app.dto.OrderCountData">
         SELECT
         COUNT(o.order_id) all_count,
-        COUNT( CASE WHEN o.status = 1 THEN o.order_id ELSE NULL END ) AS unPay,
-        COUNT( CASE WHEN o.status = 2 THEN o.order_id ELSE NULL END ) AS payed,
-        COUNT( CASE WHEN o.status = 3 THEN o.order_id ELSE NULL END ) AS consignment,
-        COUNT( CASE WHEN o.status = 4 THEN o.order_id ELSE NULL END ) AS confirm,
-        COUNT( CASE WHEN o.status = 5 THEN o.order_id ELSE NULL END ) AS success,
-        COUNT( CASE WHEN o.status = 6 THEN o.order_id ELSE NULL END ) AS `close`
+        COUNT( CASE WHEN o.hbOrderStatus = 0 THEN o.order_id ELSE NULL END ) AS unPay,
+        COUNT( CASE WHEN o.hbOrderStatus = 20 THEN o.order_id ELSE NULL END ) AS payed,
+        COUNT( CASE WHEN o.hbOrderStatus = 30 THEN o.order_id ELSE NULL END ) AS consignment,
+        COUNT( CASE WHEN o.hbOrderStatus = 40 THEN o.order_id ELSE NULL END ) AS confirm,
+        COUNT( CASE WHEN o.hbOrderStatus = 50 THEN o.order_id ELSE NULL END ) AS success,
+        COUNT( CASE WHEN o.hbOrderStatus = 60 THEN o.order_id ELSE NULL END ) AS `close`
         FROM tz_order o
         WHERE o.user_id =#{userId} AND o.delete_status = 0
     </select>
@@ -586,7 +586,7 @@
             tz_seckill s ON s.seckill_id = so.seckill_id
                               AND (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(so.`create_time`))/60 &gt; s.`max_cancel_time` and so.state = 0 ) t
             ON o.order_number = t.order_number
-        SET o.`status`=6,o.cancel_time = NOW(),o.update_time=NOW()
+        SET o.`status`=60,o.cancel_time = NOW(),o.update_time=NOW()
     </update>
 
     <update id="updateToWaitGroup">
@@ -594,7 +594,7 @@
     </update>
 
     <update id="updateToWaitDelivery">
-        UPDATE tz_order SET `status` = 2, `update_time` = NOW()
+        UPDATE tz_order SET `hb_order_status` = 20, `update_time` = NOW()
         WHERE `order_number` IN
          (
            SELECT order_number FROM
@@ -618,7 +618,7 @@
     <select id="hasBuySuccessProd" resultType="java.lang.Integer">
         select count(*) from tz_order_item oi
                  join tz_order o on o.order_number = oi.order_number
-        where o.user_id=#{userId} and o.status = 5 and oi.prod_id = #{prodId}
+        where o.user_id=#{userId} and o.hb_order_status = 50 and oi.prod_id = #{prodId}
     </select>
 
     <select id="listMyOrderByParams" resultMap="MyOrderMap">

+ 2 - 2
yami-shop-user/yami-shop-user-platform/src/main/java/com/yami/shop/user/platform/controller/ScoreOrderController.java

@@ -107,7 +107,7 @@ public class ScoreOrderController {
         if (Objects.equals(order.getRefundStatus(), RefundStatusEnum.APPLY.value())) {
             throw new GlobalException("该订单有退款信息正在处理当中,请处理完毕之后再进行发货的操作!");
         }
-        if (!Objects.equals(order.getStatus(), OrderStatus.PADYED.value())){
+        if (!Objects.equals(order.getHbOrderStatus(), OrderStatus.PADYED.value())){
             throw new GlobalException("订单不处于待发货状态,无法进行发货");
         }
 
@@ -117,7 +117,7 @@ public class ScoreOrderController {
         orderParam.setDvyFlowId(deliveryOrderParam.getDvyFlowId());
         orderParam.setDvyTime(new Date());
         orderParam.setUpdateTime(new Date());
-        orderParam.setStatus(OrderStatus.CONSIGNMENT.value());
+        orderParam.setHbOrderStatus(OrderStatus.CONSIGNMENT.value());
         orderParam.setUserId(order.getUserId());
 
         orderService.delivery(orderParam);