瀏覽代碼

roos页面统计

huangzhiguo 2 年之前
父節點
當前提交
6d7d40fd40

+ 7 - 0
src/main/java/com/caimei/modules/user/dao/CmBehaviorRecordDao.java

@@ -27,4 +27,11 @@ public interface CmBehaviorRecordDao extends CrudDao<CmBehaviorRecord> {
      * @return
      */
     List<CmPageType> pageType();
+
+    /**
+     * ROOS页面统计查询咨询人信息
+     * @param cmBehaviorRecord
+     * @return
+     */
+    CmBehaviorRecord selConsult(CmBehaviorRecord cmBehaviorRecord);
 }

+ 27 - 0
src/main/java/com/caimei/modules/user/entity/CmBehaviorRecord.java

@@ -29,6 +29,9 @@ public class CmBehaviorRecord extends DataEntity<CmBehaviorRecord> {
     private String accessTime;    //访问时间
     private String accessDuration;  //访问时长
     private String accessDate;  //访问日期
+    private String consultName;
+    private String consultMobile;
+    private String behaviorType;  //是否是roos页面行为 1:用户行为、2:roos行为统计
 
     private Integer numbers;    //访问页面总数
     private String userIdentity; //公司类型
@@ -145,6 +148,30 @@ public class CmBehaviorRecord extends DataEntity<CmBehaviorRecord> {
         this.accessDate = accessDate;
     }
 
+    public String getConsultName() {
+        return consultName;
+    }
+
+    public void setConsultName(String consultName) {
+        this.consultName = consultName;
+    }
+
+    public String getConsultMobile() {
+        return consultMobile;
+    }
+
+    public void setConsultMobile(String consultMobile) {
+        this.consultMobile = consultMobile;
+    }
+
+    public String getBehaviorType() {
+        return behaviorType;
+    }
+
+    public void setBehaviorType(String behaviorType) {
+        this.behaviorType = behaviorType;
+    }
+
     public Integer getNumbers() {
         return numbers;
     }

+ 16 - 0
src/main/java/com/caimei/modules/user/web/CmUserBehaviorRecordController.java

@@ -5,6 +5,7 @@ import com.caimei.modules.user.entity.CmBehaviorRecord;
 import com.caimei.modules.user.entity.CmPageType;
 import com.caimei.modules.user.service.CmBehaviorRecordService;
 import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
@@ -40,11 +41,26 @@ public class CmUserBehaviorRecordController {
     public String List(CmBehaviorRecord cmBehaviorRecord, HttpServletRequest request, HttpServletResponse response, Model model){
         Page<CmBehaviorRecord> page = cmBehaviorRecordService.findPage(new Page<>(request, response), cmBehaviorRecord);
         for(CmBehaviorRecord record: page.getList()) {
+            // 是roos页面统计判断咨询人信息是否为空并赋值
+            if ("2".equals(cmBehaviorRecord.getBehaviorType())) {
+                CmBehaviorRecord consult = cmBehaviorRecordDao.selConsult(record);
+                if (consult != null) {
+                    if (StringUtils.isNotEmpty(consult.getConsultName())) {
+                        record.setConsultName(consult.getConsultName());
+                    }
+                    if (StringUtils.isNotEmpty(consult.getConsultMobile())) {
+                        record.setConsultMobile(consult.getConsultMobile());
+                    }
+                }
+            }
             String time = cmBehaviorRecordService.calculationTime(record.getAccessDuration());
             record.setAccessDuration(time);
         }
         model.addAttribute("page",page);
         model.addAttribute("cmBehaviorRecord", cmBehaviorRecord);
+        if ("2".equals(cmBehaviorRecord.getBehaviorType())){
+            return "modules/user/behaviorRecordRoosList";
+        }
         return "modules/user/behaviorRecordList";
     }
 

+ 12 - 2
src/main/resources/mappings/modules/user/CmBehaviorRecordMapper.xml

@@ -8,6 +8,8 @@
         b.pagePath,
         b.pageType,
         b.pageLabel,
+        b.consultName,
+        b.consultMobile,
         b.productID,
         b.accessTime,
         b.accessDate
@@ -31,8 +33,9 @@
         LEFT JOIN shop s ON b.userID = s.userID
         LEFT JOIN serviceprovider sp on c.spID = sp.serviceProviderID
         <where>
+            behaviorType = #{behaviorType}
             <if test="IP != null and IP != ''">
-                b.IP = #{IP}
+                AND b.IP = #{IP}
             </if>
             <if test="name != null and name != ''">
                 AND u.name = #{name}
@@ -86,7 +89,7 @@
         LEFT JOIN product p ON b.productID = p.productID
         LEFT JOIN cm_page_type pt ON b.pageType = pt.id
         <where>
-            b.IP = #{IP} AND b.accessDate = #{accessDate} AND b.userID = #{userID}
+            b.IP = #{IP} AND b.accessDate = #{accessDate} AND b.userID = #{userID} AND behaviorType = #{behaviorType}
             <if test="pageType != null and pageType != ''">
                 AND b.pageType = #{pageType}
             </if>
@@ -102,4 +105,11 @@
     <select id="pageType" resultType="com.caimei.modules.user.entity.CmPageType">
         SELECT id as idPage,pageType FROM cm_page_type
     </select>
+
+    <select id="selConsult" resultType="com.caimei.modules.user.entity.CmBehaviorRecord">
+        SELECT consultName,
+               consultMobile
+               FROM cm_behavior_record
+        WHERE behaviorType = 2 AND IP = #{IP} AND accessDate = #{accessDate} AND (consultName IS NOT NULL OR consultName = '') LIMIT 1
+    </select>
 </mapper>

+ 8 - 2
src/main/webapp/WEB-INF/views/modules/user/behaviorRecordDetailsList.jsp

@@ -23,8 +23,14 @@
 </head>
 <body>
 <ul class="nav nav-tabs">
-    <li><a href="${ctx}/user/behavior/record/list">用户行为记录</a></li>
-    <li class="active"><a href="${ctx}/user/behavior/record/recordList?IP=${cmBehaviorRecord.IP}&accessDate=${cmBehaviorRecord.accessDate}&userID=${cmBehaviorRecord.userID}">查看详情</a></li>
+    <c:if test="${cmBehaviorRecord.behaviorType eq '2'}">
+        <li><a href="${ctx}/user/behavior/record/list?behaviorType=${cmBehaviorRecord.behaviorType}">ROOS页面统计</a></li>
+    </c:if>
+    <c:if test="${cmBehaviorRecord.behaviorType eq '1'}">
+        <li><a href="${ctx}/user/behavior/record/list?behaviorType=${cmBehaviorRecord.behaviorType}">用户行为记录</a></li>
+    </c:if>
+    <li class="active"><a href="${ctx}/user/behavior/record/recordList?IP=${cmBehaviorRecord.IP}&accessDate=${cmBehaviorRecord.accessDate}&userID=${cmBehaviorRecord.userID}&behaviorType=${cmBehaviorRecord.behaviorType}">查看详情</a></li>
+
 </ul>
 <form:form id="searchForm" modelAttribute="cmBehaviorRecord" action="${ctx}/user/behavior/record/recordList?IP=${cmBehaviorRecord.IP}&accessDate=${cmBehaviorRecord.accessDate}&userID=${cmBehaviorRecord.userID}" method="post" class="breadcrumb form-search">
     <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>

+ 5 - 4
src/main/webapp/WEB-INF/views/modules/user/behaviorRecordList.jsp

@@ -31,9 +31,9 @@
 </head>
 <body>
 <ul class="nav nav-tabs">
-    <li class="active"><a href="${ctx}/user/behavior/record/list">用户行为记录</a></li>
+    <li class="active"><a href="${ctx}/user/behavior/record/list?behaviorType=1">用户行为记录</a></li>
 </ul>
-<form:form id="searchForm" modelAttribute="cmBehaviorRecord" action="${ctx}/user/behavior/record/list" method="post" class="breadcrumb form-search">
+<form:form id="searchForm" modelAttribute="cmBehaviorRecord" action="${ctx}/user/behavior/record/list?behaviorType=1" method="post" class="breadcrumb form-search">
     <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
     <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
     <div class="ul-form">
@@ -141,13 +141,14 @@
                    </c:if>
                    <c:if test="${cmBehaviorRecord.spName eq null}">
                        ---
-                   </c:if></td>
+                   </c:if>
+               </td>
             </c:if>
            <td>${cmBehaviorRecord.numbers}</td>
            <td>${cmBehaviorRecord.accessDuration}</td>
            <td>${cmBehaviorRecord.accessDate}</td>
            <td>
-               <a href="${ctx}/user/behavior/record/recordList?IP=${cmBehaviorRecord.IP}&accessDate=${cmBehaviorRecord.accessDate}&userID=${cmBehaviorRecord.userID}">查看详情</a>
+               <a href="${ctx}/user/behavior/record/recordList?IP=${cmBehaviorRecord.IP}&accessDate=${cmBehaviorRecord.accessDate}&userID=${cmBehaviorRecord.userID}&behaviorType=1">查看详情</a>
            </td>
         </tr>
     </c:forEach>

+ 185 - 0
src/main/webapp/WEB-INF/views/modules/user/behaviorRecordRoosList.jsp

@@ -0,0 +1,185 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<%--
+  Created by IntelliJ IDEA.
+  User: Administrator
+  Date: 2022/10/31
+  Time: 9:25
+  To change this template use File | Settings | File Templates.
+--%>
+<%@ page import="com.thinkgem.jeesite.common.config.Global" %>
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+
+<html>
+<head>
+    <title>ROOS页面统计</title>
+    <meta name="decorator" content="default"/>
+    <style>
+        .table th{
+            text-align: center;
+        }
+        .table td{
+            text-align: center;
+        }
+        .ul-form input,select{
+            margin-left: 10px;
+        }
+        .ys-kin input,span{
+            margin-left: 10px;
+        }
+    </style>
+</head>
+<body>
+<ul class="nav nav-tabs">
+    <li class="active"><a href="${ctx}/user/behavior/record/list?behaviorType=2">ROOS页面统计</a></li>
+</ul>
+<form:form id="searchForm" modelAttribute="cmBehaviorRecord" action="${ctx}/user/behavior/record/list?behaviorType=2" method="post" class="breadcrumb form-search">
+    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+    <div class="ul-form">
+        <label>IP:</label>
+        <form:input path="IP" htmlEscape="false" maxlength="15" cssStyle="width: 150px" class="input-mini"/>
+        <label>公司名称:</label>
+        <form:input path="name" htmlEscape="false" maxlength="11" cssStyle="width: 150px" class="input-mini"/>
+        <label>公司类型:</label>
+        <form:select path="userIdentity" cssStyle="width: 150px" class="input-medium required">
+            <form:option value="" label="请选择"/>
+            <form:option value="2" label="机构"/>
+            <form:option value="3" label="供应商"/>
+            <form:option value="1" label="游客"/>
+        </form:select>
+        <label>联系人:</label>
+        <form:input path="linkMan" htmlEscape="false" maxlength="20" cssStyle="width: 150px" class="input-small"/>
+        <label>手机号码:</label>
+        <form:input path="contractMobile" htmlEscape="false" maxlength="20" cssStyle="width: 150px" class="input-small"/>
+        <label>协销:</label>
+        <form:input path="spName" htmlEscape="false" maxlength="20" cssStyle="width: 150px" class="input-small"/>
+        <div class="ys-kin" style="margin-top: 20px">
+            <label>访问日期:</label>
+            <input name="startTime" type="text" readonly="readonly" maxlength="15" class="input-mini Wdate"
+                   value="${cmBehaviorRecord.startTime}"
+                   onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/> <span> - </span>
+            <input name="endTime" type="text" readonly="readonly" maxlength="15" class="input-mini Wdate"
+                   value="${cmBehaviorRecord.endTime}"
+                   onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+            <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+        </div>
+        <div class="clearfix"></div>
+    </div>
+</form:form>
+<sys:message content="${message}"/>
+<table id="contentTable" class="table table-striped table-bordered table-condensed">
+    <thead>
+    <tr>
+        <th>IP</th>
+        <th>公司类型</th>
+        <th>公司名称</th>
+        <th>联系人</th>
+        <th>手机号码</th>
+        <th>所属协销</th>
+        <th>咨询姓名</th>
+        <th>咨询手机号码</th>
+        <th>访问页面数量</th>
+        <th>总时长</th>
+        <th>访问日期</th>
+        <th>操作</th>
+    </tr>
+    </thead>
+    <tbody>
+    <c:forEach items="${page.list}" var="cmBehaviorRecord" varStatus="index">
+        <tr>
+            <td>${cmBehaviorRecord.IP}</td>
+            <td>
+                <c:if test="${cmBehaviorRecord.userIdentity eq 2 || cmBehaviorRecord.userIdentity eq 4}">
+                    机构
+                </c:if>
+                <c:if test="${cmBehaviorRecord.userIdentity eq 3}">
+                    供应商
+                </c:if>
+                <c:if test="${cmBehaviorRecord.userID == '0'}">
+                    游客
+                </c:if>
+                <c:if test="${cmBehaviorRecord.userID != '0' && (cmBehaviorRecord.userIdentity == null || cmBehaviorRecord.userIdentity == '')}">
+                    ---
+                </c:if>
+            </td>
+            <c:if test="${cmBehaviorRecord.userID == '0'}">
+                <td>---</td>
+                <td>---</td>
+                <td>---</td>
+                <td>---</td>
+            </c:if>
+            <c:if test="${cmBehaviorRecord.userID != '0'}">
+                <td>
+                    <c:if test="${cmBehaviorRecord.userIdentity eq 2}">
+                        ${cmBehaviorRecord.name}
+                    </c:if>
+                    <c:if test="${cmBehaviorRecord.userIdentity eq 4}">
+                        ${cmBehaviorRecord.linkMan}
+                    </c:if>
+                    <c:if test="${cmBehaviorRecord.userIdentity eq 3}">
+                        ${cmBehaviorRecord.sname}
+                    </c:if>
+                </td>
+                <td>
+                    <c:if test="${cmBehaviorRecord.userIdentity eq 2 || cmBehaviorRecord.userIdentity eq 4}">
+                        ${cmBehaviorRecord.linkMan}
+                    </c:if>
+                    <c:if test="${cmBehaviorRecord.userIdentity eq 3}">
+                        ${cmBehaviorRecord.slinkMan}
+                    </c:if>
+                </td>
+                <td>
+                    <c:if test="${cmBehaviorRecord.userIdentity eq 2 || cmBehaviorRecord.userIdentity eq 4}">
+                        ${cmBehaviorRecord.contractMobile}
+                    </c:if>
+                    <c:if test="${cmBehaviorRecord.userIdentity eq 3}">
+                        ${cmBehaviorRecord.scontractMobile}
+                    </c:if>
+                </td>
+                <td>
+                    <c:if test="${cmBehaviorRecord.spName ne null}">
+                        ${cmBehaviorRecord.spName}
+                    </c:if>
+                    <c:if test="${cmBehaviorRecord.spName eq null}">
+                        ---
+                    </c:if></td>
+            </c:if>
+            <td>
+                <c:if test="${cmBehaviorRecord.consultName eq null}">
+                    ---
+                </c:if>
+                <c:if test="${cmBehaviorRecord.consultName ne null}">
+                    ${cmBehaviorRecord.consultName}
+                </c:if>
+            </td>
+            <td><c:if test="${cmBehaviorRecord.consultMobile eq null}">
+                ---
+            </c:if>
+                <c:if test="${cmBehaviorRecord.consultMobile ne null}">
+                    ${cmBehaviorRecord.consultMobile}
+                </c:if>
+            </td>
+            <td>${cmBehaviorRecord.numbers}</td>
+            <td>${cmBehaviorRecord.accessDuration}</td>
+            <td>${cmBehaviorRecord.accessDate}</td>
+            <td>
+                <a href="${ctx}/user/behavior/record/recordList?IP=${cmBehaviorRecord.IP}&accessDate=${cmBehaviorRecord.accessDate}&userID=${cmBehaviorRecord.userID}&behaviorType=2">查看详情</a>
+            </td>
+        </tr>
+    </c:forEach>
+    </tbody>
+</table>
+<div class="pagination">${page}</div>
+<% request.setAttribute("caimeiCore", Global.getConfig("caimei.core"));%>
+<script type="text/javascript">
+    function page(n,s){
+        $("#pageNo").val(n);
+        $("#pageSize").val(s);
+        $("#searchForm").submit();
+        return false;
+    }
+</script>
+</body>
+
+</html>