|
@@ -1,5 +1,6 @@
|
|
|
package com.fs.app.service;
|
|
package com.fs.app.service;
|
|
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.fs.common.core.redis.RedisCache;
|
|
import com.fs.common.core.redis.RedisCache;
|
|
|
import com.fs.common.exception.base.BaseException;
|
|
import com.fs.common.exception.base.BaseException;
|
|
@@ -12,6 +13,7 @@ import com.fs.course.domain.FsCourseWatchLog;
|
|
|
import com.fs.course.service.IFsCourseWatchLogService;
|
|
import com.fs.course.service.IFsCourseWatchLogService;
|
|
|
import com.fs.ipad.IpadSendUtils;
|
|
import com.fs.ipad.IpadSendUtils;
|
|
|
import com.fs.ipad.vo.*;
|
|
import com.fs.ipad.vo.*;
|
|
|
|
|
+import com.fs.qw.domain.QwExternalContact;
|
|
|
import com.fs.qw.domain.QwUser;
|
|
import com.fs.qw.domain.QwUser;
|
|
|
import com.fs.qw.domain.QwUserVideo;
|
|
import com.fs.qw.domain.QwUserVideo;
|
|
|
import com.fs.qw.mapper.QwExternalContactMapper;
|
|
import com.fs.qw.mapper.QwExternalContactMapper;
|
|
@@ -31,6 +33,7 @@ import org.springframework.stereotype.Service;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
@Slf4j
|
|
@Slf4j
|
|
|
@Service
|
|
@Service
|
|
@@ -50,9 +53,29 @@ public class IpadSendServer {
|
|
|
private void sendMiniProgram(BaseVo vo, QwSopCourseFinishTempSetting.Setting content, Map<String, FsCoursePlaySourceConfig> miniMap, Long companyId) {
|
|
private void sendMiniProgram(BaseVo vo, QwSopCourseFinishTempSetting.Setting content, Map<String, FsCoursePlaySourceConfig> miniMap, Long companyId) {
|
|
|
String appid = content.getMiniprogramAppid();
|
|
String appid = content.getMiniprogramAppid();
|
|
|
if(companyId != null && content.getMiniType() != null){
|
|
if(companyId != null && content.getMiniType() != null){
|
|
|
- List<CompanyMiniapp> list = companyMiniappService.list(new QueryWrapper<CompanyMiniapp>().eq("company_id", companyId).eq("type", content.getMiniType()));
|
|
|
|
|
- if(!list.isEmpty() && list.get(0) != null && StringUtils.isNotEmpty(list.get(0).getAppId())){
|
|
|
|
|
- appid = list.get(0).getAppId();
|
|
|
|
|
|
|
+ log.info("打印企業信息------------------》:{}",companyId);
|
|
|
|
|
+ List<CompanyMiniapp> list = companyMiniappService.list(new QueryWrapper<CompanyMiniapp>().eq("company_id", companyId));
|
|
|
|
|
+ List<CompanyMiniapp> collect = list.stream().filter(e -> e.getType().equals(content.getMiniType())).collect(Collectors.toList());
|
|
|
|
|
+ if(!collect.isEmpty() && collect.get(0) != null && StringUtils.isNotEmpty(collect.get(0).getAppId())){
|
|
|
|
|
+ appid = collect.get(0).getAppId();
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!vo.isRoom()){
|
|
|
|
|
+ try {
|
|
|
|
|
+ log.error("打印查詢數據-------------------》{}",vo.getExId());
|
|
|
|
|
+ QwExternalContact qwExternalContact = qwExternalContactMapper.selectOne(new LambdaQueryWrapper<QwExternalContact>().eq(QwExternalContact::getQwUserId,vo.getQwUserId()).eq(QwExternalContact::getExternalUserId,vo.getExId()));
|
|
|
|
|
+ log.error("打印外部聯係人ID-------------------》{}",qwExternalContact.getId());
|
|
|
|
|
+ LocalDateTime createTime = qwExternalContact.getCreateTime() == null ? LocalDateTime.now() : DateUtil.dateToLocalDateTime(qwExternalContact.getCreateTime());
|
|
|
|
|
+ LocalDateTime lastTime = LocalDateTime.of(2025, 11, 6, 23, 59, 59);
|
|
|
|
|
+ int listIndex = createTime.isAfter(lastTime) ? 1 : 0 ;
|
|
|
|
|
+ List<CompanyMiniapp> collect2 = list.stream().filter(e -> e.getType().equals(listIndex)).collect(Collectors.toList());
|
|
|
|
|
+ if(!collect2.isEmpty() && collect2.get(0) != null && StringUtils.isNotEmpty(collect2.get(0).getAppId())){
|
|
|
|
|
+ appid = collect2.get(0).getAppId();
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ log.error("输出外部联系人ID-------------->{}",vo.getExId());
|
|
|
|
|
+ log.error("数据异常----------------------》{}",e.getMessage());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
FsCoursePlaySourceConfig courseMaConfig = miniMap.get(appid);
|
|
FsCoursePlaySourceConfig courseMaConfig = miniMap.get(appid);
|
|
@@ -340,6 +363,7 @@ public class IpadSendServer {
|
|
|
vo.setServerId(qwUser.getServerId());
|
|
vo.setServerId(qwUser.getServerId());
|
|
|
vo.setCorpCode(parentVo.getCorpCode());
|
|
vo.setCorpCode(parentVo.getCorpCode());
|
|
|
vo.setCorpId(parentVo.getCorpId());
|
|
vo.setCorpId(parentVo.getCorpId());
|
|
|
|
|
+ vo.setQwUserId(qwUser.getId());
|
|
|
try {
|
|
try {
|
|
|
content.setSendStatus(1);
|
|
content.setSendStatus(1);
|
|
|
switch (content.getContentType()) {
|
|
switch (content.getContentType()) {
|