Prechádzať zdrojové kódy

看客记录报错字段替换

yuhongqi 4 dní pred
rodič
commit
e607fe2301

+ 2 - 0
fs-service/src/main/java/com/fs/qw/param/QwWatchLogStatisticsListParam.java

@@ -5,6 +5,7 @@ import com.fs.common.utils.DateUtils;
 import lombok.Data;
 
 import java.util.Date;
+import java.util.List;
 
 @Data
 public class QwWatchLogStatisticsListParam {
@@ -30,6 +31,7 @@ public class QwWatchLogStatisticsListParam {
     private Long companyUserId;
     private Long id;
     private String ids;
+    private List<String> idsList;
     private Long project;
     private Long courseId;
     private Long videoId;

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

@@ -175,8 +175,10 @@ public class QwWatchLogServiceImpl extends ServiceImpl<QwWatchLogMapper, QwWatch
             vo.setFirstOnline(stat.getFirstOnline());
             vo.setFirstOver(stat.getFirstOver());
         }
-
-        param.setIds(param.getIds().replace("(","").replace(")",""));
+        if (StringUtils.isNotBlank(param.getIds())) {
+            String replace = param.getIds().replace("(", "").replace(")", "");
+            param.setIdsList(Arrays.asList(replace.split(",")));
+        }
         Long total = qwWatchLogMapper.selectQwExtCountByDayAndCount(param);
         rspData.setRows(vos);
         rspData.setTotal(total);

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

@@ -218,9 +218,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test='nickName != null and nickName != ""'>
             AND qu.qw_user_name LIKE CONCAT(#{nickName}, '%')
         </if>
-        <if test='ids != null and ids != ""'>
+        <if test='idsList != null and !idsList.isEmpty()'>
             AND qec.qw_user_id IN
-            <foreach item="item" index="index" collection="ids.split(',')" open="(" separator="," close=")">
+            <foreach item="item" index="index" collection="idsList" open="(" separator="," close=")">
                 #{item}
             </foreach>
         </if>