Browse Source

Merge remote-tracking branch 'origin/master'

xgb 1 month ago
parent
commit
24faa6965d
32 changed files with 282 additions and 84 deletions
  1. 27 27
      fs-admin/src/main/java/com/fs/task/SgTestController.java
  2. 1 1
      fs-admin/src/main/resources/logback.xml
  3. 13 0
      fs-company/src/main/java/com/fs/company/controller/course/FsCourseFinishTempController.java
  4. 20 2
      fs-company/src/main/java/com/fs/company/controller/course/qw/FsQwCourseWatchLogController.java
  5. 3 1
      fs-company/src/main/java/com/fs/framework/service/UserDetailsServiceImpl.java
  6. 3 1
      fs-service/src/main/java/com/fs/company/service/impl/CompanyServiceImpl.java
  7. 9 0
      fs-service/src/main/java/com/fs/course/domain/FsCourseFinishTemp.java
  8. 12 0
      fs-service/src/main/java/com/fs/course/mapper/FsCourseFinishTempMapper.java
  9. 2 1
      fs-service/src/main/java/com/fs/course/param/FsCourseWatchLogListParam.java
  10. 7 0
      fs-service/src/main/java/com/fs/course/service/IFsCourseFinishTempService.java
  11. 1 0
      fs-service/src/main/java/com/fs/course/service/IFsCourseWatchLogService.java
  12. 9 0
      fs-service/src/main/java/com/fs/course/service/impl/FsCourseFinishTempServiceImpl.java
  13. 2 0
      fs-service/src/main/java/com/fs/course/service/impl/FsCourseWatchLogServiceImpl.java
  14. 9 0
      fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java
  15. 7 0
      fs-service/src/main/java/com/fs/crm/param/CrmCustomerListQueryParam.java
  16. 3 1
      fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java
  17. 7 2
      fs-service/src/main/java/com/fs/qw/mapper/QwGroupChatUserMapper.java
  18. 42 2
      fs-service/src/main/java/com/fs/qw/mapper/QwWatchLogMapper.java
  19. 3 0
      fs-service/src/main/java/com/fs/qw/service/IQwWatchLogService.java
  20. 25 0
      fs-service/src/main/java/com/fs/qw/service/impl/QwWatchLogServiceImpl.java
  21. 21 1
      fs-service/src/main/java/com/fs/qw/vo/QwWatchLogStatisticsListVO.java
  22. 22 22
      fs-service/src/main/java/com/fs/tulin/service/impl/TulinInfoSyncLogServiceImpl.java
  23. 7 1
      fs-service/src/main/resources/application-config-druid-czt.yml
  24. 3 3
      fs-service/src/main/resources/application-dev.yml
  25. 2 2
      fs-service/src/main/resources/application-druid-jnmy-test.yml
  26. 2 2
      fs-service/src/main/resources/application-druid-jnmy.yml
  27. 3 3
      fs-service/src/main/resources/mapper/course/FsUserCoursePeriodMapper.xml
  28. 1 0
      fs-service/src/main/resources/mapper/his/FsExportTaskMapper.xml
  29. 3 0
      fs-service/src/main/resources/mapper/his/FsUserMapper.xml
  30. 10 10
      fs-service/src/main/resources/mapper/hisStore/SysOperLogScrmMapper.xml
  31. 2 2
      fs-service/src/main/resources/mapper/qw/QwFriendWelcomeMapper.xml
  32. 1 0
      fs-service/src/main/resources/mapper/qw/QwUserMapper.xml

+ 27 - 27
fs-admin/src/main/java/com/fs/task/SgTestController.java

@@ -1,27 +1,27 @@
-//package com.fs.task;
-//
-//import org.springframework.web.bind.annotation.RequestMapping;
-//import org.springframework.web.bind.annotation.RestController;
-//
-//import javax.annotation.Resource;
-//
-///**
-// * @description:
-// * @author: Guos
-// * @time: 2025/10/23 下午2:18
-// */
-//@RestController
-//@RequestMapping("/sg/test")
-//public class SgTestController {
-//
-//    @Resource
-//    private SyncTuLinStudentInfoTask syncTuLinStudentInfoTask;
-//
-//
-//    @RequestMapping("/execute")
-//    public void execute(){
-//        syncTuLinStudentInfoTask.execute();
-//    }
-//
-//
-//}
+package com.fs.task;
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+/**
+ * @description:
+ * @author: Guos
+ * @time: 2025/10/23 下午2:18
+ */
+@RestController
+@RequestMapping("/sg/test")
+public class SgTestController {
+
+    @Resource
+    private SyncTuLinStudentInfoTask syncTuLinStudentInfoTask;
+
+
+    @RequestMapping("/execute")
+    public void execute(){
+        syncTuLinStudentInfoTask.execute();
+    }
+
+
+}

+ 1 - 1
fs-admin/src/main/resources/logback.xml

@@ -72,7 +72,7 @@
     </appender>
 
 	<!-- 系统模块日志级别控制  -->
-	<logger name="com.fs" level="info" />
+	<logger name="com.fs" level="debug" />
 	<!-- Spring日志级别控制  -->
 	<logger name="org.springframework" level="warn" />
 

