|
@@ -607,17 +607,17 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
|
|
|
log.error("解析skipSopJson失败,原始值: '{}'", ruleTimeVO.getSkipSopJson(), e);
|
|
log.error("解析skipSopJson失败,原始值: '{}'", ruleTimeVO.getSkipSopJson(), e);
|
|
|
paramList = new ArrayList<>();
|
|
paramList = new ArrayList<>();
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
List<SopParam> dayList = paramList.stream()
|
|
List<SopParam> dayList = paramList.stream()
|
|
|
- .filter(e -> e.getDayNum() != null && !e.getDayNum().trim().isEmpty()
|
|
|
|
|
|
|
+ .filter(e -> e.getDayNum() != null && !e.getDayNum().trim().isEmpty()
|
|
|
&& e.getStartDate() == null && e.getEndDate() == null)
|
|
&& e.getStartDate() == null && e.getEndDate() == null)
|
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
|
List<SopParam> timeList = paramList.stream()
|
|
List<SopParam> timeList = paramList.stream()
|
|
|
- .filter(e -> e.getDayNum() != null && !e.getDayNum().trim().isEmpty()
|
|
|
|
|
|
|
+ .filter(e -> e.getDayNum() != null && !e.getDayNum().trim().isEmpty()
|
|
|
&& e.getStartDate() != null && e.getEndDate() != null)
|
|
&& e.getStartDate() != null && e.getEndDate() != null)
|
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
|
Map<String, List<SopParam>> timeMap = PubFun.listToMapByGroupList(timeList, e -> e.getDayNum());
|
|
Map<String, List<SopParam>> timeMap = PubFun.listToMapByGroupList(timeList, e -> e.getDayNum());
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (CollectionUtils.isNotEmpty(dayList)) {
|
|
if (CollectionUtils.isNotEmpty(dayList)) {
|
|
|
for (SopParam sopParam : dayList) {
|
|
for (SopParam sopParam : dayList) {
|
|
|
String dayNum = sopParam.getDayNum();
|
|
String dayNum = sopParam.getDayNum();
|
|
@@ -859,7 +859,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
|
|
|
log.error("contactId.getExternalContactId() 为 null,contactId: {}", contactId);
|
|
log.error("contactId.getExternalContactId() 为 null,contactId: {}", contactId);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
String externalId = contactId.getExternalId().toString();
|
|
String externalId = contactId.getExternalId().toString();
|
|
|
String externalUserName = contactId.getExternalUserName();
|
|
String externalUserName = contactId.getExternalUserName();
|
|
|
Long fsUserId = contactId.getFsUserId();
|
|
Long fsUserId = contactId.getFsUserId();
|
|
@@ -968,18 +968,18 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
|
|
|
log.error("logVo.getUserId() 为 null,logVo: {}", JSON.toJSONString(logVo));
|
|
log.error("logVo.getUserId() 为 null,logVo: {}", JSON.toJSONString(logVo));
|
|
|
throw new RuntimeException("logVo.getUserId() 为 null");
|
|
throw new RuntimeException("logVo.getUserId() 为 null");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
String[] userKey = logVo.getUserId().split("\\|");
|
|
String[] userKey = logVo.getUserId().split("\\|");
|
|
|
log.info("sopLogVo:{}", JSON.toJSONString(logVo));
|
|
log.info("sopLogVo:{}", JSON.toJSONString(logVo));
|
|
|
log.info("sop_logs -》 userId:{}", logVo.getUserId());
|
|
log.info("sop_logs -》 userId:{}", logVo.getUserId());
|
|
|
log.info("sop_logs -》 userId -》 split:{}", Arrays.asList(userKey));
|
|
log.info("sop_logs -》 userId -》 split:{}", Arrays.asList(userKey));
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 检查 userKey 数组长度
|
|
// 检查 userKey 数组长度
|
|
|
if (userKey.length < 3) {
|
|
if (userKey.length < 3) {
|
|
|
log.error("userKey 数组长度不足,userKey: {}, logVo: {}", Arrays.asList(userKey), JSON.toJSONString(logVo));
|
|
log.error("userKey 数组长度不足,userKey: {}, logVo: {}", Arrays.asList(userKey), JSON.toJSONString(logVo));
|
|
|
throw new RuntimeException("userKey 数组长度不足");
|
|
throw new RuntimeException("userKey 数组长度不足");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
sopLogs.setCompanyId(Long.valueOf(userKey[2].trim()));
|
|
sopLogs.setCompanyId(Long.valueOf(userKey[2].trim()));
|
|
|
if (StringUtils.isNotEmpty(userKey[0].trim())){
|
|
if (StringUtils.isNotEmpty(userKey[0].trim())){
|
|
|
sopLogs.setQwUserKey(Long.valueOf(userKey[0].trim()));
|
|
sopLogs.setQwUserKey(Long.valueOf(userKey[0].trim()));
|
|
@@ -1398,6 +1398,11 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
|
|
|
: null;
|
|
: null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 根据客户评级获取小程序类型索引
|
|
|
|
|
+ * @param grade 客户评级:1=A级,2=B级,3=C级,4=D级,5=E级
|
|
|
|
|
+ * @return 小程序类型索引:0=主要小程序(A/B级),1=备用小程序(C/D/E级)
|
|
|
|
|
+ */
|
|
|
private static int getLevel(Integer grade) {
|
|
private static int getLevel(Integer grade) {
|
|
|
int effectiveGrade = (grade == null) ? 5 : grade;
|
|
int effectiveGrade = (grade == null) ? 5 : grade;
|
|
|
int listIndex = (effectiveGrade == 1 || effectiveGrade == 2) ? 0 : 1;
|
|
int listIndex = (effectiveGrade == 1 || effectiveGrade == 2) ? 0 : 1;
|
|
@@ -1797,7 +1802,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
|
|
|
log.error("createLiveWatchLogAndEnQueue - externalId 为空,跳过生成直播看课记录");
|
|
log.error("createLiveWatchLogAndEnQueue - externalId 为空,跳过生成直播看课记录");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 写入对应数据源的记录表
|
|
// 写入对应数据源的记录表
|
|
|
LiveWatchLog itemLiveWatchLog = new LiveWatchLog();
|
|
LiveWatchLog itemLiveWatchLog = new LiveWatchLog();
|
|
|
itemLiveWatchLog.setLiveId(liveId);
|
|
itemLiveWatchLog.setLiveId(liveId);
|
|
@@ -2490,6 +2495,14 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
|
|
|
if (qwUser == null){
|
|
if (qwUser == null){
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // 获取客户评级信息
|
|
|
|
|
+ QwExternalContact externalContact = null;
|
|
|
|
|
+ if (sopLogs.getExternalId() != null) {
|
|
|
|
|
+ externalContact = qwExternalContactMapper.selectById(sopLogs.getExternalId());
|
|
|
|
|
+ }
|
|
|
|
|
+ Integer grade = (externalContact != null && externalContact.getLevel() != null) ? externalContact.getLevel() : null;
|
|
|
|
|
+
|
|
|
for (QwSopCourseFinishTempSetting.Setting st : settings) {
|
|
for (QwSopCourseFinishTempSetting.Setting st : settings) {
|
|
|
switch (st.getContentType()) {
|
|
switch (st.getContentType()) {
|
|
|
//小程序单独
|
|
//小程序单独
|
|
@@ -2505,7 +2518,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
|
|
|
if (!miniMap.isEmpty() && qwUser.getSendMsgType() == 1) {
|
|
if (!miniMap.isEmpty() && qwUser.getSendMsgType() == 1) {
|
|
|
Map<Integer, List<CompanyMiniapp>> integerListMap = miniMap.get(Long.valueOf(qwUser.getCompanyId()));
|
|
Map<Integer, List<CompanyMiniapp>> integerListMap = miniMap.get(Long.valueOf(qwUser.getCompanyId()));
|
|
|
if (integerListMap != null) {
|
|
if (integerListMap != null) {
|
|
|
- int listIndex = 0;
|
|
|
|
|
|
|
+ int listIndex = getLevel(grade);
|
|
|
List<CompanyMiniapp> miniapps = integerListMap.get(listIndex);
|
|
List<CompanyMiniapp> miniapps = integerListMap.get(listIndex);
|
|
|
|
|
|
|
|
if (miniapps != null && !miniapps.isEmpty()) {
|
|
if (miniapps != null && !miniapps.isEmpty()) {
|