Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

yfh 19 часов назад
Родитель
Сommit
c453371668

+ 21 - 0
fs-service/src/main/java/com/fs/config/im/IMSystemConfig.java

@@ -0,0 +1,21 @@
+package com.fs.config.im;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @description: IM配置
+ * @author: Xgb
+ * @createDate: 2026/1/30
+ * @version: 1.0
+ */
+@Data
+public class IMSystemConfig implements Serializable {
+
+    // 离线推送 小米系统申请channel_id
+    private String xm_channel_id;
+
+    //离线推送 华为系统申请channel_id
+    private String hw_channel_id;
+}

+ 1 - 2
fs-service/src/main/java/com/fs/course/mapper/FsCourseRedPacketLogMapper.java

@@ -203,6 +203,5 @@ public interface FsCourseRedPacketLogMapper
 
     List<FsCourseRedPacketLog> selectFsCourseRedPacketLogListBySending(@Param("maps") Map<String, Object> map);
 
-    @MapKey("qwUserId")
-    Map<Long, FsCourseWatchLogStatisticsListVO> selectFsCourseRedPacketLogByQwUserIdList(@Param("param") FsCourseWatchLogStatisticsListParam param);
+    List<FsCourseWatchLogStatisticsListVO> selectFsCourseRedPacketLogByQwUserIdList(@Param("param") FsCourseWatchLogStatisticsListParam param);
 }

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

