Browse Source

Merge remote-tracking branch 'origin/v0.1' into v0.1

chenchen 4 months ago
parent
commit
4afce80f84

+ 2 - 2
application-webadmin/src/main/java/com/tourism/webadmin/app/wechat/controller/TakeOutProjectController.java

@@ -78,9 +78,9 @@ public class TakeOutProjectController {
             PageMethod.startPage(tourismRestaurantTypeToWebDto.getPageNum(), tourismRestaurantTypeToWebDto.getPageSize(), true);
         }
         RestaurantType restaurantType = MyModelUtil.copyTo(tourismRestaurantTypeToWebDto, RestaurantType.class);
-        String orderBy = MyOrderParam.buildOrderBy(tourismRestaurantTypeToWebDto.getOrderParamList(), RestaurantType.class);
+//        String orderBy = MyOrderParam.buildOrderBy(tourismRestaurantTypeToWebDto.getOrderParamList(), RestaurantType.class);
         List<RestaurantType> restaurantFoodTypeList =
-                restaurantTypeService.getRestaurantTypeListWithRelation(restaurantType, orderBy);
+                restaurantTypeService.getRestaurantTypeListWithRelation(restaurantType, "tour_restaurant_type.show_order");
 
 
         MyPageData<RestaurantTypeVo> restaurantTypeVoMyPageData = MyPageUtil.makeResponseData(restaurantFoodTypeList, RestaurantTypeVo.class);

+ 26 - 22
application-webadmin/src/main/java/com/tourism/webadmin/app/wechat/controller/WechatDeliveryOrderController.java

@@ -29,10 +29,7 @@ import org.junit.Ignore;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.Comparator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
 import java.util.stream.Collectors;
 
 @Tag(name = "外卖订单接口")
@@ -86,24 +83,31 @@ public class WechatDeliveryOrderController {
         deliveryOrderService.maskFieldDataList(deliveryOrderList, null);
 
         //查询订单详情
-        Set<String> orderIds = deliveryOrderList.stream().map(e -> e.getId()).collect(Collectors.toSet());
-        List<DeliveryOrderItems> items = deliveryOrderItemsService.getDeliveryOrderItemsVoList(orderIds);
-        List<DeliveryOrderItemsVo> deliveryOrderItemsVos = MyModelUtil.copyCollectionTo(items, DeliveryOrderItemsVo.class);
-        //做成map,方便匹配
-        Map<String, List<DeliveryOrderItemsVo>> collect1 = deliveryOrderItemsVos.stream().collect(Collectors.groupingBy(DeliveryOrderItemsVo::getOrderId));
-        MyPageData<DeliveryOrderVo> pageData = MyPageUtil.makeResponseData(deliveryOrderList, DeliveryOrderVo.class);
-        pageData.getDataList().forEach(e->{
-            e.setItemList(collect1.get(e.getId()));
-        });
-        List<DeliveryOrderVo> dataList = pageData.getDataList();
-        dataList.sort(new Comparator<DeliveryOrderVo>() {
-            @Override
-            public int compare(DeliveryOrderVo o1, DeliveryOrderVo o2) {
-                int compareTo = o2.getCreateTime().compareTo(o1.getCreateTime());
-                return compareTo;
-            }
-        });
-        pageData.setDataList(dataList);
+        if (!deliveryOrderList.isEmpty()) {
+            Set<String> orderIds = deliveryOrderList.stream().map(e -> e.getId()).collect(Collectors.toSet());
+            List<DeliveryOrderItems> items = deliveryOrderItemsService.getDeliveryOrderItemsVoList(orderIds);
+            List<DeliveryOrderItemsVo> deliveryOrderItemsVos = MyModelUtil.copyCollectionTo(items, DeliveryOrderItemsVo.class);
+            //做成map,方便匹配
+            Map<String, List<DeliveryOrderItemsVo>> collect1 = deliveryOrderItemsVos.stream().collect(Collectors.groupingBy(DeliveryOrderItemsVo::getOrderId));
+            MyPageData<DeliveryOrderVo> pageData = MyPageUtil.makeResponseData(deliveryOrderList, DeliveryOrderVo.class);
+            pageData.getDataList().forEach(e -> {
+                e.setItemList(collect1.get(e.getId()));
+            });
+            List<DeliveryOrderVo> dataList = pageData.getDataList();
+            dataList.sort(new Comparator<DeliveryOrderVo>() {
+                @Override
+                public int compare(DeliveryOrderVo o1, DeliveryOrderVo o2) {
+                    int compareTo = o2.getCreateTime().compareTo(o1.getCreateTime());
+                    return compareTo;
+                }
+            });
+            pageData.setDataList(dataList);
+            return ResponseResult.success(pageData);
+
+        }
+        MyPageData<DeliveryOrderVo> pageData = new MyPageData<>();
+        pageData.setDataList(new ArrayList<>());
+        pageData.setTotalCount(0l);
         return ResponseResult.success(pageData);
     }
 

