zoujiajian 2 лет назад
Родитель
Сommit
457a4c9689

+ 28 - 29
netflix-service/src/main/java/com/cyksj/service/template/impl/TemplateCommonServiceImpl.java

@@ -212,37 +212,36 @@ public class TemplateCommonServiceImpl implements TemplateCommonService {
 
 	@Override
 	public void sendAccountTemplateMsg(Account account) throws Exception {
-		if (!EnvCommonService.active.equals(envCommonService.getEnv())) {
-			List<GroupsRelationView> relations = beanSearcher.searchList(GroupsRelationView.class, MapUtils.builder()
-					.field(GroupsRelationView::getAccountId, account.getId())
-					.field(GroupsRelationView::getStatus, "validity")
-					.build());
-			if (CollUtil.isEmpty(relations)) {
+		boolean isPrd = envCommonService.isPrdEnv();
+		List<GroupsRelationView> relations = beanSearcher.searchList(GroupsRelationView.class, MapUtils.builder()
+				.field(GroupsRelationView::getAccountId, account.getId())
+				.field(GroupsRelationView::getStatus, "validity")
+				.build());
+		if (CollUtil.isEmpty(relations)) {
+			return;
+		}
+		Boolean isPrdEnv = envCommonService.isPrdEnv();
+		GoodsDon goodsDon = goodsDonMapper.selectById(account.getGoodsId());
+		String title = goodsDon != null ? goodsDon.getTitle() : "车票";
+		DateTime now = DateTime.now();
+		log.info("开始发送账号修改密码模板消息,大小:{}", relations.size());
+		Long skuId = relations.get(0).getSkuId();
+		userSysMsgNotifyService.recordUserAccountUpdateSysMsg(account.getGoodsId(), skuId, relations, account.getAccount(), goodsDon.getTitle());
+		for (GroupsRelationView relation : relations) {
+			if (relation.getExpiryTime() == null) {
 				return;
 			}
-			Boolean isPrdEnv = envCommonService.isPrdEnv();
-			GoodsDon goodsDon = goodsDonMapper.selectById(account.getGoodsId());
-			String title = goodsDon != null ? goodsDon.getTitle() : "车票";
-			DateTime now = DateTime.now();
-			log.info("开始发送账号修改密码模板消息,大小:{}", relations.size());
-			Long skuId = relations.get(0).getSkuId();
-			userSysMsgNotifyService.recordUserAccountUpdateSysMsg(account.getGoodsId(), skuId, relations, account.getAccount(), goodsDon.getTitle());
-			for (GroupsRelationView relation : relations) {
-				if (relation.getExpiryTime() == null) {
-					return;
-				}
-				//账号有效期小于5天的人,不发账号替换/改密码短信提醒
-				if (now.after(DateUtil.offsetDay(relation.getExpiryTime(), -5))) {
-					return;
-				}
-				//去掉GPT过滤平台
-				if (Constant.CHANGE_ACCOUNT_PWD_FILTER_GIDS.get(1) == account.getGoodsId()) {
-					return;
-				}
-				if (relation.getUserId() != 0 && isPrdEnv && relation.getYhsId() == 0) {
-					String msg = String.format(Constant.CHANGE_GROUPS_TRIPS_ACCOUNT, title);
-					smsService.sendSmsToRelationUser(relation.getUserId(), msg);
-				}
+			//账号有效期小于5天的人,不发账号替换/改密码短信提醒
+			if (now.after(DateUtil.offsetDay(relation.getExpiryTime(), -5))) {
+				return;
+			}
+			//去掉GPT过滤平台
+			if (Constant.CHANGE_ACCOUNT_PWD_FILTER_GIDS.get(1) == account.getGoodsId()) {
+				return;
+			}
+			if (relation.getUserId() != 0 && isPrdEnv && relation.getYhsId() == 0 && isPrd) {
+				String msg = String.format(Constant.CHANGE_GROUPS_TRIPS_ACCOUNT, title);
+				smsService.sendSmsToRelationUser(relation.getUserId(), msg);
 			}
 		}
 	}