+ 13 - 0
fs-company/src/main/java/com/fs/company/controller/course/FsCourseFinishTempController.java

@@ -1,10 +1,12 @@
 package com.fs.company.controller.course;
 
+import com.alibaba.fastjson.JSON;
 import com.fs.common.annotation.Log;
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
 import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.course.domain.FsCourseFinishTemp;
 import com.fs.course.service.IFsCourseFinishTempService;
@@ -104,4 +106,15 @@ public class FsCourseFinishTempController extends BaseController
     {
         return toAjax(fsCourseFinishTempService.deleteFsCourseFinishTempByIds(ids));
     }
+
+
+    @Log(title = "完课模板", businessType = BusinessType.UPDATE)
+    @PostMapping("/updateStatusBatch")
+    public AjaxResult updateStatusBatch(@RequestBody FsCourseFinishTemp fsCourseFinishTemp)
+    {
+        fsCourseFinishTemp.setUpdateTime(DateUtils.getNowDate());
+
+        return toAjax(fsCourseFinishTempService.updateFsCourseFinishTempBatch(fsCourseFinishTemp));
+    }
+
 }

+ 20 - 2
fs-company/src/main/java/com/fs/company/controller/course/qw/FsQwCourseWatchLogController.java

@@ -19,6 +19,7 @@ import com.fs.framework.service.TokenService;
 import com.fs.qw.param.QwWatchLogStatisticsListParam;
 import com.fs.qw.service.IQwWatchLogService;
 import com.fs.qw.vo.QwWatchLogAllStatisticsListVO;
+import com.fs.qw.vo.QwWatchLogStatisticsListVO;
 import com.fs.sop.mapper.SopUserLogsMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -81,6 +82,21 @@ public class FsQwCourseWatchLogController extends BaseController
         List<FsCourseWatchLogStatisticsListVO> list = fsCourseWatchLogService.selectFsCourseWatchLogStatisticsListVO(param);
         return getDataTable(list);
     }
+    @PreAuthorize("@ss.hasPermi('course:courseWatchLog:statisticsList')")
+    @GetMapping("/statisticsExport")
+    public AjaxResult statisticsExport(FsCourseWatchLogStatisticsListParam param)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        param.setCompanyId( loginUser.getCompany().getCompanyId());
+        if (param.getSTime()==null||param.getETime()==null){
+            return AjaxResult.error("请选择时间");
+        }
+        param.setSendType(2);
+        List<FsCourseWatchLogStatisticsListVO> list = fsCourseWatchLogService.selectFsCourseWatchLogStatisticsListVO(param);
+        ExcelUtil<FsCourseWatchLogStatisticsListVO> util = new ExcelUtil<FsCourseWatchLogStatisticsListVO>(FsCourseWatchLogStatisticsListVO.class);
+        return util.exportExcel(list, "企微看课统计");
+
+    }
 
     @GetMapping("/qwWatchLogStatisticsList")
     public TableDataInfo qwWatchLogStatisticsList(QwWatchLogStatisticsListParam param)
@@ -196,8 +212,10 @@ public class FsQwCourseWatchLogController extends BaseController
     {
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         param.setCompanyId( loginUser.getCompany().getCompanyId());
-        List<FsCourseWatchLogListVO> list = fsCourseWatchLogService.selectFsCourseWatchLogListVO(param);
-        ExcelUtil<FsCourseWatchLogListVO> util = new ExcelUtil<FsCourseWatchLogListVO>(FsCourseWatchLogListVO.class);
+
+        List<QwWatchLogStatisticsListVO> list = qwWatchLogService.selectQwWatchLogStatisticsListVOExport(param);
+
+        ExcelUtil<QwWatchLogStatisticsListVO> util = new ExcelUtil<QwWatchLogStatisticsListVO>(QwWatchLogStatisticsListVO.class);
         return util.exportExcel(list, "短链课程看课记录数据");
     }
 

+ 3 - 1
fs-company/src/main/java/com/fs/framework/service/UserDetailsServiceImpl.java

@@ -9,6 +9,7 @@ import com.fs.company.domain.CompanyUser;
 import com.fs.company.service.ICompanyService;
 import com.fs.company.service.ICompanyUserService;
 import com.fs.framework.security.LoginUser;
+import com.fs.framework.security.SecurityUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -20,7 +21,7 @@ import org.springframework.stereotype.Service;
 /**
  * 用户验证处理
  *
- 
+
  */
 @Service
 public class UserDetailsServiceImpl implements UserDetailsService
@@ -45,6 +46,7 @@ public class UserDetailsServiceImpl implements UserDetailsService
 
 
         CompanyUser user = userService.selectUserByUserName(username);
