|
|
@@ -3,6 +3,7 @@ package com.fs.his.task;
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
@@ -18,8 +19,12 @@ import com.fs.company.service.ICompanyService;
|
|
|
import com.fs.company.service.ICompanyUserService;
|
|
|
import com.fs.company.vo.QwIpadTotalVo;
|
|
|
import com.fs.company.vo.RedPacketMoneyVO;
|
|
|
+import com.fs.course.config.CourseConfig;
|
|
|
+import com.fs.course.domain.FsUserCoursePeriodDays;
|
|
|
import com.fs.course.dto.BatchSendCourseAllDTO;
|
|
|
import com.fs.course.mapper.FsCourseRedPacketLogMapper;
|
|
|
+import com.fs.course.mapper.FsUserCoursePeriodDaysMapper;
|
|
|
+import com.fs.course.service.IFsCourseLinkService;
|
|
|
import com.fs.course.service.IFsCourseWatchLogService;
|
|
|
import com.fs.course.service.ITencentCloudCosService;
|
|
|
import com.fs.erp.domain.ErpDeliverys;
|
|
|
@@ -67,6 +72,7 @@ import com.fs.sop.domain.QwSopTempVoice;
|
|
|
import com.fs.sop.service.IQwSopTempVoiceService;
|
|
|
import com.fs.system.domain.SysConfig;
|
|
|
import com.fs.system.mapper.SysConfigMapper;
|
|
|
+import com.fs.system.service.ISysConfigService;
|
|
|
import com.google.gson.Gson;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
@@ -203,6 +209,15 @@ public class Task {
|
|
|
@Autowired
|
|
|
private Hospital580PrescriptionScrmService prescriptionScrmService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private FsUserCoursePeriodDaysMapper fsUserCoursePeriodDaysMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IFsCourseLinkService fsCourseLinkService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ISysConfigService configService;
|
|
|
+
|
|
|
/**
|
|
|
* sop任务token消耗统计
|
|
|
*/
|
|
|
@@ -1559,4 +1574,49 @@ public class Task {
|
|
|
prescriptionScrmService.prescriptionInvalid();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 生成销售看课链接
|
|
|
+ * **/
|
|
|
+ public void generateSalesViewClassLink(){
|
|
|
+ //获取执行中的营期信息和营期课程
|
|
|
+ List<FsUserCoursePeriodDays> periodDaysList = fsUserCoursePeriodDaysMapper.getExecuteInformation();
|
|
|
+ if(!periodDaysList.isEmpty()){
|
|
|
+ //提取销售公司ID
|
|
|
+ String companyIds = periodDaysList.stream().map(FsUserCoursePeriodDays::getCompanyId).distinct().collect(Collectors.joining(","));
|
|
|
+ //获取销售公司以及对应员工信息
|
|
|
+ List<CompanyUser> companyUserList = companyUserMapper.getPeroidInformation(companyIds);
|
|
|
+ if(!companyUserList.isEmpty()){
|
|
|
+ //获取appid
|
|
|
+ String json = configService.selectConfigByKey("course.config");
|
|
|
+ CourseConfig config = JSON.parseObject(json, CourseConfig.class);
|
|
|
+ Map<String,List<CompanyUser>> companyUserMap = companyUserList.stream().collect(Collectors.groupingBy(c->String.valueOf(c.getCompanyId())));
|
|
|
+ periodDaysList.forEach(p->{
|
|
|
+ String[] companyIdList= p.getCompanyId().split(",");
|
|
|
+ for (String companyId: companyIdList){
|
|
|
+ List<CompanyUser> userList = companyUserMap.get(companyId);
|
|
|
+ userList.forEach(u->{
|
|
|
+ //组装请求数据
|
|
|
+ JSONObject jsonObject= new JSONObject();
|
|
|
+ jsonObject.put("id",p.getId());
|
|
|
+ jsonObject.put("projectCode","YJB");
|
|
|
+ jsonObject.put("videoId",p.getVideoId());
|
|
|
+ jsonObject.put("periodId",p.getPeriodId());
|
|
|
+ jsonObject.put("courseId",p.getCourseId());
|
|
|
+ jsonObject.put("projectId",p.getProjectId());
|
|
|
+ jsonObject.put("companyId",u.getCompanyId());
|
|
|
+ jsonObject.put("companyUserId",u.getUserId());
|
|
|
+ //生成看课链接
|
|
|
+ fsCourseLinkService.getGotoWxAppLink("/pages_course/videovip?course="+jsonObject.toJSONString(),config.getLoginMiniAppId());
|
|
|
+ try {
|
|
|
+ Thread.sleep(300);
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|