+ 8 - 6
application-webadmin/src/main/java/com/tourism/webadmin/app/wechat/controller/WechatFoodIndexController.java

@@ -101,12 +101,12 @@ public class WechatFoodIndexController {
         filter.setEnable(1);
         filter.setIsHotFood(1);
 
-        MyOrderParam myOrderParam = new MyOrderParam();
-        myOrderParam.add(new MyOrderParam.OrderInfo("totalSales",false,null));
-        String orderBy = MyOrderParam.buildOrderBy(myOrderParam, RestaurantInfo.class);
+//        MyOrderParam myOrderParam = new MyOrderParam();
+//        myOrderParam.add(new MyOrderParam.OrderInfo("totalSales",false,null));
+//        String orderBy = MyOrderParam.buildOrderBy(myOrderParam, RestaurantInfo.class);
 
         PageMethod.startPage(1, 4, true);
-        List<RestaurantFoodInfo> foodInfoList = restaurantFoodInfoService.getRestaurantFoodInfoList(filter, orderBy);
+        List<RestaurantFoodInfo> foodInfoList = restaurantFoodInfoService.getRestaurantFoodInfoList(filter, null);
         MyPageData<RestaurantFoodInfoVo> pageData = MyPageUtil.makeResponseData(foodInfoList, RestaurantFoodInfoVo.class);
         List<RestaurantFoodInfoVo> list = pageData.getDataList();
         list.stream().forEach(o->{
@@ -204,8 +204,10 @@ public class WechatFoodIndexController {
         }
         List<WechatSelectShopVo> dataList = pageData.getDataList();
         for (WechatSelectShopVo shopVo : dataList) {
-            String[] tags = shopVo.getTag().split("&");
-            shopVo.setTags(tags);
+            if(shopVo.getTag()!=null||!shopVo.getTag().equals("")){
+                String[] tags = shopVo.getTag().split("&");
+                shopVo.setTags(tags);
+            }
             //json->图片
             List<String> strings = UrlConvertUtils.urlConvert(applicationConfig.getHostIpPort(), shopVo.getUrl());
             shopVo.setUrlAfterConvert(strings);

+ 1 - 1
application-webadmin/src/main/java/com/tourism/webadmin/back/controller/RestaurantTypeController.java

@@ -159,7 +159,7 @@ public class RestaurantTypeController {
         RestaurantType restaurantTypeFilter = MyModelUtil.copyTo(restaurantTypeDtoFilter, RestaurantType.class);
 //        String orderBy = MyOrderParam.buildOrderBy(orderParam, RestaurantType.class);
         List<RestaurantType> restaurantTypeList =
-                restaurantTypeService.getRestaurantTypeListWithRelation(restaurantTypeFilter, "tour_restaurant_type.show_order desc");
+                restaurantTypeService.getRestaurantTypeListWithRelation(restaurantTypeFilter, "tour_restaurant_type.show_order");
         return ResponseResult.success(MyPageUtil.makeResponseData(restaurantTypeList, RestaurantTypeVo.class));
     }
 

+ 1 - 1
application-webadmin/src/main/java/com/tourism/webadmin/back/dto/RestaurantInfoDto.java

@@ -129,7 +129,7 @@ public class RestaurantInfoDto {
      * 配送费。
      */
     @Schema(description = "配送费。")
-    private String deliveryCharge;
+    private BigDecimal deliveryCharge;
 
     /**
      * 最低消费。