@@ -225,7 +225,7 @@ public interface FsCourseWatchLogMapper extends BaseMapper<FsCourseWatchLog> {
             "</if> " +
             "from (" +
             "SELECT \n" +
-            "o.video_id,o.company_id,o.qw_user_id,DATE(o.create_time) create_time," +
+            "o.video_id,o.course_id,o.company_id,o.qw_user_id,DATE(o.create_time) create_time," +
             "<if test= 'sendType != 1 '> " +
             " qu.qw_user_name qw_user_name," +
             "</if>\n" +

+ 14 - 3
fs-service/src/main/java/com/fs/course/service/impl/FsCourseWatchLogServiceImpl.java

@@ -768,11 +768,22 @@ public class FsCourseWatchLogServiceImpl extends ServiceImpl<FsCourseWatchLogMap
     public List<FsCourseWatchLogStatisticsListVO> selectFsCourseWatchLogStatisticsListVO(FsCourseWatchLogStatisticsListParam param) {
         if (param.getUserIds() != null && !param.getUserIds().isEmpty())param.setUserIds(param.getUserIds());
         List<FsCourseWatchLogStatisticsListVO> statisticsListVOS = fsCourseWatchLogMapper.selectFsCourseWatchLogStatisticsListVO(param);
-        Map<Long,FsCourseWatchLogStatisticsListVO> redAmountMap = fsCourseRedPacketLogMapper.selectFsCourseRedPacketLogByQwUserIdList(param);
+        Map<String, FsCourseWatchLogStatisticsListVO> redAmountMap = new HashMap<>();
+        List<FsCourseWatchLogStatisticsListVO> redPacketLogs = fsCourseRedPacketLogMapper.selectFsCourseRedPacketLogByQwUserIdList(param);
+        for (FsCourseWatchLogStatisticsListVO log : redPacketLogs) {
+            // 空值校验
+            if (log.getQwUserId() != null && log.getVideoId() != null) {
+                String key = log.getQwUserId() + "_" + log.getVideoId() + "_" + log.getCreateTime();
+                redAmountMap.put(key, log);
+            }
+        }
         statisticsListVOS.forEach(vo ->{
-            FsCourseWatchLogStatisticsListVO statisticsListVO = redAmountMap.get(vo.getQwUserId());
+            FsCourseWatchLogStatisticsListVO statisticsListVO = redAmountMap.get(vo.getQwUserId() + "_" + vo.getVideoId() + "_" + vo.getCreateTime());
             if(statisticsListVO != null){
-                if(statisticsListVO.getQwUserId().equals(vo.getQwUserId()) && statisticsListVO.getCreateTime().equals(vo.getCreateTime())){
+                if(statisticsListVO.getCourseId().equals(vo.getCourseId()) &&
+                        statisticsListVO.getVideoId().equals(vo.getVideoId()) &&
+                        statisticsListVO.getQwUserId().equals(vo.getQwUserId()) &&
+                        statisticsListVO.getCreateTime().equals(vo.getCreateTime())){
                     vo.setRedAmount(statisticsListVO.getRedAmount());
                 }
             }

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

@@ -1050,11 +1050,11 @@ public class FsUserCourseVideoServiceImpl extends ServiceImpl<FsUserCourseVideoM
         log.setQwUserId(Long.valueOf(param.getQwUserId()));
         log.setCreateTime(new Date());
         log.setLogType(3);
-       if(param.getTypeFlag()==1){
-           log.setWatchType(1);
-       }else {
-           log.setWatchType(2);
-       }
+        if (param != null && param.getTypeFlag() != null && param.getTypeFlag() == 1) {
+            log.setWatchType(1);
+        } else {
+            log.setWatchType(2);
+        }
         logger.info("【群聊生成看课记录】:{}", param);
         courseWatchLogMapper.insertFsCourseWatchLog(log);
     }

+ 23 - 2
fs-service/src/main/java/com/fs/gtPush/service/impl/uniPush2ServiceImpl.java

@@ -11,6 +11,8 @@ import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.StringUtils;
 import com.fs.company.domain.CompanyUser;
 import com.fs.company.mapper.CompanyUserMapper;
+import com.fs.config.im.IMSystemConfig;
+import com.fs.course.config.CourseConfig;
 import com.fs.gtPush.domain.PushReqBean;
 import com.fs.gtPush.domain.PushResult;
 import com.fs.gtPush.domain.UniPushLog;
@@ -53,6 +55,9 @@ public class uniPush2ServiceImpl implements uniPush2Service {
     @Autowired
     private CompanyUserMapper companyUserMapper;
 
+    @Autowired
+    private IMConfig imConfig;
+
     @Override
     public PushResult pushMessage(PushReqBean push) {
         SysConfig config = iSysConfigService.selectConfigByConfigKey("his.config");
@@ -92,6 +97,10 @@ public class uniPush2ServiceImpl implements uniPush2Service {
             if (param.getPayload() == null) {
                 param.setPayload(new HashMap<>());
             }
+
+            if(imJsonString.length()>100){
+                imJsonString="";
+            }
             param.getPayload().put("url", purl);
             if (StringUtils.isNotBlank(imJsonString)) {
                 param.getPayload().put("extra", imJsonString);
@@ -110,9 +119,13 @@ public class uniPush2ServiceImpl implements uniPush2Service {
             Map<String, Object> options = new HashMap<>();
             Map<String, Object> android = new HashMap<>();
 
+
+            String json = iSysConfigService.selectConfigByKey("im.config");
+            IMSystemConfig config = JSONUtil.toBean(json, IMSystemConfig.class);
             // 小米
             Map<String, Object> xm = new HashMap<>();
-            xm.put("/extra.channel_id", "133892");
+            xm.put("/extra.channel_id", config.getXm_channel_id());
+
             xm.put("/extra.notify_foreground", true);
             android.put("XM", xm);
 
@@ -246,6 +259,11 @@ public class uniPush2ServiceImpl implements uniPush2Service {
             return null;
         }
 
+        if(imJsonString.length()>100 ){
+            // 报文总共只能传 4096 长度
+            imJsonString="";
+        }
+
         // payload
         Map<String, Object> payload = new HashMap<>();
         if (StringUtils.isNotBlank(purl)) {
@@ -266,9 +284,12 @@ public class uniPush2ServiceImpl implements uniPush2Service {
         // options.android
         Map<String, Object> android = new HashMap<>();
 
+        String json = iSysConfigService.selectConfigByKey("im.config");
+        IMSystemConfig config = JSONUtil.toBean(json, IMSystemConfig.class);
+
         // 小米
         Map<String, Object> xm = new HashMap<>();
-        xm.put("/extra.channel_id", "133892");
+        xm.put("/extra.channel_id", config.getXm_channel_id());
         android.put("XM", xm);
 
         // OPPO

+ 1 - 1
fs-service/src/main/resources/application-config-zlwh.yml

@@ -127,7 +127,7 @@ watch:
   password3: v9xsKuqn_$d2y
 
 fs:
-  commonApi: http://172.21.76.167:8010
+  commonApi: http://127.0.0.1:7771
   jwt:
     # 加密秘钥
     secret: e10tdr3949fa43abbe56e057f2fd883e

+ 4 - 4
fs-service/src/main/resources/application-druid-mengniu.yml

@@ -43,12 +43,12 @@ spring:
                 master:
                     url: jdbc:mysql://192.168.0.251:3306/fs_his?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                     username: root
-                    password: Ylrztek250218!3@.
+                    password: Ylrztekmn250218!3@.
                 # 从库数据源
                 slave:
                     url: jdbc:mysql://192.168.0.251:3306/fs_his?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                     username: root
-                    password: Ylrztek250218!3@.
+                    password: Ylrztekmn250218!3@.
                 # 初始连接数
                 initialSize: 5
                 # 最小连接池数量
@@ -96,11 +96,11 @@ spring:
                 master:
                     url: jdbc:mysql://192.168.0.251:3306/sop?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                     username: root
-                    password: Ylrztek250218!3@.
+                    password: Ylrztekmn250218!3@.
                 read:
                     url: jdbc:mysql://192.168.0.251:3306/sop?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                     username: root
-                    password: Ylrztek250218!3@.
+                    password: Ylrztekmn250218!3@.
                 # 初始连接数
                 initialSize: 5
                 # 最小连接池数量

+ 1 - 1
fs-service/src/main/resources/application-druid-zlwh.yml

@@ -153,7 +153,7 @@ openIM:
 im:
     type: NONE
 #是否为新商户,新商户不走mpOpenId
-isNewWxMerchant: false
+isNewWxMerchant: true
 qw:
     enableAutoTag: 1
 tag:

+ 17 - 5
fs-service/src/main/resources/mapper/course/FsCourseRedPacketLogMapper.xml

@@ -276,17 +276,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </choose>
 
     </select>
-    <select id="selectFsCourseRedPacketLogByQwUserIdList" resultType="com.fs.course.vo.FsCourseWatchLogStatisticsListVO">
-        select qw_user_id qwUserId, sum(amount) as redAmount,date_format(create_time,'%Y-%m-%d') createTime from fs_course_red_packet_log
+    <select id="selectFsCourseRedPacketLogByQwUserIdList"
+            resultType="com.fs.course.vo.FsCourseWatchLogStatisticsListVO">
+        select f1.qw_user_id qwUserId,f1.video_id videoId,f1.course_id courseId,f1.user_id userId,sum(f1.amount) as redAmount,
+         date_format(f1.create_time,'%Y-%m-%d') createTime from fs_course_red_packet_log f1
+        left join fs_course_watch_log f2 on f1.user_id = f2.user_id and f1.video_id = f2.video_id
         <where>
             <if test="param.companyId != null">
-                and company_id = #{param.companyId}
+                and f1.company_id = #{param.companyId}
             </if>
             <if test=" param.sTime != null and  param.eTime != null">
-                AND date_format(create_time,'%Y-%m-%d') &gt;=  date_format(#{param.sTime},'%Y-%m-%d') and date_format(create_time,'%Y-%m-%d') &lt;= date_format(#{param.eTime},'%Y-%m-%d')
+                AND date_format(f1.create_time,'%Y-%m-%d') &gt;=  date_format(#{param.sTime},'%Y-%m-%d') and date_format(f1.create_time,'%Y-%m-%d') &lt;= date_format(#{param.eTime},'%Y-%m-%d')
+            </if>
+            <if test ='param.courseId !=null'>
+                and f1.course_id = #{param.courseId}
+            </if>
+            <if test ='param.qwSopId !=null and param.qwSopId!=""'>
+                and f2.sop_id = #{param.qwSopId}
+            </if>
+            <if test ='param.videoId !=null'>
+                and f1.video_id = #{param.videoId}
             </if>
         </where>
-        group by qw_user_id,date_format(create_time,'%Y-%m-%d')
+        group by f1.qw_user_id,f1.video_id,f1.course_id,date_format(f1.create_time,'%Y-%m-%d')
     </select>
 
 

+ 7 - 3
fs-service/src/main/resources/mapper/hisStore/FsStoreOrderScrmMapper.xml

@@ -1848,7 +1848,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 AND date_format(o.delivery_import_time,'%y%m%d') &lt;= date_format(#{maps.deliveryImportTimeList[1]},'%y%m%d')
             </if>
             <if test="maps.deptId != null     ">
-                AND (o.dept_id = #{maps.deptId} OR o.dept_id IN ( SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{maps.deptId}, ancestors) ))
+                AND (cu.dept_id = #{maps.deptId} OR cu.dept_id IN (
+                SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{maps.deptId}, ancestors)
+                ))
             </if>
             <if test="maps.erpPhoneNumber != null and maps.erpPhoneNumber != ''">
                 and o.erp_phone like concat(#{maps.erpPhoneNumber},'%')
@@ -1901,7 +1903,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="(maps.nickname != null and  maps.nickname !='') or (maps.phone != null and  maps.phone !='')">
             left join fs_user u on o.user_id=u.user_id
         </if>
-        <if test="maps.companyUserNickName != null and  maps.companyUserNickName !=  ''">
+        <if test="(maps.companyUserNickName != null and  maps.companyUserNickName !=  '') or (maps.deptId != null)">
             left join company_user cu on cu.user_id=o.company_user_id
         </if>
         <if test="maps.erpAccount != null and maps.erpAccount != ''">
@@ -2035,7 +2037,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 AND date_format(o.delivery_import_time,'%y%m%d') &lt;= date_format(#{maps.deliveryImportTimeList[1]},'%y%m%d')
             </if>
             <if test="maps.deptId != null     ">
-                AND (o.dept_id = #{maps.deptId} OR o.dept_id IN ( SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{maps.deptId}, ancestors) ))
+                AND (cu.dept_id = #{maps.deptId} OR cu.dept_id IN (
+                SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{maps.deptId}, ancestors)
+                ))
             </if>
             <if test="maps.erpPhoneNumber != null and maps.erpPhoneNumber != ''">
                 and so.erp_phone like concat(#{maps.erpPhoneNumber},'%')