Prechádzať zdrojové kódy

fix 不选择平台,特定奖池选择车票

zoujiajian 3 rokov pred
rodič
commit
2de0cf5633

+ 6 - 0
netflix-dao/src/main/java/com/cyksj/model/manage/views/GroupsRelationView.java

@@ -39,6 +39,12 @@ public class GroupsRelationView {
     @DbField("g.logo")
     private String logo;
 
+    @DbField("g.type")
+    private Integer goodsType;
+
+    @DbField("g.second_type")
+    private Integer goodsSecondType;
+
     @DbField("gr.groups_id")
     private Long groupsId;
 

+ 6 - 2
netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpEventActionServiceImpl.java

@@ -3,6 +3,7 @@ package com.cyksj.service.corp.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.cyksj.common.constant.Constant;
 import com.cyksj.common.util.Jsons;
@@ -136,10 +137,13 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
 			return;
 		}
 		String sysValue = lottery_specific_goods.getSysValue();
-		if (sysValue == null) {
+		if (StrUtil.isEmpty(sysValue)) {
 			return;
 		}
 		List<Long> goodsIdList = Jsons.parseList(sysValue, Long.class);
+		if (goodsIdList.isEmpty() || goodsIdList.contains(null)) {
+			return;
+		}
 		SysConfig timeSys = sysConfigService.getOne(Wrappers.lambdaQuery(SysConfig.class).eq(SysConfig::getSysKey, Constant.LOTTERY_SPECIFIC_ORDER_EFFECTIVE_TIME).last("limit 1"));
 		Integer effectiveTime = timeSys == null ? 1 : Integer.parseInt(Optional.ofNullable(timeSys.getSysValue()).orElse("1"));
 		List<OrderDon> orderDons = orderDonMapper.selectList(Wrappers.lambdaQuery(OrderDon.class)
@@ -148,7 +152,7 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
 				.ge(OrderDon::getCreatedTime, DateUtil.offsetDay(DateTime.now(), -effectiveTime))
 				.select(OrderDon::getId, OrderDon::getGoodsId, OrderDon::getSkuId, OrderDon::getUserId));
 		orderDons.forEach(order -> {
-			if (goodsIdList.isEmpty() || goodsIdList.contains(order.getGoodsId())) {
+			if (goodsIdList.contains(order.getGoodsId())) {
 				try {
 					marketFrontService.addSpecificChanceNumNoWxCorp(order.getUserId(), order.getId(), order.getGoodsId(), order.getSkuId());
 				} catch (Exception e) {

+ 16 - 4
netflix-service/src/main/java/com/cyksj/service/market/impl/MarketFrontServiceImpl.java

@@ -209,8 +209,11 @@ public class MarketFrontServiceImpl implements MarketFrontService {
 		} else if (luckyDraw.getType() == LuckyDraw.Type.duration) {
 			MapBuilder builder = MapUtils.builder()
 					.field(GroupsRelationView::getUserId, userId)
+					.field(GroupsRelationView::getGoodsType, 1)
+					.field(GroupsRelationView::getGoodsSecondType, 2)
 					.field(GroupsRelationView::getStatus, "validity")
 					.field(GroupsRelationView::getExpiryTime).op(Operator.NotNull);
+			//特定奖池不选择时,默认查询所有非邀请制平台车票
 			if (goodsIdList != null && goodsIdList.size() > 0) {
 				builder.field(GroupsRelationView::getGoodsId, goodsIdList).op(Operator.InList);
 			}
@@ -587,7 +590,7 @@ public class MarketFrontServiceImpl implements MarketFrontService {
 			throw BusinessRuntimeException.getInstance("暂未配置特定奖池平台,请联系客服");
 		}
 		String sysValue = lottery_specific_goods.getSysValue();
-		if (sysValue == null) {
+		if (StrUtil.isEmpty(sysValue)) {
 			throw BusinessRuntimeException.getInstance("");
 		}
 		List<Long> goodsIdList = Jsons.parseList(sysValue, Long.class);
@@ -623,12 +626,14 @@ public class MarketFrontServiceImpl implements MarketFrontService {
 			return new ArrayList<>();
 		}
 		String sysValue = lottery_specific_goods.getSysValue();
-		if (sysValue == null) {
+		if (StrUtil.isEmpty(sysValue)) {
 			return new ArrayList<>();
 		}
 		List<Long> goodsIdList = Jsons.parseList(sysValue, Long.class);
 		MapBuilder builder = MapUtils.builder()
 				.field(GroupsRelationView::getUserId, userId)
+				.field(GroupsRelationView::getGoodsType, 1)
+				.field(GroupsRelationView::getGoodsSecondType, 2)
 				.field(GroupsRelationView::getStatus, "validity")
 				.field(GroupsRelationView::getExpiryTime).op(Operator.NotNull);
 		if (goodsIdList != null && goodsIdList.size() > 0) {
@@ -740,6 +745,9 @@ public class MarketFrontServiceImpl implements MarketFrontService {
 				.eq(LuckyDrawSpecificChanceRecord::getOrderId, orderId)
 				.eq(LuckyDrawSpecificChanceRecord::getUserId, userId)
 				.last("limit 1"));
+		if (record == null) {
+			return;
+		}
 		record.setRefundTime(refundTime);
 		luckyDrawSpecificChanceRecordMapper.updateById(record);
 		luckyDrawSpecificChanceMapper.subChanceNumNoRepeat(userId);
@@ -751,11 +759,15 @@ public class MarketFrontServiceImpl implements MarketFrontService {
 			return false;
 		}
 		String sysValue = lottery_specific_goods.getSysValue();
-		if (sysValue == null) {
+		if (StrUtil.isEmpty(sysValue)) {
 			return false;
 		}
 		List<Long> goodsIdList = Jsons.parseList(sysValue, Long.class);
-		if (goodsIdList.isEmpty() || goodsIdList.contains(goodsId)) {
+
+		if (goodsIdList.isEmpty() || goodsIdList.contains(null)) {
+			return false;
+		}
+		if (goodsIdList.contains(goodsId)) {
 			return true;
 		}
 		return false;