Kaynağa Gözat

GPT预备账号可用座位数规格修改

zoujiajian 2 yıl önce
ebeveyn
işleme
0b7403bc59

+ 5 - 0
netflix-common/src/main/java/com/cyksj/common/constant/Constant.java

@@ -232,4 +232,9 @@ public interface Constant {
 	 * 百度回传 过滤平台
 	 */
 	String BAIDU_POST_FILTER_GOODS_KEY = "baidu_post_filter_goods_key";
+
+	/**
+	 * GPT Plus规格 新车队规格限制上车数
+	 */
+	List<Long> GPT_PLUS_PARKING_SKU_IDS = List.of(161l, 178l);
 }

+ 2 - 0
netflix-dao/src/main/java/com/cyksj/mapper/GroupsRelationMapper.java

@@ -59,4 +59,6 @@ public interface GroupsRelationMapper extends BaseMapper<GroupsRelation> {
 	Integer selectSpecialGroupsRelationAvailable(@Param("skuId") Long skuId, @Param("maxNum") Integer maxNum, @Param("skuNum") Integer skuNum, @Param("extractNum") Integer extractNum, @Param("tenExpiry") DateTime tenExpiry);
 
 	Integer selectNumWaitingGroups(Long skuId);
+
+	Integer selectLimitAvailableNum(@Param("skuId") Long skuId, @Param("maxNum") Integer maxNum);
 }

+ 15 - 2
netflix-dao/src/main/resources/mapper/GroupRelationMapper.xml

@@ -247,7 +247,8 @@
             and gt.`status` = 'validity'
             and gt.sku_id = #{skuId}
                  inner join groups_relation gr on gr.groups_id = gt.id
-            and gr.status in ('none','locking')
+            and gr.status in ('none', 'locking')
+            and gt.available_parking_num = 0
             and gr.num &lt;= #{skuNum}
     </select>
 
@@ -268,8 +269,9 @@
               from account a
                        inner join `groups_trips` gt on gt.account_id = a.id
                   and gt.`status` = 'validity'
+                  and gt.available_parking_num = 0
                   and gt.sku_id = #{skuId}
-                  and a.expiry_time >= #{tenExpiry}) s
+            and a.expiry_time >= #{tenExpiry}) s
         where (t1 = 5 and a1 = 0) = 0
     </select>
 
@@ -282,4 +284,15 @@
             and gr.user_id != 0
             and gr.status in ('validity','outside')
     </select>
+
+    <select id="selectLimitAvailableNum" resultType="java.lang.Integer">
+        select sum(available_parking_num - (select count(*)
+                                            from groups_relation gr
+                                            where gr.groups_id = gt.id
+                                              and gr.status in ('validity', 'outside')
+                                              and gr.num &lt;= #{maxNum}))
+        from groups_trips gt
+        where gt.sku_id = #{skuId}
+          and gt.available_parking_num != 0
+    </select>
 </mapper>

+ 17 - 0
netflix-service/src/main/java/com/cyksj/service/mange/group/CmsGroupServiceImpl.java

@@ -386,6 +386,23 @@ public class CmsGroupServiceImpl extends ServiceImpl<GroupsMapper,GroupsTrips> i
             //额外硬塞
             Integer special_available = relationMapper.selectSpecialGroupsRelationAvailable(skuId, maxNum, skuNum, extraNum, time);
             available += special_available;
+            //GPT Plus 10人月付规格 4人月付
+            if (Constant.GPT_PLUS_PARKING_SKU_IDS.contains(skuId)) {
+                //上面已排除限制车队
+                //限制车队可用车数位
+                Integer limitAvailable = relationMapper.selectLimitAvailableNum(skuId, maxNum);
+                if (limitAvailable < 0) {
+                    limitAvailable = 0;
+                }
+                available += limitAvailable;
+
+                //新车队预备上车 最大可用数
+                if (Constant.GPT_PLUS_PARKING_SKU_IDS.get(0).equals(skuId)) {
+                    maxNum = 10;
+                }else {
+                    maxNum = 4;
+                }
+            }
             available = getAvailableAfterPreAccount(available, skuId, maxNum, goodsId);
             //待发车已有人员成功上车
             Integer waitingNum = relationMapper.selectNumWaitingGroups(skuId);