|
@@ -1,13 +1,17 @@
|
|
package com.fs.sop.service.impl;
|
|
package com.fs.sop.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.fs.common.core.domain.R;
|
|
import com.fs.common.core.domain.R;
|
|
import com.fs.common.core.redis.RedisCache;
|
|
import com.fs.common.core.redis.RedisCache;
|
|
import com.fs.common.utils.StringUtils;
|
|
import com.fs.common.utils.StringUtils;
|
|
|
|
+import com.fs.company.domain.CompanyUser;
|
|
|
|
+import com.fs.company.service.ICompanyUserService;
|
|
import com.fs.course.config.CourseConfig;
|
|
import com.fs.course.config.CourseConfig;
|
|
import com.fs.course.domain.FsCourseWatchLog;
|
|
import com.fs.course.domain.FsCourseWatchLog;
|
|
import com.fs.course.service.IFsCourseWatchLogService;
|
|
import com.fs.course.service.IFsCourseWatchLogService;
|
|
|
|
+import com.fs.course.service.IFsUserCompanyUserService;
|
|
import com.fs.fastGpt.service.IFastGptChatSessionService;
|
|
import com.fs.fastGpt.service.IFastGptChatSessionService;
|
|
import com.fs.qw.domain.QwExternalContact;
|
|
import com.fs.qw.domain.QwExternalContact;
|
|
import com.fs.qw.domain.QwUser;
|
|
import com.fs.qw.domain.QwUser;
|
|
@@ -99,6 +103,9 @@ public class QwSopLogsServiceImpl implements IQwSopLogsService
|
|
@Autowired
|
|
@Autowired
|
|
private IFastGptChatSessionService fastGptChatSessionService;
|
|
private IFastGptChatSessionService fastGptChatSessionService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private ICompanyUserService companyUserService;
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* 查询企业微信SOP 定时任务
|
|
* 查询企业微信SOP 定时任务
|
|
@@ -129,16 +136,38 @@ public class QwSopLogsServiceImpl implements IQwSopLogsService
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public List<QwSopLogsListCVO> selectQwSopLogsListBySopId(QwSopLogsParam param) {
|
|
public List<QwSopLogsListCVO> selectQwSopLogsListBySopId(QwSopLogsParam param) {
|
|
|
|
+ if (param == null || param.getType() == null) {
|
|
|
|
+ return Collections.emptyList();
|
|
|
|
+ }
|
|
|
|
|
|
- switch (param.getType()){
|
|
|
|
- //个微
|
|
|
|
|
|
+ switch (param.getType()) {
|
|
|
|
+ // 个微
|
|
case 1:
|
|
case 1:
|
|
return qwSopLogsMapper.selectQwSopLogsListByGwSopId(param);
|
|
return qwSopLogsMapper.selectQwSopLogsListByGwSopId(param);
|
|
- //企微
|
|
|
|
|
|
+ // 企微
|
|
case 2:
|
|
case 2:
|
|
- return qwSopLogsMapper.selectQwSopLogsListByQwSopId(param);
|
|
|
|
|
|
+ return handleQwSopLogs(param);
|
|
|
|
+ default:
|
|
|
|
+ return Collections.emptyList();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private List<QwSopLogsListCVO> handleQwSopLogs(QwSopLogsParam param) {
|
|
|
|
+ if (StringUtils.isNotEmpty(param.getPhone())) {
|
|
|
|
+ try {
|
|
|
|
+ CompanyUser companyUser = companyUserService.selectCompanyUserByPhone(param.getPhone());
|
|
|
|
+ if (companyUser == null) {
|
|
|
|
+ return Collections.emptyList();
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isEmpty(param.getQwUserid())) {
|
|
|
|
+ param.setQwUserid(companyUser.getQwUserId());
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ logger.error("根据手机号查询企业用户出现异常,手机号: {}, 异常信息: {}", param.getPhone(), e.getMessage(), e);
|
|
|
|
+ return Collections.emptyList();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- return null;
|
|
|
|
|
|
+ return qwSopLogsMapper.selectQwSopLogsListByQwSopId(param);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|