+
         if (StringUtils.isNull(user))
         {
             log.info("登录用户:{} 不存在.", username);

+ 3 - 1
fs-service/src/main/java/com/fs/company/service/impl/CompanyServiceImpl.java

@@ -38,6 +38,7 @@ import com.fs.store.config.CompanyMenuConfig;
 import com.fs.system.domain.SysConfig;
 import com.fs.system.mapper.SysConfigMapper;
 import com.fs.system.service.ISysConfigService;
+import com.github.pagehelper.PageHelper;
 import com.google.gson.Gson;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.ObjectUtils;
@@ -840,7 +841,8 @@ public class CompanyServiceImpl implements ICompanyService
     @Override
     public List<DeptDataVO> getDeptData(Long companyId, Long currentCompanyUserId, Long currentDeptId) {
         List<DeptDataVO> result = new ArrayList<>();
-
+        // 线程中可能会残留的分页信息,这里清除,解决报错
+        PageHelper.clearPage();
         Long isAdmin = companyUserRoleMapper.companyUserIsAdmin(currentCompanyUserId);
         logger.info("当前用户 {} 是公司admin 返回公司所有部门树",currentDeptId);
         if(isAdmin!=null){

+ 9 - 0
fs-service/src/main/java/com/fs/course/domain/FsCourseFinishTemp.java

@@ -1,9 +1,12 @@
 package com.fs.course.domain;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fs.common.annotation.Excel;
 import com.fs.common.core.domain.BaseEntity;
 import lombok.Data;
 
+import java.util.List;
+
 /**
  * 完课模板对象 fs_course_finish_temp
  *
@@ -57,4 +60,10 @@ public class FsCourseFinishTemp extends BaseEntity
 
     @Excel(name = "全选销售标志")
     private Integer isAllCompanyUser;
+
+    /**
+     * 用于批量更新状态
+     */
+    @TableField(exist = false)
+    private List<Long> ids;
 }

+ 12 - 0
fs-service/src/main/java/com/fs/course/mapper/FsCourseFinishTempMapper.java

@@ -6,6 +6,7 @@ import com.fs.course.vo.FsCourseFinishTempListVO;
 import com.fs.course.vo.FsCourseFinishTempVO;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
 
 /**
  * 完课模板Mapper接口
@@ -111,4 +112,15 @@ public interface FsCourseFinishTempMapper
     public FsCourseFinishTempVO selectFsCourseFinishTempByIdVO(Long id);
 
     void deleteByParentIds(@Param("ids") Long[] ids);
+
+    @Update({"<script> " +
+            " update fs_course_finish_temp " +
+            " set status = #{data.status} ," +
+            " update_time = #{data.updateTime} " +
+            " where id in " +
+            " <foreach collection='data.ids' item='id' open='(' separator=',' close=')'>" +
+              " #{id} " +
+            " </foreach> " +
+            "</script>"})
+    int updateFsCourseFinishTempBatch(@Param("data") FsCourseFinishTemp fsCourseFinishTemp);
 }

+ 2 - 1
fs-service/src/main/java/com/fs/course/param/FsCourseWatchLogListParam.java

@@ -102,5 +102,6 @@ public class FsCourseWatchLogListParam implements Serializable {
      * 企微名称
      */
     private String qwUserName;
-
+    private Long deptId;
+    private String ids;
 }

+ 7 - 0
fs-service/src/main/java/com/fs/course/service/IFsCourseFinishTempService.java

@@ -77,4 +77,11 @@ public interface IFsCourseFinishTempService
      * 完课用户打备注
      */
     public void finishCourseExtContactIdByRemark(FsCourseWatchLog watchLog);
+
+    /**
+     * 批量更新完课模板状态
+     * @param fsCourseFinishTemp
+     * @return
+     */
+    int updateFsCourseFinishTempBatch(FsCourseFinishTemp fsCourseFinishTemp);
 }

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

@@ -5,6 +5,7 @@ import com.fs.course.domain.FsCourseWatchLog;
 import com.fs.course.param.*;
 import com.fs.course.vo.*;
 import com.fs.qw.param.QwSidebarStatsParam;
+import com.fs.qw.vo.QwWatchLogStatisticsListVO;
 
 import java.time.LocalDateTime;
 import java.util.List;

+ 9 - 0
fs-service/src/main/java/com/fs/course/service/impl/FsCourseFinishTempServiceImpl.java

@@ -497,4 +497,13 @@ public class FsCourseFinishTempServiceImpl implements IFsCourseFinishTempService
             log.error("保存重试记录失败", e);
         }
     }
+
+    /**
+     * 批量更新完课模板状态
+     * @param fsCourseFinishTemp
+     * @return
+     */
+    public int updateFsCourseFinishTempBatch(FsCourseFinishTemp fsCourseFinishTemp){
+        return fsCourseFinishTempMapper.updateFsCourseFinishTempBatch(fsCourseFinishTemp);
+    }
 }

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

@@ -42,6 +42,7 @@ import com.fs.qw.param.QwSidebarStatsParam;
 import com.fs.qw.param.SendSopParamDetails;
 import com.fs.qw.vo.QwSopCourseFinishTempSetting;
 import com.fs.qw.vo.QwSopTempSetting;
+import com.fs.qw.vo.QwWatchLogStatisticsListVO;
 import com.fs.sop.domain.QwSopLogs;
 import com.fs.sop.mapper.SopUserLogsMapper;
 import com.fs.store.service.cache.IFsUserCacheService;
