Prechádzať zdrojové kódy

用户行为记录初始

huangzhiguo 2 rokov pred
rodič
commit
b16b4f2859

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

@@ -0,0 +1,15 @@
+package com.caimei.modules.user.dao;
+
+import com.caimei.modules.user.entity.CmBehaviorRecord;
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2022/11/1
+ */
+@MyBatisDao
+public interface CmBehaviorRecordDao extends CrudDao<CmBehaviorRecord> {
+}

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

@@ -0,0 +1,123 @@
+package com.caimei.modules.user.entity;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2022/11/1
+ */
+public class CmBehaviorRecord extends DataEntity<CmBehaviorRecord> {
+    private Integer recordID ;
+    private String IP;  //访问人IP地址
+    private Integer userID; //用户id、0为游客
+    private String pagePath;    //页面路径
+    private String pageType;    //页面类型
+    private String pageLabel;   //页面标签
+    private String productImage;    //商品图片
+    private Integer productID;  //商品ID
+    private String productName; //商品名称
+    private Date accessTime;    //访问时间
+    private String accessDuration;  //访问时长
+    private String accessDate;  //访问日期
+
+    public Integer getRecordID() {
+        return recordID;
+    }
+
+    public void setRecordID(Integer recordID) {
+        this.recordID = recordID;
+    }
+
+    public String getIP() {
+        return IP;
+    }
+
+    public void setIP(String IP) {
+        this.IP = IP;
+    }
+
+    public Integer getUserID() {
+        return userID;
+    }
+
+    public void setUserID(Integer userID) {
+        this.userID = userID;
+    }
+
+    public String getPagePath() {
+        return pagePath;
+    }
+
+    public void setPagePath(String pagePath) {
+        this.pagePath = pagePath;
+    }
+
+    public String getPageType() {
+        return pageType;
+    }
+
+    public void setPageType(String pageType) {
+        this.pageType = pageType;
+    }
+
+    public String getPageLabel() {
+        return pageLabel;
+    }
+
+    public void setPageLabel(String pageLabel) {
+        this.pageLabel = pageLabel;
+    }
+
+    public String getProductImage() {
+        return productImage;
+    }
+
+    public void setProductImage(String productImage) {
+        this.productImage = productImage;
+    }
+
+    public Integer getProductID() {
+        return productID;
+    }
+
+    public void setProductID(Integer productID) {
+        this.productID = productID;
+    }
+
+    public String getProductName() {
+        return productName;
+    }
+
+    public void setProductName(String productName) {
+        this.productName = productName;
+    }
+
+    public Date getAccessTime() {
+        return accessTime;
+    }
+
+    public void setAccessTime(Date accessTime) {
+        this.accessTime = accessTime;
+    }
+
+    public String getAccessDuration() {
+        return accessDuration;
+    }
+
+    public void setAccessDuration(String accessDuration) {
+        this.accessDuration = accessDuration;
+    }
+
+    public String getAccessDate() {
+        return accessDate;
+    }
+
+    public void setAccessDate(String accessDate) {
+        this.accessDate = accessDate;
+    }
+}

+ 16 - 0
src/main/java/com/caimei/modules/user/service/CmBehaviorRecordService.java

@@ -0,0 +1,16 @@
+package com.caimei.modules.user.service;
+
+import com.caimei.modules.user.dao.CmBehaviorRecordDao;
+import com.caimei.modules.user.entity.CmBehaviorRecord;
+import com.thinkgem.jeesite.common.service.CrudService;
+import org.springframework.stereotype.Service;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2022/11/1
+ */
+@Service
+public class CmBehaviorRecordService extends CrudService<CmBehaviorRecordDao, CmBehaviorRecord> {
+}

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

@@ -0,0 +1,42 @@
+package com.caimei.modules.user.web;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2022/10/28
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/user/behavior/record")
+public class CmUserBehaviorRecordController {
+
+    /**
+     * 用户行为记录
+     * @param model
+     * @return
+     */
+    @RequestMapping(value = {"list", ""})
+    public String List(Model model){
+
+        model.addAttribute("",null);
+        return "modules/user/behaviorRecordList";
+    }
+
+    /**
+     * 用户行为记录详情
+     * @param model
+     * @return
+     */
+    @RequestMapping("userDetails")
+    public String userDetails(Model model){
+
+        model.addAttribute("", null);
+        return "modules/user/behaviorRecordDetailsList";
+    }
+
+
+}

+ 7 - 0
src/main/resources/mappings/modules/user/CmBehaviorRecordMapper.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.caimei.modules.user.dao.CmBehaviorRecordDao">
+    <select id="recordDay" resultType="com.caimei.modules.user.entity.CmBehaviorRecord">
+        SELECT * FROM cm_behavior_record GROUP BY IP, accessDate ORDER BY accessTime
+    </select>
+</mapper>

