Forráskód Böngészése

订单详情、预约详情

liude 1 éve
szülő
commit
2e064a169f

+ 0 - 1
vehicle-api/src/main/java/com/chelvc/cloud/vehicle/api/param/MerchantAuthModifyParam.java

@@ -67,7 +67,6 @@ public class MerchantAuthModifyParam implements Serializable {
      * 法人性别
      */
 //    @NotEmpty(message = "法人性别不能为空")
-    @Size(max = 100, message = "营业执照编号长度不能大于1")
     private String legalRepresenativeGender;
     /**
      * 手机号

+ 5 - 0
vehicle-api/src/main/java/com/chelvc/cloud/vehicle/api/param/MerchantModifyParam.java

@@ -125,4 +125,9 @@ public class MerchantModifyParam implements Serializable {
      * 商家副营业务
      */
     private List<Long> ancillaryBusiness;
+
+    /**
+     * 营业状态 0-营业中 1-休息中
+     */
+    private String businessStatus;
 }

+ 12 - 1
vehicle-api/src/main/java/com/chelvc/cloud/vehicle/api/service/ReservationService.java

@@ -1,5 +1,6 @@
 package com.chelvc.cloud.vehicle.api.service;
 
+import com.chelvc.cloud.vehicle.api.constant.ReserveStatus;
 import com.chelvc.cloud.vehicle.api.dto.ReservationDTO;
 import com.chelvc.cloud.vehicle.api.param.ReservationModifyParam;
 import com.chelvc.cloud.vehicle.api.param.ReservationPagingParam;
@@ -58,5 +59,15 @@ public interface ReservationService {
      * @param id 预约单ID
      * @param status 预约单的状态
      */
-    void updateReservationsStatus(Long id,String status) ;
+    void updateReservationsStatus(Long id, ReserveStatus status) ;
+
+
+    /**
+     * 预约详情
+     * @param id
+     * @return
+     */
+    ReservationDTO getDetail(Long id);
+
+
 }

+ 8 - 5
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/entity/Merchant.java

@@ -145,9 +145,12 @@ public class Merchant extends ModifyEntity<Long> {
     /**
      * 商家主营业务
      */
-//    private List<Long> mainBusiness;
-//    /**
-//     * 商家副营业务
-//     */
-//    private List<Long> ancillaryBusiness;
+    private List<Long> mainBusiness;
+    /**
+     * 商家副营业务
+     */
+    private List<Long> ancillaryBusiness;
+
+
+
 }

+ 18 - 18
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/impl/CategoryServiceImpl.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.List;
 import java.util.Objects;