@@ -1241,4 +1242,5 @@ public class FsCourseWatchLogServiceImpl extends ServiceImpl<FsCourseWatchLogMap
         return fsCourseWatchLogMapper.selectQwFsCourseWatchLogStatisticsListVO(param);
     }
 
+
 }

+ 9 - 0
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java

@@ -462,6 +462,10 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
             return R.error(504,"未授权");
         }
 
+        if (StringUtil.strIsNullOrEmpty(fsUser.getMpOpenId())){
+            return R.error(401,"授权后可继续!");
+        }
+
         if (fsUser.getStatus()==0){
             return R.error("会员被停用,无权限,请联系客服!");
         }
@@ -1110,6 +1114,11 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
             if (user.getStatus()==0){
                 return R.error("会员被停用,无权限,请联系客服!");
             }
+
+            if (StringUtil.strIsNullOrEmpty(user.getMpOpenId())){
+                return R.error(401,"授权后可继续!");
+            }
+
             FsCourseWatchLog watchLog = new FsCourseWatchLog();
 
             // 根据链接类型判断是否已发放奖励

+ 7 - 0
fs-service/src/main/java/com/fs/crm/param/CrmCustomerListQueryParam.java

@@ -1,6 +1,7 @@
 package com.fs.crm.param;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fs.common.annotation.Excel;
 import lombok.Data;
 
@@ -96,5 +97,11 @@ public class CrmCustomerListQueryParam extends BaseQueryParam
 
     private String[] receiveTimeList;
 
+    /** 开始时间 */
+    private String beginTime;
+
+    /** 结束时间 */
+    private String endTime;
+
 
 }

+ 3 - 1
fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java

@@ -1657,7 +1657,9 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
                 if (order.getTotalPrice().compareTo(minThreshold) >= 0) {
                     //根据用户id获取fs_user表对应的下单次数并更新
                     FsUser user = fsUserMapper.selectFsUserById(order.getUserId());
-                    user.setOrderCount(user.getOrderCount() + 1);
+                    //处理 orderCount 为 null 的情况:null 视为 0
+                    long currentCount = user.getOrderCount() != null ? user.getOrderCount() : 0;
+                    user.setOrderCount(currentCount + 1);
                     fsUserMapper.updateFsUser(user);
                 }
             } catch (Exception ex) {

+ 7 - 2
fs-service/src/main/java/com/fs/qw/mapper/QwGroupChatUserMapper.java

@@ -97,15 +97,20 @@ public interface QwGroupChatUserMapper
             "</script> ")
     public List<HashMap<String,String>> getDataWeekMonthCount(@Param("map") QwGroupChatUserDataType qwGroupChatUserDataType);
 
-    @Select("select " +
+    @Select(" <script> " +
+            " select " +
             "DATE_FORMAT(join_time,'%Y-%m') as toDay, " +
             "COUNT(join_time) AS dailyJoinCount , " +
             "COUNT(out_time) AS dailyOutCount " +
             "from qw_group_chat_user " +
             "where DATE_FORMAT(join_time,'%Y-%m')> DATE_FORMAT(date_sub(curdate(), interval 12 month),'%Y-%m') " +
+            " <if test='map.chatId != null'>" +
+            " and chat_id = #{map.chatId}" +
+            " </if>" +
             "group  by  DATE_FORMAT(join_time,'%Y-%m') " +
             "ORDER BY  " +
-            "  DATE_FORMAT(join_time,'%Y-%m') asc ")
+            "  DATE_FORMAT(join_time,'%Y-%m') asc " +
+            " </script> ")
     public List<HashMap<String,String>> getDataWeekMonthCountMonth(@Param("map") QwGroupChatUserDataType qwGroupChatUserDataType);
 
 

+ 42 - 2
fs-service/src/main/java/com/fs/qw/mapper/QwWatchLogMapper.java

@@ -1,6 +1,7 @@
 package com.fs.qw.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.course.param.FsCourseWatchLogListParam;
 import com.fs.qw.domain.QwExternalContact;
 import com.fs.qw.domain.QwWatchLog;
 import com.fs.qw.param.QwWatchLogStatisticsListParam;
@@ -80,7 +81,8 @@ public interface QwWatchLogMapper extends BaseMapper<QwWatchLog>{
             "    COUNT(CASE WHEN qec.`level` = 5 THEN 1 END) AS E,\n" +
             "    COUNT(CASE WHEN qec.fs_user_id IS NOT NULL THEN 1 END) AS sign,\n" +
             "    COUNT(CASE WHEN qec.`status` =3 THEN 1 END) AS los,\n" +
-            "    COUNT(CASE WHEN qec.`status` IN (4, 5,6) THEN 1 END) AS del\n" +
+            "    COUNT(CASE WHEN qec.`status` IN (4, 5,6) THEN 1 END) AS del,\n" +
+            "    COUNT(CASE WHEN qec.fs_user_id IS NOT NULL and qec.fs_user_id != 0 THEN 1 END) AS reg_num\n"+
             "FROM\n" +
             "    qw_external_contact qec\n" +
             "JOIN\n" +
@@ -103,6 +105,44 @@ public interface QwWatchLogMapper extends BaseMapper<QwWatchLog>{
             "    DATE(qec.create_time) "+
             "</script>"})
     List<QwWatchLogStatisticsListVO> selectQwExtCountByDayAnd(QwWatchLogStatisticsListParam param);