+ 81 - 0
src/main/webapp/WEB-INF/views/modules/user/behaviorRecordDetailsList.jsp

@@ -0,0 +1,81 @@
+<%--
+  Created by IntelliJ IDEA.
+  User: Administrator
+  Date: 2022/10/31
+  Time: 10:57
+  To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<html>
+<head>
+    <title>Title</title>
+</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/userDetails">查看详情</a></li>
+</ul>
+<form:form id="searchForm" modelAttribute="clubChangeSp" action="${ctx}/user/behavior/record/list" 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>页面类型:</label>
+        <form:select path="checkStatus" class="input-medium required">
+            <form:option value="" label="请选择"/>
+            <form:option value="首页" label="首页"/>
+            <form:option value="商品详情" label="商品详情"/>
+            <form:option value="供应商主页" label="供应商主页"/>
+        </form:select>
+        <label>供应商ID:</label>
+        <form:input path="linkMan1" htmlEscape="false" maxlength="20" class="input-small"/>
+        <label>商品名称:</label>
+        <form:input path="linkMan1" htmlEscape="false" maxlength="20" class="input-small"/>
+        <label>访问时间:</label>
+        <input name="startTime" type="text" readonly="readonly" maxlength="15" class="input-mini Wdate"
+               value="${clubTemporary.startTime}"
+               onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/> -
+        <input name="endTime" type="text" readonly="readonly" maxlength="15" class="input-mini Wdate"
+               value="${clubTemporary.endTime}"
+               onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+        &nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+        <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>页面路径</th>
+        <th>页面类型</th>
+        <th>页面标签</th>
+        <th>商品图片</th>
+        <th>商品ID</th>
+        <th>商品名称</th>
+        <th>访问时间</th>
+        <th>访问时长</th>
+    </tr>
+    </thead>
+    <tbody>
+    <tr>
+        <td></td>
+        <td></td>
+        <td></td>
+        <td></td>
+        <td></td>
+        <td></td>
+        <td></td>
+        <td></td>
+    </tr>
+    </tbody>
+</table>
+</body>
+<script type="text/javascript">
+    function page(n,s){
+        $("#pageNo").val(n);
+        $("#pageSize").val(s);
+        $("#searchForm").submit();
+        return false;
+    }
+</script>
+</html>

+ 90 - 0
src/main/webapp/WEB-INF/views/modules/user/behaviorRecordList.jsp

@@ -0,0 +1,90 @@
+<%--
+  Created by IntelliJ IDEA.
+  User: Administrator
+  Date: 2022/10/31
+  Time: 9:25
+  To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+
+<html>
+<head>
+    <title>用户行为记录</title>
+</head>
+<body>
+<ul class="nav nav-tabs">
+    <li class="active"><a href="${ctx}/user/behavior/record/list">用户行为记录</a></li>
+</ul>
+<form:form id="searchForm" modelAttribute="clubChangeSp" action="${ctx}/user/behavior/record/list" 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>公司名称:</label>
+        <form:input path="clubName" htmlEscape="false" maxlength="11" class="input-mini"/>
+        <label>公司类型:</label>
+        <form:select path="checkStatus" class="input-medium required">
+            <form:option value="" label="请选择"/>
+            <form:option value="机构" label="机构"/>
+            <form:option value="供应商" label="供应商"/>
+        </form:select>
+        <label>联系人:</label>
+            <form:input path="linkMan1" htmlEscape="false" maxlength="20" class="input-small"/>
+        <label>手机号码:</label>
+        <form:input path="linkMan1" htmlEscape="false" maxlength="20" class="input-small"/>
+        <label>协销:</label>
+        <form:input path="linkMan1" htmlEscape="false" maxlength="20" class="input-small"/>
+        <label>访问时间:</label>
+        <input name="startTime" type="text" readonly="readonly" maxlength="15" class="input-mini Wdate"
+               value="${clubTemporary.startTime}"
+               onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/> -
+        <input name="endTime" type="text" readonly="readonly" maxlength="15" class="input-mini Wdate"
+               value="${clubTemporary.endTime}"
+               onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+        &nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+        <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>
+        </tr>
+    </thead>
+    <tbody>
+        <tr>
+           <td></td>
+           <td></td>
+           <td></td>
+           <td></td>
+           <td></td>
+           <td></td>
+           <td></td>
+           <td></td>
+           <td></td>
+           <td>
+               <a href="">查看详情</a>
+           </td>
+        </tr>
+    </tbody>
+</table>
+</body>
+<script type="text/javascript">
+    function page(n,s){
+        $("#pageNo").val(n);
+        $("#pageSize").val(s);
+        $("#searchForm").submit();
+        return false;
+    }
+</script>
+</html>