+import java.util.stream.Collectors;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -27,6 +28,7 @@ import lombok.NonNull;
 import lombok.RequiredArgsConstructor;
 import org.apache.dubbo.config.annotation.DubboService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.CollectionUtils;
 
 /**
  * 分类业务操作实现
@@ -98,16 +100,12 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
         Long userId = SessionContextHolder.getId();
         Scope scope = StringUtils.ifEmpty(SessionContextHolder.getScope(), Scope::parse);
         if (scope == Scope.ADMIN) {
-            param.setType("0");
         }else {
             List<Long> merchants = this.merchantService.getMerchantIdsByUserId(userId);
             if (ObjectUtils.isEmpty(merchants)) {
                 return null;
             }
             param.setMerchantId(merchants.get(0));
-            if (StringUtils.isEmpty(param.getType())){
-                param.setType("1");
-            }
         }
         List<Category> categories = this.lambdaQuery().eq(Category::getEnabled, true)
                 .eq(StringUtils.notEmpty(param.getType()),Category::getType,param.getType())
@@ -170,24 +168,26 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
     }
     @Override
     public List<CategoryDTO> getRootCategories(CategoryListParam param){
-//        Long userId = SessionContextHolder.getId();
-//        Scope scope = StringUtils.ifEmpty(SessionContextHolder.getScope(), Scope::parse);
-//        if (scope == Scope.ADMIN) {
-//            param.setType("0");
-//        }else {
-//            List<Long> merchants = this.merchantService.getMerchantIdsByUserId(userId);
-//            if (ObjectUtils.isEmpty(merchants)) {
-//                return null;
-//            }
-//            param.setMerchantId(merchants.get(0));
-//            param.setType("1");
-//        }
+        Long userId = SessionContextHolder.getId();
+        Scope scope = StringUtils.ifEmpty(SessionContextHolder.getScope(), Scope::parse);
+        if (scope == Scope.ADMIN) {
+        }else {
+            List<Long> merchants = this.merchantService.getMerchantIdsByUserId(userId);
+            if (ObjectUtils.isEmpty(merchants)) {
+                return null;
+            }
+            param.setMerchantId(merchants.get(0));
+        }
         List<Category> categories = this.lambdaQuery()
                 .eq(Category::getEnabled, true)
-//                .eq(StringUtils.notEmpty(param.getType()),Category::getType,param.getType())
-//                .eq(StringUtils.notEmpty(param.getMerchantId()),Category::getMerchantId,param.getMerchantId())
+                .eq(StringUtils.notEmpty(param.getType()),Category::getType,param.getType())
+                .eq(StringUtils.notEmpty(param.getMerchantId()),Category::getMerchantId,param.getMerchantId())
                 .orderByAsc(Category::getSort).list();
         categories.sort(Comparator.comparing(Category::getType).thenComparing(Category::getSort));
+//        List<String> names = categories.stream().map(Category::getName).collect(Collectors.toList());
+//        List<Category> categoryList = this.lambdaQuery()
+//                .in(!CollectionUtils.isEmpty(names),Category::getId,names)
+//                .list();
         return CategoryCopier.INSTANCE.copying(categories);
     }
     @Override

+ 3 - 1
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/impl/OmsOrderServiceImpl.java

@@ -417,11 +417,13 @@ public class OmsOrderServiceImpl extends ServiceImpl<OmsOrderMapper, OmsOrder> i
 
     @Override
     public OmsOrderDetailDTO detail(Long orderId) {
-        OmsOrder omsOrder = this.baseMapper.selectOmsOrderById(orderId);
+        OmsOrder omsOrder = this.baseMapper.selectById(orderId);
         List<OmsOrderItemDTO> orderItemList = omsOrderItemService.getOrderItemByOrderId(orderId);
         OmsOrderDetailDTO orderDetail = new OmsOrderDetailDTO();
         BeanUtils.copyProperties(omsOrder, orderDetail);
         orderDetail.setOrderItemList(orderItemList);
+        MerchantDTO merchant = this.merchantService.getMerchantById(omsOrder.getMerchantId());
+        orderDetail.setMerchantInfo(merchant);
         return orderDetail;
     }
 

+ 19 - 2
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/impl/ReservationServiceImpl.java

@@ -24,6 +24,7 @@ import com.chelvc.cloud.vehicle.server.service.MerchantService;
 import com.chelvc.cloud.vehicle.server.service.ReservationService;
 import com.chelvc.framework.base.context.SessionContextHolder;
 import com.chelvc.framework.common.model.Pagination;
+import com.chelvc.framework.common.util.AssertUtils;
 import com.chelvc.framework.common.util.ObjectUtils;
 import com.chelvc.framework.common.util.StringUtils;
 import com.chelvc.framework.database.context.DatabaseContextHolder;
@@ -146,7 +147,23 @@ public class ReservationServiceImpl extends ServiceImpl<ReservationMapper, Reser
         return reservations;
     }
     @Override
-    public void updateReservationsStatus(Long id,String status){
-
+    public void updateReservationsStatus(Long id,ReserveStatus status){
+        Reservation reservation = AssertUtils.available(this.getById(id), "该预约单不存在");
+        reservation.setStatus(status);
+        this.updateById(reservation);
+    }
+    @Override
+    public ReservationDTO getDetail(Long id){
+        Reservation reservation = this.getById(id);
+        MerchantDTO merchant = this.merchantService.getMerchantById(reservation.getMerchantId());
+        ReservationDTO reservationDTO = ReservationCopier.INSTANCE.copying(reservation);
+        UserDTO user = this.userService.getUser(reservation.getUserId());
+        if (user != null) {
+            reservationDTO.setUsername(user.getNickname());
+        }
+        if (null != reservationDTO){
+            reservationDTO.setMerchant(merchant);
+        }
+        return reservationDTO;
     }
 }