+
+    @Select({"<script> " +
+            "SELECT\n" +
+            "    qec.qw_user_id id,\n" +
+            "    qu.qw_user_name AS qw_user_name, \n" +
+            "    DATE(qec.create_time) AS create_time, \n" +
+            "    COUNT(1) AS line,\n" +
+            "    COUNT(CASE WHEN qec.is_interact = 1 THEN 1 END) AS interact,\n" +
+            "    COUNT(CASE WHEN qec.`level` = 1 THEN 1 END) AS A,\n" +
+            "    COUNT(CASE WHEN qec.`level` = 2 THEN 1 END) AS B,\n" +
+            "    COUNT(CASE WHEN qec.`level` = 3 THEN 1 END) AS C,\n" +
+            "    COUNT(CASE WHEN qec.`level` = 4 THEN 1 END) AS D,\n" +
+            "    COUNT(CASE WHEN qec.`level` = 5 THEN 1 END) AS E,\n" +
+            "    COUNT(CASE WHEN qec.fs_user_id IS NOT NULL THEN 1 END) AS sign,\n" +
+            "    COUNT(CASE WHEN qec.`status` =3 THEN 1 END) AS los,\n" +
+            "    COUNT(CASE WHEN qec.`status` IN (4, 5,6) THEN 1 END) AS del\n" +
+            "FROM\n" +
+            "    qw_external_contact qec\n" +
+            "JOIN\n" +
+            "    qw_user qu ON qec.qw_user_id = qu.id \n" +
+            "left join company_user cu on qec.company_user_id = cu.user_id "+
+            "WHERE\n" +
+            "    DATE(qec.create_time) &gt;= DATE(#{sTime}) and  DATE(qec.create_time) &lt;= DATE(#{eTime}) and qec.company_id =#{companyId} " +
+            "<if test ='nickName !=null and nickName!=\"\"'>\n" +
+            "   and qu.qw_user_name like concat( #{nickName}, '%')\n" +
+            "</if>" +
+            "<if test ='deptId !=null and deptId!=\"\"'>\n" +
+            "   and cu.dept_id = #{deptId}\n" +
+            "</if>" +
+            "<if test ='ids !=null and ids!=\"\"'>\n" +
+            "   and qec.qw_user_id in (${ids})\n" +
+            "</if>" +
+            "GROUP BY\n" +
+            "    qec.qw_user_id, DATE(qec.create_time) \n" +
+            "ORDER BY\n" +
+            "    DATE(qec.create_time) "+
+            "</script>"})
+    List<QwWatchLogStatisticsListVO> selectQwExtCountByDayAnd(FsCourseWatchLogListParam param);
     @Select("select \n" +
             "COUNT(CASE WHEN day = 0 and status in (1,2) THEN 1 END) AS firstOnline,\n" +
             "COUNT(CASE WHEN day = 0 and status=2 THEN 1 END) AS firstOver,\n" +
@@ -183,7 +223,7 @@ public interface QwWatchLogMapper extends BaseMapper<QwWatchLog>{
             "    qu.qw_user_name AS qw_user_name, \n" +
             "    DATE(qec.create_time) AS create_time, \n" +
             "    COUNT(1) AS line," +
-            "    COUNT(CASE WHEN fs_user_id IS NOT NULL THEN 1 ELSE NULL END) AS reg_num\n" +
+            "    COUNT(CASE WHEN qec.fs_user_id IS NOT NULL and qec.fs_user_id != 0 THEN 1 END) AS reg_num\n" +
             "FROM\n" +
             "    qw_external_contact qec\n" +
             "JOIN\n" +

+ 3 - 0
fs-service/src/main/java/com/fs/qw/service/IQwWatchLogService.java

@@ -2,6 +2,7 @@ package com.fs.qw.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fs.common.core.page.TableDataInfo;
+import com.fs.course.param.FsCourseWatchLogListParam;
 import com.fs.qw.domain.QwWatchLog;
 import com.fs.qw.param.QwWatchLogStatisticsListParam;
 import com.fs.qw.vo.QwWatchLogAllStatisticsListVO;
@@ -70,4 +71,6 @@ public interface IQwWatchLogService extends IService<QwWatchLog>{
     TableDataInfo selectQwWatchLogAllStatisticsListVONew(QwWatchLogStatisticsListParam param);
 
     TableDataInfo selectQwWatchLogStatisticsListVONew(QwWatchLogStatisticsListParam param);
+
+    List<QwWatchLogStatisticsListVO> selectQwWatchLogStatisticsListVOExport(FsCourseWatchLogListParam param);
 }

+ 25 - 0
fs-service/src/main/java/com/fs/qw/service/impl/QwWatchLogServiceImpl.java

@@ -16,6 +16,7 @@ import com.fs.company.mapper.CompanyDeptMapper;
 import com.fs.company.mapper.CompanyUserMapper;
 import com.fs.course.domain.FsUserCourse;
 import com.fs.course.domain.FsUserCourseVideo;
+import com.fs.course.param.FsCourseWatchLogListParam;
 import com.fs.course.service.cache.IFsUserCourseVideoCacheService;
 import com.fs.his.domain.FsUser;
 import com.fs.qw.domain.QwWatchLog;
@@ -144,6 +145,29 @@ public class QwWatchLogServiceImpl extends ServiceImpl<QwWatchLogMapper, QwWatch
         return baseMapper.deleteQwWatchLogById(id);
     }
 
+
+    @Override
+    public List<QwWatchLogStatisticsListVO> selectQwWatchLogStatisticsListVOExport(FsCourseWatchLogListParam param) {
+        CompanyDept companyDept = companyDeptMapper.selectCompanyDeptById(param.getDeptId());
+        if (ObjectUtils.isNotEmpty(companyDept)&&companyDept.getParentId()==0L){
+            param.setDeptId(null);
+        }
+        if (param.getCompanyUserId()!=null){
+            param.setIds(companyUserMapper.selectQwUserIdsByCompany(param.getCompanyUserId()));
+        }
+        List<QwWatchLogStatisticsListVO> vos = qwWatchLogMapper.selectQwExtCountByDayAnd(param);
+        for (QwWatchLogStatisticsListVO vo : vos) {
+            Long id = vo.getId();
+            Date createTime = vo.getCreateTime();
+            QwWatchLogStatisticsListVO stat = qwWatchLogMapper.selectQwWatchLogByQwUserId(id, createTime);
+            vo.setD1Online(stat.getD1Online());
+            vo.setD1Over(stat.getD1Over());
+            vo.setFirstOnline(stat.getFirstOnline());
+            vo.setFirstOver(stat.getFirstOver());
+        }
+        return vos;
+    }
+
     @Override
     public TableDataInfo selectQwWatchLogStatisticsListVO(QwWatchLogStatisticsListParam param) {
         CompanyDept companyDept = companyDeptMapper.selectCompanyDeptById(param.getDeptId());
@@ -205,6 +229,7 @@ public class QwWatchLogServiceImpl extends ServiceImpl<QwWatchLogMapper, QwWatch
             stat.setCreateTime(vo.getCreateTime());
             stat.setQwUserName(vo.getQwUserName());
             stat.setLine(vo.getLine());
+            stat.setRegNum(vo.getRegNum());
             list.add(stat);
         }
 

+ 21 - 1
fs-service/src/main/java/com/fs/qw/vo/QwWatchLogStatisticsListVO.java

@@ -1,6 +1,7 @@
 package com.fs.qw.vo;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
 import lombok.Data;
 
 import java.util.Date;
@@ -9,10 +10,12 @@ import java.util.Date;
 public class QwWatchLogStatisticsListVO {
     private Long id;
     private String qwUserName;
+    @Excel(name = "企微员工名称")
     private String companyUserName;
     private Long companyUserId;
     private Long companyId;
     @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "进线时间",dateFormat = "yyyy-MM-dd")
     private Date createTime;
     /**
      * 项目
@@ -25,26 +28,43 @@ public class QwWatchLogStatisticsListVO {
      */
     private Long courseId;
     private String courseName;
+    /**
+     * 注册数
+     */
+    private Long regNum;
 
     /**
      * 小节
      */
     private Long videoId;
     private String videoName;
-
+    @Excel(name = "进线数")
     private Long line;//进线数
+    @Excel(name = "先导课上线")
     private Long firstOnline;//先导课上线
+    @Excel(name = "先导课完课")
     private Long firstOver;//先导课完课
+    @Excel(name = "首日上线")
     private Long d1Online;//首日上线
+    @Excel(name = "首日完课")
     private Long d1Over;//首日完课
+    @Excel(name = "综合报名数")
     private Long sign;//综合报名数
+    @Excel(name = "互动数")
     private Long interact;//互动数
+    @Excel(name = "A级用户")
     private Long a;
+    @Excel(name = "B级用户")
     private Long b;
+    @Excel(name = "C级用户")
     private Long c;
+    @Excel(name = "D级用户")
     private Long d;
+    @Excel(name = "E级用户")
     private Long e;
+    @Excel(name = "拉黑数")
     private Long black;
     private Long los;//流失数
+    @Excel(name = "删除数")
     private Long del;//删除数
 }

