chenchen 5 сар өмнө
parent
commit
30f190dcaf

+ 4 - 0
application-webadmin/src/main/java/com/tourism/webadmin/app/website/dto/TourismBookProjectDto.java

@@ -1,5 +1,6 @@
 package com.tourism.webadmin.app.website.dto;
 
+import jakarta.validation.constraints.NotNull;
 import lombok.Data;
 
 import java.util.Date;
@@ -7,13 +8,16 @@ import java.util.Date;
 @Data
 public class TourismBookProjectDto {
 
+    @NotNull
     private Integer type;
 
+    @NotNull
     private Long projectId;
 
     private Integer adultNumber;
 
     private Integer childrenNumber;
 
+    @NotNull
     private Date startDate;
 }

+ 3 - 1
application-webadmin/src/main/java/com/tourism/webadmin/app/website/service/impl/TourismProjectToWebServiceImpl.java

@@ -7,6 +7,7 @@ import com.tourism.common.additional.config.ApplicationConfig;
 import com.tourism.common.additional.utils.MapConvertUtils;
 import com.tourism.common.additional.utils.StringUtils;
 import com.tourism.common.additional.utils.UrlConvertUtils;
+import com.tourism.common.core.annotation.MyRequestBody;
 import com.tourism.common.core.constant.ErrorCodeEnum;
 import com.tourism.common.core.object.*;
 import com.tourism.common.core.upload.BaseUpDownloader;
@@ -193,7 +194,7 @@ public class TourismProjectToWebServiceImpl implements TourismProjectToWebServic
     }
 
     @Override
-    public void bookProject(HttpServletRequest request, TourismBookProjectDto tourismBookProjectDto) {
+    public void bookProject(HttpServletRequest request,@MyRequestBody TourismBookProjectDto tourismBookProjectDto) {
         //获取用户的手机号
         Long userId = TokenData.takeFromRequest().getUserId();
         TourUser tourUser = tourUserService.getById(userId);
@@ -216,6 +217,7 @@ public class TourismProjectToWebServiceImpl implements TourismProjectToWebServic
         tourBookInfo.setChildrenPrice(tourismDatePriceOne.getChildrenPrice());
         tourBookInfo.setBookMobile(mobile);
         tourBookInfo.setBookName(mobile);
+        tourBookInfo.setIsHandle("0");
         tourBookInfo.setBookTime(tourismBookProjectDto.getStartDate());
         tourBookInfo.setTotalPrice( tourismDatePriceOne.getAdultPrice().multiply(BigDecimal.valueOf(tourismBookProjectDto.getAdultNumber()))
                 .add(tourismDatePriceOne.getChildrenPrice().multiply(BigDecimal.valueOf(tourismBookProjectDto.getChildrenNumber()))));