kaick 1 год назад
Родитель
Сommit
5852d20474

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

@@ -187,4 +187,14 @@ public class CmBehaviorRecordPo {
      * 机构市Id
      */
     private Integer cityId;
+
+    /**
+     * 记录起始者userId
+     *
+     */
+    private String headUserId;
+    /**
+     * 商品资料库id
+     */
+    private String productArchiveId;
 }

+ 24 - 3
src/main/java/com/caimei365/tools/service/impl/CmBehaviorRecordServiceImpl.java

@@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONObject;
 import com.caimei365.tools.mapper.CmBehaviorRecordMapper;
 import com.caimei365.tools.model.po.*;
 import com.caimei365.tools.service.CmBehaviorRecordService;
-import io.netty.util.internal.MathUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -14,11 +13,9 @@ import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.UnsupportedEncodingException;
-import java.math.BigDecimal;
 import java.net.HttpURLConnection;
 import java.net.MalformedURLException;
 import java.net.URL;
-import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.regex.Matcher;
@@ -257,6 +254,30 @@ public class CmBehaviorRecordServiceImpl implements CmBehaviorRecordService {
                             }
                         }
                     }
+                    // headUserId
+                    if (str.startsWith("headUserId") && str.contains("=")) {
+                        String[] split1 = str.split("=");
+                        if (split1.length > 1) {
+                            String value = split1[1];
+                            String trim = value.trim();
+                            if (StringUtils.isNotBlank(trim)) {
+                                log.info("headUserId============》" + trim);
+                                 cmBehaviorRecordPo.setHeadUserId(trim);
+                            }
+                        }
+                    }
+                    // productArchiveId
+                    if (str.startsWith("productArchiveId") && str.contains("=")) {
+                        String[] split1 = str.split("=");
+                        if (split1.length > 1) {
+                            String value = split1[1];
+                            String trim = value.trim();
+                            if (StringUtils.isNotBlank(trim)) {
+                                log.info("productArchiveId============》" + trim);
+                                 cmBehaviorRecordPo.setProductArchiveId(trim);
+                            }
+                        }
+                    }
 
                 }
                 // 处理页面标签为空

+ 18 - 6
src/main/resources/mapper/CmBehaviorRecordMapper.xml

@@ -24,9 +24,9 @@
 
     <insert id="insertRecord" parameterType="com.caimei365.tools.model.po.CmBehaviorRecordPo" useGeneratedKeys="true" keyProperty="recordID">
         INSERT INTO cm_behavior_record (IP, userID, touristId, pagePath, pageType, pageLabel, behaviorType, productID, accessTime,
-                                        accessDuration, accessDate, referer, accessSource, accessClient, isReckon, region, userAgent, openId, delFlag)
+                                        accessDuration, accessDate, referer, accessSource, accessClient, isReckon, region, userAgent, openId, delFlag,headUserId,productArchiveId)
         VALUES(#{IP}, #{userId}, #{touristId}, #{pagePath}, #{pageType}, #{pageLabel}, #{behaviorType}, #{productId}, #{accessTime},
-               #{accessDuration}, #{accessDate}, #{referer}, #{accessSource}, #{accessClient}, #{isReckon}, #{region}, #{userAgent}, #{openId}, #{delFlag})
+               #{accessDuration}, #{accessDate}, #{referer}, #{accessSource}, #{accessClient}, #{isReckon}, #{region}, #{userAgent}, #{openId}, #{delFlag},#{headUserId},#{productArchiveId})
     </insert>
 
     <select id="toDateRecode" resultType="com.caimei365.tools.model.po.CmBehaviorRecordPo">
@@ -356,6 +356,8 @@
             SUM(b.accessDuration) AS accessDuration,
             b.accessDate,
             b.accessClient,
+            b.headUserId,
+            b.productArchiveId,
             b.region AS region,
             u.registerTime AS addTime,
             (SELECT touristId FROM cm_behavior_record WHERE accessDate = #{accessDate} and IP = b.IP ORDER BY accessTime DESC LIMIT 1) AS touristId,
@@ -393,7 +395,9 @@
               pageTypes,
               addTime,
               touristId,
-              delFlag
+              delFlag,
+              headUserId,
+              productArchiveId
             ) values (
                    #{IP},
                    #{userId},
@@ -418,7 +422,9 @@
                    #{pageTypes},
                    #{addTime},
                    #{touristId},
-                   '0'
+                   '0',
+                   #{headUserId},
+                   #{productArchiveId}
                )
     </select>
     <select id="selTodayData" resultType="com.caimei365.tools.model.po.CmBehaviorRecordPo">
@@ -462,6 +468,8 @@
             SUM(b.accessDuration) AS accessDuration,
             b.accessDate,
             b.accessClient,
+            b.headUserId,
+            b.productArchiveId,
             b.region AS region,
             u.registerTime AS addTime
         FROM cm_behavior_record b
@@ -516,7 +524,9 @@
                 label,
                 pageLabels,
                 pageTypes,
-                addTime
+                addTime,
+                headUserId,
+                productArchiveId
             ) values (
                 #{recordID},
                 #{IP},
@@ -540,7 +550,9 @@
                 #{label},
                 #{pageLabels},
                 #{pageTypes},
-                #{addTime}
+                #{addTime},
+                #{headUserId},
+                #{productArchiveId}
             )
     </insert>
     <delete id="delTodayData">