+ 22 - 22
fs-service/src/main/java/com/fs/tulin/service/impl/TulinInfoSyncLogServiceImpl.java

@@ -74,28 +74,28 @@ public class TulinInfoSyncLogServiceImpl implements ITulinInfoSyncLogService {
                 }
             }
         }
-//        if(activeProfile.equals("dev")) {
-//            log.info("线下开始执行数据同步");
-//            for (QwExUserInfo qwExUserInfo : qwExUserInfos) {
-//                StudentInfo studentInfo = new StudentInfo();
-//                BeanUtils.copyProperties(qwExUserInfo, studentInfo);
-//                studentInfo.setAppid("wx6688e6b9b6fb8700");
-//                studentInfo.setColumn_name(ColumnNameEnum.GYBNX.getName());
-//                studentInfo.setPharmacy_id(PharmacyEnum.YJKYSY.getPharmacyId());
-//                studentInfo.setService_phone("15141712344");
-//                List<PeriodInfo> periodInfos = tulinInfoSyncLogMapper.selectPeriodInfo(qwExUserInfo.getFs_user_id());
-//                if(CollectionUtils.isNotEmpty(periodInfos)){
-//                    studentInfo.setPeriod_name(periodInfos.get(0).getCourseName());
-//                }
-//                try {
-//                    TulinInfoSyncLog tulinInfoSyncLog = SyncStudentInfoService.send(PROD_URL,PROD_CORPID, studentInfo);
-//                    tulinInfoSyncLog.setFsUserId(qwExUserInfo.getFs_user_id());
-//                    insert(tulinInfoSyncLog);
-//                } catch (JsonProcessingException e) {
-//                    throw new RuntimeException(e);
-//                }
-//            }
-//        }
+        if(activeProfile.equals("dev")) {
+            log.info("线下开始执行数据同步");
+            for (QwExUserInfo qwExUserInfo : qwExUserInfos) {
+                StudentInfo studentInfo = new StudentInfo();
+                BeanUtils.copyProperties(qwExUserInfo, studentInfo);
+                studentInfo.setAppid("wx6688e6b9b6fb8700");
+                studentInfo.setColumn_name(ColumnNameEnum.GYBNX.getName());
+                studentInfo.setPharmacy_id(PharmacyEnum.YJKYSY.getPharmacyId());
+                studentInfo.setService_phone("15141712344");
+                List<PeriodInfo> periodInfos = tulinInfoSyncLogMapper.selectPeriodInfo(qwExUserInfo.getFs_user_id());
+                if(CollectionUtils.isNotEmpty(periodInfos)){
+                    studentInfo.setPeriod_name(periodInfos.get(0).getCourseName());
+                }
+                try {
+                    TulinInfoSyncLog tulinInfoSyncLog = SyncStudentInfoService.send(PROD_URL,PROD_CORPID, studentInfo);
+                    tulinInfoSyncLog.setFsUserId(qwExUserInfo.getFs_user_id());
+                    insert(tulinInfoSyncLog);
+                } catch (JsonProcessingException e) {
+                    throw new RuntimeException(e);
+                }
+            }
+        }
     }
 
 

