chenbiao 2 tahun lalu
induk
melakukan
353e94125c

+ 4 - 1
netflix-service/src/main/java/com/cyksj/task/CorpChatScheduler.java

@@ -48,6 +48,7 @@ public class CorpChatScheduler {
 		Set<Object> chatRecord = redisService.sGet(RedisService.key.CORP_CUSTOMER_ACQUISTION_START_CHAT_SET.getEnvName());
 		log.info("发起对话回传. size: {}", chatRecord.size());
 		chatRecord.forEach((key) -> {
+			log.info("发起对话回传. key: {}", key);
 			CorpUserAuth corpUserAuth = corpUserAuthMapper.selectOne(Wrappers.lambdaQuery(CorpUserAuth.class)
 					.eq(CorpUserAuth::getExternalUserid, key).last("limit 1"));
 			String unionId = null;
@@ -57,14 +58,16 @@ public class CorpChatScheduler {
 					unionId = corpUser.getUnionid();
 				}
 			}
+			log.info("发起对话回传. unionId: {}", unionId);
 			if (StrUtil.isNotBlank(unionId)) {
-				String json = StringUtil.getString(redisService.hget(RedisService.key.CORP_CUSTOMER_ACQUISTION_START_CHAT.getEnvName(), StringUtil.getString(key)));
+				String json = StringUtil.getString(redisService.hget(RedisService.key.CORP_CUSTOMER_ACQUISTION_START_CHAT.getEnvName(), unionId));
 				if (StringUtil.isNotBlank(json)) {
 					JSONObject jsonObject = JSONUtil.parseObj(json);
 					String callback = jsonObject.getStr("callback");
 					try {
 						orderDonPostService.post(OrderDonPost.Type.OE.getType(), callback, Optional.ofNullable(jsonObject.getStr("event")).orElse("customer_effective"));
 						redisService.setRemove(RedisService.key.CORP_CUSTOMER_ACQUISTION_START_CHAT_SET.getEnvName(), key);
+						log.info("发起对话回传成功. {}", key);
 					} catch (Exception e) {
 						log.error("发起对话回传失败. {}", e.getMessage());
 					}