夏文涛 1 год назад
Родитель
Сommit
373d6e5492

+ 3 - 3
src/main/java/com/sqx/modules/order/controller/app/AppOrderController.java

@@ -203,11 +203,11 @@ public class AppOrderController {
         return appOrderService.emptyShoppingTrolley(userId, shopId);
     }
 
-    @Login
+
     @ApiOperation("待取餐/配送")
     @GetMapping(value = "/waitTakeFood")
-    public Result waitTakeFood(@RequestAttribute Long userId, Integer orderType, Integer page, Integer limit, Integer status){
-
+    public Result waitTakeFood( Integer orderType, Integer page, Integer limit, Integer status){
+        Long userId = 2078L;
         return appOrderService.waitTakeFood(userId, orderType, page, limit, status);
     }
 

+ 29 - 19
src/main/resources/mapper/order/OrderMapper.xml

@@ -92,7 +92,7 @@
         tiu.user_name as riderNickName,tiu.phone as riderPhone,ti.indent_id as indentId,ti.is_rider as isRider,
         ti.rider_user_id as riderUserId, tcu.money as couponMoney,
         apr.discount_amount as activityDiscountAmount, ai.title activityTitle,tiu.rider_station_id as riderStationId,
-        (select st.shop_type_name from shop_type st where  st.id =gs.shop_type_id ) as shopTypeName,
+        (select st.shop_type_name from shop_type st where st.id =gs.shop_type_id ) as shopTypeName,
         (case when tcu.shop_id =0 then '平台' else gs2.shop_name end) as couponTypeRemark,
         pd.trade_no as transactionId
         from tb_order tor
@@ -175,8 +175,8 @@
         tiu.nick_name as riderNickName,tiu.phone as riderPhone,ti.indent_id as indentId,ti.is_rider as isRider,
         ti.rider_user_id as riderUserId, tcu.money as couponMoney,
         apr.discount_amount as activityDiscountAmount, ai.title activityTitle,ogg.detail,ogg.sumPrice,
-        (select rs.station_name from rider_station rs where  rs.id =tiu.rider_station_id ) as stationName,
-        (select st.shop_type_name from shop_type st where  st.id =gs.shop_type_id ) as shopTypeName,
+        (select rs.station_name from rider_station rs where rs.id =tiu.rider_station_id ) as stationName,
+        (select st.shop_type_name from shop_type st where st.id =gs.shop_type_id ) as shopTypeName,
         (case when tcu.shop_id =0 then '平台' else gs2.shop_name end) as couponTypeRemark
         from tb_order tor
         left join tb_user tu on tor.user_id = tu.user_id
@@ -186,7 +186,8 @@
         left join tb_coupon_user tcu on tor.coupon_id = tcu.id
         left join activity_part_record apr on apr.order_id = tor.order_id
         left join activity ai on ai.id = apr.activity_id
-        left join (  select @a:=0,order_id ,group_concat(@a:=@a+1,".商品名:",goods_name,",数量:",goods_num,",规格:",sku_message) detail,sum(goods_num*goods_price) sumPrice  from order_goods og group by order_id
+        left join ( select @a:=0,order_id ,group_concat(@a:=@a+1,".商品名:",goods_name,",数量:",goods_num,",规格:",sku_message)
+        detail,sum(goods_num*goods_price) sumPrice from order_goods og group by order_id
         ) ogg on ogg.order_id =tor.order_id
         left join goods_shop gs2 on gs2.shop_id=tcu.shop_id
         where 1 = 1
@@ -390,7 +391,8 @@
 
     <select id="waitTakeFood" resultType="com.sqx.modules.order.entity.TbOrder">
         select tor.*, tu.avatar as avatar, ti.rider_user_id as riderUserId, gs.shop_name as shopName, gs.shop_cover as
-        shopCover, gs.detailed_address as detailedAddress,tu1.phone as riderPhone,gs.phone as shopPhone,ti.indent_state as indentState,
+        shopCover, gs.detailed_address as detailedAddress,tu1.phone as riderPhone,gs.phone as shopPhone,ti.indent_state
+        as indentState,
         (select count(*) from tb_order where order_type = 1 and status in (6, 3) and pay_time &lt; tor.pay_time
         and shop_id = tor.shop_id) as countOrder
         from tb_order tor
@@ -409,7 +411,13 @@
         <if test="status==null">
             and tor.status in (0, 7, 6, 3, 4, 5, 8)
         </if>
-        order by tor.pay_time desc, tor.create_time desc
+        <if test="!(status != null and status==5)">
+            order by tor.pay_time desc, tor.create_time desc
+        </if>
+        <if test="status != null and status==5">
+            order by tor.create_time desc
+        </if>
+
     </select>
 
 
@@ -536,7 +544,9 @@
     </select>
 
     <select id="selectMakeOrdersList" resultType="com.sqx.modules.order.entity.TbOrder">
-        select * from tb_order where status=6 and shop_receiving_time <![CDATA[ <= #{minusMinutes}]]></select>
+        select * from tb_order where status=6 and shop_receiving_time <![CDATA[ <= #{minusMinutes}
+
+        ]]></select>
 
     <select id="selectCurrentOrderSequenceByShopId" resultType="java.lang.Long">
         select
@@ -552,19 +562,19 @@
 
     <select id="countByShopIdAndActivityIdAndUserIdAndCurDate" resultType="java.lang.Integer">
         select
-            count(1)
+        count(1)
         from
-             tb_order o
-             left join activity_part_record apr on apr.order_id = o.order_id
+        tb_order o
+        left join activity_part_record apr on apr.order_id = o.order_id
         where
-            o.shop_id = #{shopId}
-            and o.user_id = #{userId}
-            and date(o.create_time) = curdate()
-            and apr.activity_id = #{activityId}
-            and o.is_pay = 1
-            <if test="orderId != null">
-                and o.order_id != #{orderId}
-            </if>
+        o.shop_id = #{shopId}
+        and o.user_id = #{userId}
+        and date(o.create_time) = curdate()
+        and apr.activity_id = #{activityId}
+        and o.is_pay = 1
+        <if test="orderId != null">
+            and o.order_id != #{orderId}
+        </if>
     </select>
 
     <select id="selectCurWaitReceivingOrderIds" resultType="java.lang.Long">
@@ -686,4 +696,4 @@
           AND pd.state in (0, 2)
     </select>
 
-</mapper>
+</mapper>