Browse Source

fix: 启用航次的渠道判断功能

luofeiyun 2 weeks ago
parent
commit
5201c5bbf2

+ 3 - 0
ship-module-product/ship-module-product-biz/src/main/java/com/yc/ship/module/product/controller/admin/voyage/vo/VoyageCalendarReqVO.java

@@ -19,4 +19,7 @@ public class VoyageCalendarReqVO {
     @Schema(description = "船ID列表")
     private List<Long> shipIds;
 
+    @Schema(description = "渠道(1:旅行社,2:小程序)")
+    private String channel;
+
 }

+ 3 - 0
ship-module-product/ship-module-product-biz/src/main/java/com/yc/ship/module/product/controller/admin/voyage/vo/VoyageReqVO.java

@@ -15,4 +15,7 @@ public class VoyageReqVO {
     @Schema(description = "航线", example = "4445")
     private Long routeId;
 
+    @Schema(description = "渠道(1:表示旅行社,2:表示小程序)", example = "1")
+    private String channel;
+
 }

+ 4 - 0
ship-module-product/ship-module-product-biz/src/main/java/com/yc/ship/module/product/controller/app/voyage/AppVoyageController.java

@@ -36,6 +36,7 @@ import com.yc.ship.module.resource.service.roommodel.ResourceRoomModelService;
 import com.yc.ship.module.resource.service.ship.ResourceShipService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
@@ -95,6 +96,9 @@ public class AppVoyageController {
     @GetMapping("/list-calendar")
     @Operation(summary = "获取航次(航期)日历表")
     public CommonResult<List<AppVoyageRespVO>> getVoyageListCalendar(VoyageCalendarReqVO reqVO) {
+        if(StringUtils.isBlank(reqVO.getChannel())) {
+            reqVO.setChannel("2");//表示小程序
+        }
         List<VoyageDO> list = voyageService.getListCalendar(reqVO);
         List<AppVoyageRespVO> voyageRespVOS = BeanUtils.toBean(list, AppVoyageRespVO.class);
 

+ 3 - 0
ship-module-product/ship-module-product-biz/src/main/java/com/yc/ship/module/product/dal/mysql/voyage/VoyageMapper.java

@@ -43,6 +43,7 @@ public interface VoyageMapper extends BaseMapperX<VoyageDO> {
                 .eqIfPresent(VoyageDO::getShipId, reqVO.getShipId())
                 .eqIfPresent(VoyageDO::getRouteId, reqVO.getRouteId())
                 .eq(VoyageDO::getShelfStatus, VoyageShelfStatusEnum.ON_SHELF.getValue())
+                .likeIfPresent(VoyageDO::getChannel, reqVO.getChannel())
                 .orderByAsc(VoyageDO::getCreateTime));
     }
 
@@ -51,6 +52,7 @@ public interface VoyageMapper extends BaseMapperX<VoyageDO> {
                 .eq(VoyageDO::getShipId, shipId)
                 .gt(VoyageDO::getLeaveTime, LocalDate.now())
                 .eq(VoyageDO::getShelfStatus, VoyageShelfStatusEnum.ON_SHELF.getValue())
+                .like(VoyageDO::getChannel, "1")
                 .orderByAsc(VoyageDO::getCreateTime));
     }
 
@@ -78,6 +80,7 @@ public interface VoyageMapper extends BaseMapperX<VoyageDO> {
                 .inIfPresent(VoyageDO::getShipId, reqVO.getShipIds())
                 .betweenIfPresent(VoyageDO::getStartTime, reqVO.getStartDate(), reqVO.getEndDate())
                 .eq(VoyageDO::getShelfStatus, VoyageShelfStatusEnum.ON_SHELF.getValue())
+                .likeIfPresent(VoyageDO::getChannel, reqVO.getChannel())
                 .orderByAsc(VoyageDO::getStartTime));
     }
 }

+ 1 - 0
ship-module-product/ship-module-product-biz/src/main/resources/mapper/pricevoyage/PriceVoyageMapper.xml

@@ -25,6 +25,7 @@
           AND t3.deleted = 0
           and t1.ship_id = #{reqVO.shipId}
           AND t1.route_id = #{reqVO.routeId}
+        and t1.channel like '%2%'
         <if test="reqVO.startDate != null and reqVO.startDate != ''">
             AND t1.start_time >= #{reqVO.startDate}
         </if>

+ 3 - 2
ship-module-resource/ship-module-resource-biz/src/main/resources/mapper/resourceroute/ResourceRouteMapper.xml

@@ -27,7 +27,7 @@
            resource_route rr
                LEFT JOIN resource_dock rd on rr.on_dock_id = rd.id
                LEFT JOIN resource_port rp on rd.port_id = rp.id
-               LEFT JOIN product_voyage pv ON rr.id = pv.route_id  and pv.start_time > now()
+               LEFT JOIN product_voyage pv ON rr.id = pv.route_id
                                                   <if test="reqVo.startDay != null and reqVo.startDay != ''">
                                                       and pv.start_time BETWEEN BETWEEN CONCAT(#{reqVo.startDay},' 00:00:00') and CONCAT(#{reqVo.startDay},' 23:59:59')
                                                   </if>
@@ -50,7 +50,8 @@
                GROUP BY
                    t1.voyage_id
            ) t2 ON pv.id = t2.voyage_id
-        where rr.deleted = 0 and rd.deleted = 0 and rp.deleted = 0 and pv.deleted = 0 and rs.deleted = 0
+        where rr.deleted = 0 and rd.deleted = 0 and rp.deleted = 0 and pv.deleted = 0 and rs.deleted = 0 and pv.start_time > now()
+        and pv.channel like '%2%'
        GROUP BY
         rr.id, rs.id
       ) t3 where 1=1 and t3.price is not null