浏览代码

roos页面统计

huangzhiguo 2 年之前
父节点
当前提交
50ab08d9c7

+ 4 - 0
src/main/java/com/caimei365/tools/model/po/CmBehaviorRecordPo.java

@@ -34,6 +34,10 @@ public class CmBehaviorRecordPo {
      * 页面标签
      */
     private String pageLabel;
+    /**
+     * 用户行为类型1:用户行为记录、2:ROOS页面统计
+     */
+    private String behaviorType;
     /**
      * 商品图片
      */

+ 13 - 1
src/main/java/com/caimei365/tools/service/impl/CmBehaviorRecordServiceImpl.java

@@ -44,7 +44,7 @@ public class CmBehaviorRecordServiceImpl implements CmBehaviorRecordService {
                     String str = s.trim();
                     // 页面路径
                     if (str.startsWith("pagePath") && str.contains("=")) {
-                        String[] split1 = str.split("=");
+                        String[] split1 = str.split(str.substring(str.indexOf("="),str.indexOf("=")+1),2);
                         if (split1.length > 1) {
                             String value = split1[1];
                             String trim = value.trim();
@@ -104,6 +104,18 @@ public class CmBehaviorRecordServiceImpl implements CmBehaviorRecordService {
                             }
                         }
                     }
+                    // 用户行为记录 or roos页面统计
+                    if (str.startsWith("behaviorType") && str.contains("=")) {
+                        String[] split1 = str.split("=");
+                        cmBehaviorRecordPo.setBehaviorType("1");
+                        if (split1.length > 1) {
+                            String value = split1[1];
+                            String trim = value.trim();
+                            if (StringUtils.isNotBlank(trim)) {
+                                cmBehaviorRecordPo.setBehaviorType(trim);
+                            }
+                        }
+                    }
                     // 商品ID
                     if (str.startsWith("productId") && str.contains("=")) {
                         String[] split1 = str.split("=");

+ 2 - 2
src/main/resources/mapper/CmBehaviorRecordMapper.xml

@@ -2,7 +2,7 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei365.tools.mapper.CmBehaviorRecordMapper">
     <insert id="insertRecord">
-        INSERT INTO cm_behavior_record (IP, userID, pagePath, pageType, pageLabel, productID, accessTime, accessDuration, accessDate)
-        VALUES(#{ip},#{userId},#{pagePath},#{pageType},#{pageLabel},#{productId},#{accessTime},#{accessDuration},#{accessDate})
+        INSERT INTO cm_behavior_record (IP, userID, pagePath, pageType, pageLabel, behaviorType, productID, accessTime, accessDuration, accessDate)
+        VALUES(#{ip},#{userId},#{pagePath},#{pageType},#{pageLabel},#{behaviorType},#{productId},#{accessTime},#{accessDuration},#{accessDate})
     </insert>
 </mapper>