Browse Source

fix 修改精度丢失问题

chenchen 5 months ago
parent
commit
3672e7fd33

+ 2 - 2
application-webadmin/src/main/java/com/tourism/webadmin/app/website/controller/TourismProjectToWebController.java

@@ -64,7 +64,7 @@ public class TourismProjectToWebController {
      */
     @SaIgnore
     @GetMapping("/detail")
-    public ResponseResult<TourismProjectVo> detail(@NotNull(message = "所属目录(id)不能为空") Long id) {
+    public ResponseResult<TourismProjectVo> detail(@NotNull(message = "所属目录(id)不能为空") String id) {
         TourismProject tourismProject = tourismProjectService.getByIdWithRelation(id, MyRelationParam.full());
         if (tourismProject == null) {
             return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
@@ -80,7 +80,7 @@ public class TourismProjectToWebController {
      */
     @SaIgnore
     @GetMapping("/viewDatePrice")
-    public ResponseResult<WebSiteProjectDatePriceVo> view(@RequestParam Long projectId) {
+    public ResponseResult<WebSiteProjectDatePriceVo> view(@RequestParam String projectId) {
         WebSiteProjectDatePriceVo webSiteProjectDatePriceVo = tourismProjectToWebService.view(projectId);
         return ResponseResult.success(webSiteProjectDatePriceVo);
     }

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

@@ -13,7 +13,7 @@ public class TourismBookProjectDto {
     private Integer type;
 
     @NotNull(message = "项目不能为空!", groups = {UpdateGroup.class})
-    private Long projectId;
+    private String projectId;
 
     @NotNull(message = "成人数量不能为空!", groups = {UpdateGroup.class})
     private Integer adultNumber;

+ 1 - 1
application-webadmin/src/main/java/com/tourism/webadmin/app/website/service/TourismProjectToWebService.java

@@ -17,7 +17,7 @@ public interface TourismProjectToWebService {
 
     TourismProjectVo detail(TourismProject tourismProject);
 
-    WebSiteProjectDatePriceVo view(@RequestParam Long projectId);
+    WebSiteProjectDatePriceVo view(@RequestParam String projectId);
 
     Boolean bookProject(HttpServletRequest request, @RequestBody TourismBookProjectDto tourismBookProjectDto);
 }

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

@@ -148,7 +148,7 @@ public class TourismProjectToWebServiceImpl implements TourismProjectToWebServic
     }
 
     @Override
-    public WebSiteProjectDatePriceVo view(Long projectId) {
+    public WebSiteProjectDatePriceVo view(String projectId) {
 
         TourismDatePrice tourismDatePrice = new TourismDatePrice();
         tourismDatePrice.setProjectId(projectId);

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

@@ -145,7 +145,9 @@ public class ExtraController {
                 filter.setProjectId(datePriceSaveDto.getProjectId());
                 filter.setNowDate(MyDateUtil.truncateToDay(new Date()));
                 List<TourismDatePrice> tourismDatePriceList = tourismDatePriceService.getTourismDatePriceList(filter, "");
-                tourismDatePriceList.stream().map(TourismDatePrice::getId).forEach(tourismDatePriceService::remove);
+                tourismDatePriceList.stream().map(TourismDatePrice::getId).forEach(item->{
+                    tourismDatePriceService.removeById(item);
+                });
             }
         }
         //取旅游项目的价格,来对列表数据进行对比,如果列表数据低于旅游项目的价格,则进行提示