+ 7 - 1
fs-service/src/main/resources/application-config-druid-czt.yml

@@ -57,6 +57,12 @@ watch:
 fs :
   commonApi: http://127.0.0.1:7771
   h5CommonApi: http://127.0.0.1:7771
+  jwt:
+    # 加密秘钥
+    secret: e10adc3949ba59abbe56e057f20f883e
+    # token有效时长,7天,单位秒
+    expire: 31536000
+    header: AppToken
 nuonuo:
   key: 10924508
   secret: A2EB20764D304D16
@@ -95,4 +101,4 @@ wx_miniapp_temp:
 enableRedPackAccount: 0
 video:
   videoUploadDir:
-  frameOutputDir:
+  frameOutputDir:

+ 3 - 3
fs-service/src/main/resources/application-dev.yml

@@ -43,9 +43,9 @@ spring:
             druid:
                 # 主库数据源
                 master:
-                    url: jdbc:mysql://139.186.77.83:3306/ylrz_his_scrm?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-                    username: Rtroot
-                    password: Rtroot
+                    url: jdbc:mysql://127.0.0.1:3306/fs_his?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                    username: root
+                    password: 1101165230
                 # 初始连接数
                 initialSize: 5
                 # 最小连接池数量

+ 2 - 2
fs-service/src/main/resources/application-druid-jnmy-test.yml

@@ -151,10 +151,10 @@ rocketmq:
 openIM:
     secret: openIM123
     userID: imAdmin
-    url: https://web.im.fbylive.com/api
+    url: https://web.jnmyim.ylrzfs.com/api
 #是否使用新im
 im:
-    type: NONE
+    type: OPENIM
 isNewWxMerchant: true
 
 

+ 2 - 2
fs-service/src/main/resources/application-druid-jnmy.yml

@@ -154,10 +154,10 @@ rocketmq:
 openIM:
     secret: openIM123
     userID: imAdmin
-    url: https://web.im.fbylive.com/api
+    url: https://web.jnmyim.ylrzfs.com/api
 #是否使用新im
 im:
-    type: NONE
+    type: OPENIM
 #是否为新商户,新商户不走mpOpenId
 isNewWxMerchant: true
 

+ 3 - 3
fs-service/src/main/resources/mapper/course/FsUserCoursePeriodMapper.xml

