Przeglądaj źródła

Merge branch 'master' into pre

# Conflicts:
#	netflix-service/src/main/java/com/cyksj/redis/RedisService.java
#	netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupRelationFrontServiceImpl.java
zoujiajian 2 lat temu
rodzic
commit
dd2c5c16f4

+ 6 - 2
netflix-service/src/main/java/com/cyksj/service/mail/impl/CuiQiuMailServiceImpl.java

@@ -55,6 +55,7 @@ public class CuiQiuMailServiceImpl implements CuiQiuMailService {
 		params.put("mail_id", ADMIN_MAIL_ID);
 		params.put("start_time", DateUtil.offsetDay(now, -1).toDateStr());
 		params.put("end_time", DateUtil.offsetDay(now, 1).toDateStr());
+		params.put("to", email);
 		params.put("limit", 20);
 
 		HttpRequest post = HttpUtil.createPost(url);
@@ -101,8 +102,11 @@ public class CuiQiuMailServiceImpl implements CuiQiuMailService {
 		CuiQiuEmailDetailDto.Content content = cuiQiuEmailDetailDto.getData().getContent();
 
 		String contentBody = content.getBody();
-
-		String code = StrUtil.subWithLength(contentBody, contentBody.indexOf("ADOBE"), 215);
+		String str = "color:#505050; font-family:adobe-clean, Helvetica Neue, Helvetica, Verdana, Arial, sans-serif;";
+		String code = StrUtil.subWithLength(contentBody, contentBody.indexOf(str), 512);
+		if (StrUtil.isNotBlank(code)) {
+			code = code.replace(str, "");
+		}
 		return StringUtil.getVerifyCodePattern(code);
 	}
 }

+ 4 - 0
netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonServiceImpl.java

@@ -1003,6 +1003,10 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 			updateOrder.setStatus(goodsDon.getType() == 1 && goodsDon.getSecondType() == 2 ? OrderDon.Status.complete : OrderDon.Status.hasPayment);
 			updateGroupsTicket(updateOrder, goodsDon, sku);
 			orderDonMapper.updateById(updateOrder);
+			//余额使用记录
+			if (orderDon.getBalance().compareTo(BigDecimal.ZERO) > 0) {
+				userBenefitsService.recordBalanceBySource(orderDon.getUserId(), orderDon.getBalance().negate(), UserBalanceSourceRecord.Source.payment, orderDon.getId(), goodsDon.getTitle() + UserBalanceSourceRecord.Source.payment.getDesc());
+			}
 			return updateOrder;
 		}
 		//记录订单ip关联

+ 10 - 10
netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupRelationFrontServiceImpl.java

@@ -639,14 +639,14 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 		DateTime now = DateTime.now();
 		DateTime thisZero = DateUtil.beginOfDay(now);
 		String thisDate = thisZero.toDateStr();
-//		Object exists = redisService.get(RedisService.key.TICKET_EXPIRY_NOTIFY_DAY.getNameFormat(thisDate, userId));
-//		if (exists != null) {
-//			return null;
-//		}
+		Object exists = redisService.get(RedisService.key.TICKET_EXPIRY_NOTIFY_DAY.getNameFormat(thisDate, userId));
+		if (exists != null) {
+			return null;
+		}
 		User u = userMapper.selectById(userId);
 		if (u == null) throw BusinessRuntimeException.getGatewayApiCode(GatewayApiCode.CMS_TOKEN_VALID);
 		if (u.getIsBlack()) {
-//			redisService.setNx(RedisService.key.TICKET_EXPIRY_NOTIFY_DAY.getNameFormat(thisDate, userId), userId, RedisService.key.TICKET_EXPIRY_NOTIFY_DAY.getTimeout());
+			redisService.setNx(RedisService.key.TICKET_EXPIRY_NOTIFY_DAY.getNameFormat(thisDate, userId), userId, RedisService.key.TICKET_EXPIRY_NOTIFY_DAY.getTimeout());
 			return null;
 		}
 		List<Long> userIds = userBindRelationService.getRelationUserIdList(userId, u);
@@ -659,10 +659,10 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 				.orderBy(RenewalView::getExpiryTime).asc()
 				.onlySelect(RenewalView::getSkuNum, RenewalView::getExpiryTime, RenewalView::getRelationId, RenewalView::getAccount, RenewalView::getGoodsId, RenewalView::getTitle, RenewalView::getLogo, RenewalView::getImg, RenewalView::getGroupId, RenewalView::getSkuId, RenewalView::getSpecVal, RenewalView::getGoodsStatus, RenewalView::getSkuStatus)
 				.build());
-//		if (list.size() > 5) {
-////			redisService.setNx(RedisService.key.TICKET_EXPIRY_NOTIFY_DAY.getNameFormat(thisDate, userId), userId, RedisService.key.TICKET_EXPIRY_NOTIFY_DAY.getTimeout());
-//			return null;
-//		}
+		if (list.size() > 5) {
+			redisService.setNx(RedisService.key.TICKET_EXPIRY_NOTIFY_DAY.getNameFormat(thisDate, userId), userId, RedisService.key.TICKET_EXPIRY_NOTIFY_DAY.getTimeout());
+			return null;
+		}
 		//提前7天
 		AtomicInteger day = new AtomicInteger(7);
 		List<RenewalView> expiryTickets = list.stream().filter(ticket -> {
@@ -683,7 +683,7 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 			}
 			return false;
 		}).collect(Collectors.toList());
-//		redisService.setNx(RedisService.key.TICKET_EXPIRY_NOTIFY_DAY.getNameFormat(thisDate, userId), userId, RedisService.key.TICKET_EXPIRY_NOTIFY_DAY.getTimeout());
+		redisService.setNx(RedisService.key.TICKET_EXPIRY_NOTIFY_DAY.getNameFormat(thisDate, userId), userId, RedisService.key.TICKET_EXPIRY_NOTIFY_DAY.getTimeout());
 		return expiryTickets;
 	}