|
|
@@ -1,6 +1,8 @@
|
|
|
package com.fs.sop.service.impl;
|
|
|
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.fs.common.annotation.DataSource;
|
|
|
import com.fs.common.core.domain.R;
|
|
|
@@ -11,12 +13,15 @@ import com.fs.common.utils.StringUtils;
|
|
|
import com.fs.company.domain.CompanyUser;
|
|
|
import com.fs.company.mapper.CompanyUserMapper;
|
|
|
import com.fs.company.vo.CompanyQwUserByIdsVo;
|
|
|
+import com.fs.course.config.CourseConfig;
|
|
|
import com.fs.course.mapper.FsCourseWatchLogMapper;
|
|
|
import com.fs.course.service.IFsCourseLinkService;
|
|
|
import com.fs.course.service.IFsCourseWatchLogService;
|
|
|
import com.fs.course.vo.FsCourseWatchLogStatisticsListVO;
|
|
|
import com.fs.his.mapper.FsUserMapper;
|
|
|
import com.fs.his.service.IFsUserService;
|
|
|
+import com.fs.his.utils.ConfigUtil;
|
|
|
+import com.fs.hisStore.enums.SysConfigEnum;
|
|
|
import com.fs.qw.domain.QwExternalContact;
|
|
|
import com.fs.qw.domain.QwSopUpdateStatus;
|
|
|
import com.fs.qw.domain.QwUser;
|
|
|
@@ -39,6 +44,7 @@ import com.fs.sop.vo.SopVoiceListVo;
|
|
|
import com.fs.sop.vo.VoiceVo;
|
|
|
import com.fs.store.param.h5.UserStatisticsCommonParam;
|
|
|
import com.fs.store.vo.h5.*;
|
|
|
+import com.fs.system.domain.SysConfig;
|
|
|
import com.fs.voice.utils.StringUtil;
|
|
|
import com.fs.wxUser.mapper.CompanyWxUserMapper;
|
|
|
import com.fs.wxUser.param.CompanyWxUserSopParam;
|
|
|
@@ -69,8 +75,7 @@ import java.util.stream.Collectors;
|
|
|
* @date 2024-07-31
|
|
|
*/
|
|
|
@Service
|
|
|
-public class QwSopServiceImpl implements IQwSopService
|
|
|
-{
|
|
|
+public class QwSopServiceImpl implements IQwSopService {
|
|
|
private static final Logger log = LoggerFactory.getLogger(QwSopServiceImpl.class);
|
|
|
|
|
|
@Autowired
|
|
|
@@ -117,6 +122,8 @@ public class QwSopServiceImpl implements IQwSopService
|
|
|
private CompanyUserMapper companyUserMapper;
|
|
|
|
|
|
private IQwSopTempVoiceService qwSopTempVoiceService;
|
|
|
+ @Autowired
|
|
|
+ private ConfigUtil configUtil;
|
|
|
|
|
|
@Autowired
|
|
|
public void setIQwSopTempVoiceService(@Lazy IQwSopTempVoiceService qwSopTempVoiceService) {
|
|
|
@@ -142,6 +149,9 @@ public class QwSopServiceImpl implements IQwSopService
|
|
|
|
|
|
@Autowired
|
|
|
private FsUserMapper fsUserMapper;
|
|
|
+
|
|
|
+ private static final Long COURSE_CONFIG_ID = 10L;
|
|
|
+
|
|
|
/**
|
|
|
* 查询企微sop
|
|
|
*
|
|
|
@@ -155,7 +165,6 @@ public class QwSopServiceImpl implements IQwSopService
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 查询企微sop列表
|
|
|
*
|
|
|
@@ -1370,6 +1379,52 @@ public class QwSopServiceImpl implements IQwSopService
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Integer updateGroupSopStatus(SysConfig config) {
|
|
|
+ if (Objects.equals(config.getConfigId(), COURSE_CONFIG_ID)) {
|
|
|
+ String configValue = config.getConfigValue();
|
|
|
+ if (configValue != null && configValue.contains("roomLinkAllow")) {
|
|
|
+ try {
|
|
|
+ CourseConfig newConfig = JSONUtil.toBean(configValue, CourseConfig.class);
|
|
|
+ if (Boolean.TRUE.equals(newConfig.getRoomLinkAllow())) {
|
|
|
+ // 获取旧配置
|
|
|
+ JSONObject oldConfig = configUtil.generateConfigByKey(SysConfigEnum.COURSE_CONFIG.getKey());
|
|
|
+ Boolean needUpdate = false;
|
|
|
+ if (oldConfig == null) {
|
|
|
+ // 旧配置不存在,需要更新
|
|
|
+ needUpdate = true;
|
|
|
+ } else {
|
|
|
+ String oldValueStr = oldConfig.getString("roomLinkAllow");
|
|
|
+ if (oldValueStr == null) {
|
|
|
+ // 旧配置没有该字段,需要更新
|
|
|
+ needUpdate = true;
|
|
|
+ } else {
|
|
|
+ Boolean oldValue = Boolean.parseBoolean(oldValueStr);
|
|
|
+ // 新旧值不同时才需要更新
|
|
|
+ needUpdate = !newConfig.getRoomLinkAllow().equals(oldValue);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (needUpdate) {
|
|
|
+ qwSopLogsMapper.updateGroupSopStatus();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("处理课程配置异常", e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ private CourseConfig parseCourseConfig(String configValue) {
|
|
|
+ try {
|
|
|
+ return JSONUtil.toBean(configValue, CourseConfig.class);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("解析课程配置失败: {}", configValue, e);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取外部联系人信息
|
|
|
* */
|