@@ -72,10 +72,10 @@
             <if test="trainingCampId != null"> and fs_user_course_period.training_camp_id = #{trainingCampId}</if>
             <if test="periodName != null  and periodName != ''"> and period_name like concat('%', #{periodName}, '%')</if>
             <if test="companyIdList != null and companyIdList.size() > 0 ">
-                and fs_user_course_period.company_id in
+                and
                 <foreach item="companyId" index="index" collection="companyIdList"
-                         open="(" separator="," close=")">
-                    #{companyId}
+                         open="(" separator="or" close=")">
+                    FIND_IN_SET(#{companyId}, fs_user_course_period.company_id)
                 </foreach>
             </if>
             <if test="periodStartingTime != null "> and period_starting_time &gt;= #{periodStartingTime}</if>

+ 1 - 0
fs-service/src/main/resources/mapper/his/FsExportTaskMapper.xml

@@ -29,6 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
             <if test="startTime != null "> and start_time = #{startTime}</if>
             <if test="finishTime != null "> and finish_time = #{finishTime}</if>
+            <if test="status != null "> and status = #{status}</if>
             <if test="fileUrl != null  and fileUrl != ''"> and file_url = #{fileUrl}</if>
         </where>
         order by task_id desc

+ 3 - 0
fs-service/src/main/resources/mapper/his/FsUserMapper.xml

@@ -554,6 +554,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isAddQw != null">is_add_qw,</if>
             <if test="courseMaOpenId != null">course_ma_open_id,</if>
             <if test="qwExtId != null">qw_ext_id,</if>
+            <if test="orderCount != null">order_count,</if>
             <if test="companyId != null">company_id,</if>
             <if test="companyUserId != null">company_user_id,</if>
          </trim>
@@ -596,6 +597,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isAddQw != null">#{isAddQw},</if>
             <if test="courseMaOpenId != null">#{courseMaOpenId},</if>
             <if test="qwExtId != null">#{qwExtId},</if>
+            <if test="orderCount != null">#{orderCount},</if>
             <if test="companyId != null">#{companyId},</if>
             <if test="companyUserId != null">#{companyUserId},</if>
          </trim>
@@ -644,6 +646,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="parentId != null">parent_id = #{parentId},</if>
             <if test="qwExtId != null">qw_ext_id = #{qwExtId},</if>
             <if test="companyId != null">company_id = #{companyId},</if>
+            <if test="orderCount != null">order_count = #{orderCount},</if>
             <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
         </trim>
         where user_id = #{userId}

+ 10 - 10
fs-service/src/main/resources/mapper/hisStore/SysOperLogScrmMapper.xml

@@ -56,37 +56,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			left join fs_store_product_scrm fp on fp.product_id = sol.main_id and sol.main_type = '商品'
 		<where>
 			<if test="mainType != null and mainType != ''">
-				AND main_type = #{mainType}
+				AND sol.main_type = #{mainType}
 			</if>
 			<if test="title != null and title != ''">
-				AND title like concat('%', #{title}, '%')
+				AND sol.title like concat('%', #{title}, '%')
 			</if>
 			<if test="businessType != null and businessType != ''">
-				AND business_type = #{businessType}
+				AND sol.business_type = #{businessType}
 			</if>
 			<if test="businessTypes != null and businessTypes.length > 0">
-			    AND business_type in
+			    AND sol.business_type in
 			    <foreach collection="businessTypes" item="businessType" open="(" separator="," close=")">
 		 			#{businessType}
 		        </foreach>
 			</if>
 			<if test="status != null">
-				AND status = #{status}
+				AND sol.status = #{status}
 			</if>
 			<if test="operName != null and operName != ''">
-				AND oper_name like concat('%', #{operName}, '%')
+				AND sol.oper_name like concat('%', #{operName}, '%')
 			</if>
 			<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
-				and date_format(oper_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
+				and date_format(sol.oper_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
 			</if>
 			<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
-				and date_format(oper_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
+				and date_format(sol.oper_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
 			</if>
 			<if test="mainId != null">
-				and main_id = #{mainId}
+				and sol.main_id = #{mainId}
 			</if>
 		</where>
-		order by oper_id desc
+		order by sol.oper_id desc
 	</select>
 
 

+ 2 - 2
fs-service/src/main/resources/mapper/qw/QwFriendWelcomeMapper.xml

@@ -64,13 +64,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 and company_id = #{companyId}
             </if>
             <if test="createTime != null ">
-                and create_time = #{createTime}
+                and DATE(create_time) = #{createTime}
             </if>
             <if test="corpId != null ">
                 and corp_id = #{corpId}
             </if>
             <if test="updateTime != null ">
-                and update_time = #{updateTime}
+                and DATE(update_time) = #{updateTime}
             </if>
             ${params.dataScope}
         </where>

+ 1 - 0
fs-service/src/main/resources/mapper/qw/QwUserMapper.xml

@@ -43,6 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectQwUserList" parameterType="QwUser" resultMap="QwUserResult">
         <include refid="selectQwUserVo"/>
         <where>
+            1=1 and is_del = 0 and company_user_id is not null
             <if test="qwUserId != null  and qwUserId != ''"> and qw_user_id = #{qwUserId}</if>
             <if test="qwUserName != null  and qwUserName != ''"> and qw_user_name like concat('%', #{qwUserName}, '%')</if>
             <if test="department != null  and department != ''"> and department = #{department}</if>