浏览代码

会员看课记录 可以根据 会员营期的开始时间和结束时候来查

三七 3 天之前
父节点
当前提交
955275a4dd

+ 64 - 6
fs-company/src/main/java/com/fs/company/controller/course/FsCourseWatchLogController.java

@@ -9,11 +9,10 @@ import com.fs.common.utils.ServletUtils;
 import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.company.service.impl.CompanyDeptServiceImpl;
 import com.fs.course.domain.FsCourseWatchLog;
-import com.fs.course.param.FsCourseOverParam;
-import com.fs.course.param.FsCourseUserStatisticsListParam;
-import com.fs.course.param.FsCourseWatchLogListParam;
-import com.fs.course.param.FsCourseWatchLogStatisticsListParam;
+import com.fs.course.param.*;
 import com.fs.course.service.IFsCourseWatchLogService;
+import com.fs.course.service.IFsUserCoursePeriodDaysService;
+import com.fs.course.service.IFsUserCoursePeriodService;
 import com.fs.course.vo.FsCourseOverVO;
 import com.fs.course.vo.FsCourseUserStatisticsListVO;
 import com.fs.course.vo.FsCourseWatchLogListVO;
@@ -54,6 +53,12 @@ public class FsCourseWatchLogController extends BaseController
     @Autowired
     private CompanyDeptServiceImpl companyDeptService;
 
+    @Autowired
+    private IFsUserCoursePeriodService userCoursePeriodService;
+
+    @Autowired
+    private IFsUserCoursePeriodDaysService userCoursePeriodDaysService;
+
     /**
      * 查询短链课程看课记录列表
      */
@@ -62,9 +67,26 @@ public class FsCourseWatchLogController extends BaseController
     public TableDataInfo list(FsCourseWatchLogListParam param)
     {
 
-        startPage();
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         param.setCompanyId( loginUser.getCompany().getCompanyId());
+
+        if (param.getSendType()==1&& param.getPeriodETime()!=null && param.getPeriodSTime()!=null) {
+            List<Long> periodIds = userCoursePeriodDaysService.selectFsUserCoursePeriodDaysByTime(param.getPeriodSTime(), param.getPeriodETime());
+
+            if (!periodIds.isEmpty()){
+                List<Long> longs = userCoursePeriodService.selectFsUserCoursePeriodListByPeriodId(periodIds, loginUser.getCompany().getCompanyId());
+                if (!longs.isEmpty()){
+                    param.setPeriodIds(longs);
+                }else {
+                    return getDataTable(new ArrayList<>());
+                }
+            }else {
+                return getDataTable(new ArrayList<>());
+            }
+
+        }
+
+        startPage();
         List<FsCourseWatchLogListVO> list = fsCourseWatchLogService.selectFsCourseWatchLogListVO(param);
         return getDataTable(list);
     }
@@ -96,6 +118,24 @@ public class FsCourseWatchLogController extends BaseController
         param.setUserType(loginUser.getUser().getUserType());
         param.setCompanyId(loginUser.getCompany().getCompanyId());
 
+
+        if (param.getSendType()==1&& param.getPeriodETime()!=null && param.getPeriodSTime()!=null) {
+            List<Long> periodIds = userCoursePeriodDaysService.selectFsUserCoursePeriodDaysByTime(param.getPeriodSTime(), param.getPeriodETime());
+
+            if (!periodIds.isEmpty()){
+                List<Long> longs = userCoursePeriodService.selectFsUserCoursePeriodListByPeriodId(periodIds, loginUser.getCompany().getCompanyId());
+                if (!longs.isEmpty()){
+                    param.setPeriodIds(longs);
+                }else {
+                    return getDataTable(new ArrayList<>());
+                }
+            }else {
+                return getDataTable(new ArrayList<>());
+            }
+
+        }
+
+
         startPage();
         List<FsCourseWatchLogListVO> list = fsCourseWatchLogService.selectFsCourseWatchLogListVO(param);
 
@@ -108,9 +148,27 @@ public class FsCourseWatchLogController extends BaseController
     @GetMapping("/myList")
     public TableDataInfo myList(FsCourseWatchLogListParam param)
     {
-        startPage();
+
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         param.setCompanyUserId( loginUser.getUser().getUserId());
+
+        if (param.getSendType()==1&& param.getPeriodETime()!=null && param.getPeriodSTime()!=null) {
+            List<Long> periodIds = userCoursePeriodDaysService.selectFsUserCoursePeriodDaysByTime(param.getPeriodSTime(), param.getPeriodETime());
+            if (!periodIds.isEmpty()){
+                List<Long> longs = userCoursePeriodService.selectFsUserCoursePeriodListByPeriodId(periodIds, loginUser.getCompany().getCompanyId());
+                if (!longs.isEmpty()){
+                    param.setPeriodIds(longs);
+                }else {
+                    return getDataTable(new ArrayList<>());
+                }
+            }else {
+                return getDataTable(new ArrayList<>());
+            }
+
+        }
+
+        startPage();
+
         List<FsCourseWatchLogListVO> list = fsCourseWatchLogService.selectFsCourseWatchLogListVO(param);
         return getDataTable(list);
     }

