Prechádzať zdrojové kódy

HBO GO退款 自动上架车队

zoujiajian 1 rok pred
rodič
commit
2b6209d671

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

@@ -404,6 +404,8 @@ public interface Constant {
 
 	Long GROK_GOODS_ID = 88l;
 
+	Long HBO_GO_GOODS_ID = 8L;
+
 	/**
 	 * 批发押金配置key
 	 */

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

@@ -520,7 +520,7 @@ public class CmsGroupServiceImpl extends ServiceImpl<GroupsMapper,GroupsTrips> i
 
     private void setDownIfFull(GoodsDon goodsDon, GroupsTrips groupsTrips) {
         //HBO GO 满员,车队下架
-        if (goodsDon.getId() == 8l) {
+        if (goodsDon.getId() == Constant.HBO_GO_GOODS_ID) {
             if (groupsTrips.getStatus() == GroupsTrips.Status.validity) {
                 Integer count2 = relationMapper.selectCount(Wrappers.lambdaQuery(GroupsRelation.class)
                         .eq(GroupsRelation::getGroupsId, groupsTrips.getId())

+ 24 - 0
netflix-service/src/main/java/com/cyksj/service/mange/impl/CmsOrderDonServiceImpl.java

@@ -1171,6 +1171,8 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
                 }
             }
         }
+        //HBO GO退款,车队上架
+        setUpIfEmpty(orderDon.getGoodsId(), orderDon.getRelationId());
     }
 
     //处理下级渠道分销提成
@@ -1601,4 +1603,26 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
             });
         }
     }
+
+    /**
+     * 车队退款 自动上架
+     */
+	private void setUpIfEmpty(Long goodsId, Long relationId) {
+		if (goodsId == Constant.HBO_GO_GOODS_ID) {
+			GroupsRelation relation = relationMapper.selectById(relationId);
+			if (relation == null) {
+				return;
+			}
+			GroupsTrips groupsTrips = groupsMapper.selectById(relation.getGroupsId());
+			if (groupsTrips == null) {
+				return;
+			}
+			if (groupsTrips.getStatus() == GroupsTrips.Status.down) {
+				log.info("HBO GO车队:{}存在退款,自动上架", groupsTrips.getId());
+				groupsMapper.update(null, Wrappers.lambdaUpdate(GroupsTrips.class)
+						.set(GroupsTrips::getStatus, GroupsTrips.Status.validity)
+						.eq(GroupsTrips::getId, groupsTrips.getId()));
+			}
+		}
+	}
 }