+ 4 - 0
fs-service/src/main/java/com/fs/course/mapper/FsUserCoursePeriodDaysMapper.java

@@ -5,6 +5,7 @@ import com.fs.course.domain.FsUserCoursePeriodDays;
 import com.fs.course.domain.FsUserWatchCourseStatistics;
 import com.fs.his.vo.OptionsVO;
 import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.annotations.Update;
 
 import java.time.LocalDateTime;
@@ -118,4 +119,7 @@ public interface FsUserCoursePeriodDaysMapper extends BaseMapper<FsUserCoursePer
     int updateBatchDelFlag(@Param("ids") Long [] ids, @Param("delFlag") Integer delFlag);
 
     Long selectFsUserCoursePeriodDaysCount(FsUserCoursePeriodDays fsUserCoursePeriodDays);
+
+    @Select("SELECT distinct period_id from fs_user_course_period_days  where start_date_time >=#{periodSTime} and end_date_time <=#{periodETime} ")
+    List<Long> selectFsUserCoursePeriodDaysByTime(@Param("periodSTime") String periodSTime,@Param("periodETime") String periodETime);
 }

+ 13 - 1
fs-service/src/main/java/com/fs/course/mapper/FsUserCoursePeriodMapper.java

@@ -5,7 +5,6 @@ import com.fs.course.param.CompanyRedPacketParam;
 import com.fs.course.param.PeriodStatisticCountParam;
 import com.fs.course.vo.FsUserCoursePeriodVO;
 import com.fs.course.vo.PeriodRedPacketVO;
-import org.apache.ibatis.annotations.MapKey;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.annotations.Update;
@@ -158,4 +157,17 @@ public interface FsUserCoursePeriodMapper
     Long setlectCorrectAnswerNum(PeriodStatisticCountParam param);
 
     List<FsUserCoursePeriod> selectFsPeriodlist(PeriodStatisticCountParam param);
+
+    @Select("select cp.period_id from fs_user_course_period cp left where company_id=#{companyId}")
+    List<Long> selectCoursePeriodDaysByTime(@Param("periodSTime") String periodSTime,@Param("periodETime") String periodETime,@Param("companyId") Long companyId);
+
+    @Select("<script>" +
+            "select period_id from fs_user_course_period where " +
+            "FIND_IN_SET(#{companyId}, company_id) > 0 " +
+            " AND period_id IN" +
+            "<foreach collection='periodIds' item='periodId' open='(' separator=',' close=')'> " +
+            "#{periodId} " +
+            "</foreach> " +
+            "</script> ")
+    List<Long> selectFsUserCoursePeriodListByPeriodId(@Param("periodIds") List<Long> qwUserIds,@Param("companyId") Long companyId);
 }

+ 9 - 0
fs-service/src/main/java/com/fs/course/param/FsCourseWatchLogListParam.java

@@ -57,12 +57,21 @@ public class FsCourseWatchLogListParam implements Serializable {
     @JsonFormat(pattern = "yyyy-MM-dd")
     private String qecETime;
 
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private String periodSTime;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private String periodETime;
+
     private List<String> sopIds;
 
 
     private Long taskId;//任务ID
     private Long project;//任务ID
 
+    private List<Long> periodIds;//训练营期ID
+
     private String customPageStr;
 
     private Long lastId;

+ 4 - 1
fs-service/src/main/java/com/fs/course/service/IFsUserCoursePeriodDaysService.java

@@ -118,5 +118,8 @@ public interface IFsUserCoursePeriodDaysService extends IService<FsUserCoursePer
      */
     void changePeriodCourseStatus();
 
-        long periodCourseByCount(PeriodCountParam param);
+    long periodCourseByCount(PeriodCountParam param);
+
+    List<Long> selectFsUserCoursePeriodDaysByTime(String periodSTime,String periodETime);
+
     }

+ 5 - 1
fs-service/src/main/java/com/fs/course/service/IFsUserCoursePeriodService.java

@@ -5,7 +5,6 @@ import com.fs.course.param.PeriodStatisticCountParam;
 import com.fs.course.vo.FsCourseStaticsCountVO;
 import com.fs.course.vo.FsUserCoursePeriodVO;
 
-import java.math.BigDecimal;
 import java.util.List;
 
 /**
@@ -97,4 +96,9 @@ public interface IFsUserCoursePeriodService
      * @return
      */
     List<FsUserCoursePeriod> selectFsPeriodlist(PeriodStatisticCountParam param);
+
+    List<Long> selectCoursePeriodDaysByTime(String periodSTime,String periodETime,Long companyId);
+
+    List<Long> selectFsUserCoursePeriodListByPeriodId(List<Long> periodIds,Long companyId);
+
 }

+ 1 - 0
fs-service/src/main/java/com/fs/course/service/impl/FsCourseWatchLogServiceImpl.java

@@ -617,6 +617,7 @@ public class FsCourseWatchLogServiceImpl extends ServiceImpl<FsCourseWatchLogMap
 
     @Override
     public List<FsCourseWatchLogListVO> selectFsCourseWatchLogListVO(FsCourseWatchLogListParam param) {
+
         List<FsCourseWatchLogListVO> fsCourseWatchLogListVOS = fsCourseWatchLogMapper.selectFsCourseWatchLogListVO(param);
         List<FsUserCoursePeriod> fsUserCoursePeriods = userCoursePeriodService.selectFsUserCoursePeriodList(new FsUserCoursePeriod());
 

+ 5 - 0
fs-service/src/main/java/com/fs/course/service/impl/FsUserCoursePeriodDaysServiceImpl.java

@@ -419,6 +419,11 @@ public class FsUserCoursePeriodDaysServiceImpl extends ServiceImpl<FsUserCourseP
         return baseMapper.selectFsUserCoursePeriodDaysCount(fsUserCoursePeriodDays);
     }
 
+    @Override
+    public List<Long> selectFsUserCoursePeriodDaysByTime(String periodSTime, String periodETime) {
+        return fsUserCoursePeriodDaysMapper.selectFsUserCoursePeriodDaysByTime(periodSTime,periodETime);
+    }
+
     private static FsCourseAnalysisCountVO getCourseAnalysisCountVO(FsUserCoursePeriodDays v, Map<Long, FsCourseAnalysisCountVO> courseMap, Map<Long, FsCourseAnalysisCountVO> redPacketMap, Map<Long, FsCourseAnalysisCountVO> answerMap) {
         FsCourseAnalysisCountVO countVO = new FsCourseAnalysisCountVO();
         FsCourseAnalysisCountVO courseVO = courseMap.getOrDefault(v.getVideoId(), countVO);

+ 11 - 4
fs-service/src/main/java/com/fs/course/service/impl/FsUserCoursePeriodServiceImpl.java

@@ -25,10 +25,7 @@ import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.temporal.ChronoUnit;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Objects;
-import java.util.Set;
+import java.util.*;
 import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
@@ -301,4 +298,14 @@ public class FsUserCoursePeriodServiceImpl implements IFsUserCoursePeriodService
     public List<FsUserCoursePeriod> selectFsPeriodlist(PeriodStatisticCountParam param) {
         return fsUserCoursePeriodMapper.selectFsPeriodlist(param);
     }
+
+    @Override
+    public List<Long> selectCoursePeriodDaysByTime(String periodSTime, String periodETime,Long companyId) {
+        return fsUserCoursePeriodMapper.selectCoursePeriodDaysByTime(periodSTime,periodETime,companyId);
+    }
+
+    @Override
+    public List<Long> selectFsUserCoursePeriodListByPeriodId(List<Long> periodIds, Long companyId) {
+        return fsUserCoursePeriodMapper.selectFsUserCoursePeriodListByPeriodId(periodIds,companyId);
+    }
 }

+ 4 - 4
fs-service/src/main/java/com/fs/qw/service/impl/QwExternalContactServiceImpl.java

@@ -5835,10 +5835,10 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
         return qwExternalContactMapper.selectQwUserDelLossList(param);
     }
 
-    @Override
-    public void updateQwExternalContactStatusById(QwExternalContact qwExternalContact) {
-        qwExternalContactMapper.updateQwExternalContactStatusById(qwExternalContact);
-    }
+//    @Override
+//    public void updateQwExternalContactStatusById(QwExternalContact qwExternalContact) {
+//        qwExternalContactMapper.updateQwExternalContactStatusById(qwExternalContact);
+//    }
 
 
     public Boolean getSopAiChatByRedis(String qwUserId,String corpId,String externalUserId){

+ 8 - 0
fs-service/src/main/resources/mapper/course/FsCourseWatchLogMapper.xml

@@ -145,6 +145,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="maps.sopId != null  and maps.sopId != '' ">
                 and l.sop_id = #{maps.sopId}
             </if>
+
+            <if test="maps.periodIds != null and maps.periodIds.size() > 0">
+                and l.period_id in
+                <foreach item="periodId" index="index" collection="maps.periodIds" open="(" separator="," close=")">
+                    #{periodId}
+                </foreach>
+            </if>
+
         </where>
          order by l.finish_time desc,l.update_time desc,l.create_time desc
     </select>