Explorar el Código

按钮操作日志

da-xian hace 1 mes
padre
commit
b498c8053e

+ 9 - 1
src/main/java/com/bowintek/smartsearch/controller/system/LogController.java

@@ -42,6 +42,13 @@ public class LogController {
         logService.save(data.getPageName(),data.getPageUrl(),data.getActionName(), accountService.getLoginUserID());
         logService.save(data.getPageName(),data.getPageUrl(),data.getActionName(), accountService.getLoginUserID());
         return RespGenerstor.success(true);
         return RespGenerstor.success(true);
     }
     }
+
+    @PostMapping("/save2")
+    public BaseResponse<Integer> save2(@RequestBody LogModel data) {
+        logService.save2(data.getPageName(),data.getPageUrl(),data.getActionName(), accountService.getLoginUserID(), data.getFunctionCode(), data.getFunctionName());
+        return RespGenerstor.success(true);
+    }
+
     @ResponseBody
     @ResponseBody
     @GetMapping("/exportLog")
     @GetMapping("/exportLog")
     public void exportSubject(HttpServletResponse response,
     public void exportSubject(HttpServletResponse response,
@@ -54,7 +61,7 @@ public class LogController {
 
 
         ExcelHelper excelHelper = new ExcelHelper();
         ExcelHelper excelHelper = new ExcelHelper();
         ExcelHelper.ExcelData data = excelHelper.new ExcelData();
         ExcelHelper.ExcelData data = excelHelper.new ExcelData();
-        data.setTitles(Arrays.asList(new String[]{"登录账号", "姓名", "操作页面", "操作时间"}));
+        data.setTitles(Arrays.asList(new String[]{"登录账号", "姓名", "操作页面", "点击按钮", "操作时间"}));
 
 
         List<List<Object>> rowData = new ArrayList();
         List<List<Object>> rowData = new ArrayList();
         for (LogModel item : dataList) {
         for (LogModel item : dataList) {
@@ -62,6 +69,7 @@ public class LogController {
             row.add(item.getLoginID());
             row.add(item.getLoginID());
             row.add(item.getUserName());
             row.add(item.getUserName());
             row.add(item.getPageName());
             row.add(item.getPageName());
+            row.add(item.getFunctionName());
             row.add(dateUtils.dateToStr(item.getLogTime()));
             row.add(dateUtils.dateToStr(item.getLogTime()));
             rowData.add(row);
             rowData.add(row);
         }
         }

+ 20 - 0
src/main/java/com/bowintek/smartsearch/model/SysLog.java

@@ -15,6 +15,10 @@ public class SysLog {
 
 
     private Date logTime;
     private Date logTime;
 
 
+    private String functionCode;
+
+    private String functionName;
+
     public String getLogID() {
     public String getLogID() {
         return logID;
         return logID;
     }
     }
@@ -62,4 +66,20 @@ public class SysLog {
     public void setLogTime(Date logTime) {
     public void setLogTime(Date logTime) {
         this.logTime = logTime;
         this.logTime = logTime;
     }
     }
+
+    public String getFunctionCode() {
+        return functionCode;
+    }
+
+    public void setFunctionCode(String functionCode) {
+        this.functionCode = functionCode == null ? null : functionCode.trim();
+    }
+
+    public String getFunctionName() {
+        return functionName;
+    }
+
+    public void setFunctionName(String functionName) {
+        this.functionName = functionName == null ? null : functionName.trim();
+    }
 }
 }

+ 140 - 0
src/main/java/com/bowintek/smartsearch/model/SysLogExample.java

@@ -514,6 +514,146 @@ public class SysLogExample {
             addCriterion("LogTime not between", value1, value2, "logTime");
             addCriterion("LogTime not between", value1, value2, "logTime");
             return (Criteria) this;
             return (Criteria) this;
         }
         }
+
+        public Criteria andFunctionCodeIsNull() {
+            addCriterion("FunctionCode is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionCodeIsNotNull() {
+            addCriterion("FunctionCode is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionCodeEqualTo(String value) {
+            addCriterion("FunctionCode =", value, "functionCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionCodeNotEqualTo(String value) {
+            addCriterion("FunctionCode <>", value, "functionCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionCodeGreaterThan(String value) {
+            addCriterion("FunctionCode >", value, "functionCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionCodeGreaterThanOrEqualTo(String value) {
+            addCriterion("FunctionCode >=", value, "functionCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionCodeLessThan(String value) {
+            addCriterion("FunctionCode <", value, "functionCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionCodeLessThanOrEqualTo(String value) {
+            addCriterion("FunctionCode <=", value, "functionCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionCodeLike(String value) {
+            addCriterion("FunctionCode like", value, "functionCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionCodeNotLike(String value) {
+            addCriterion("FunctionCode not like", value, "functionCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionCodeIn(List<String> values) {
+            addCriterion("FunctionCode in", values, "functionCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionCodeNotIn(List<String> values) {
+            addCriterion("FunctionCode not in", values, "functionCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionCodeBetween(String value1, String value2) {
+            addCriterion("FunctionCode between", value1, value2, "functionCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionCodeNotBetween(String value1, String value2) {
+            addCriterion("FunctionCode not between", value1, value2, "functionCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionNameIsNull() {
+            addCriterion("FunctionName is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionNameIsNotNull() {
+            addCriterion("FunctionName is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionNameEqualTo(String value) {
+            addCriterion("FunctionName =", value, "functionName");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionNameNotEqualTo(String value) {
+            addCriterion("FunctionName <>", value, "functionName");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionNameGreaterThan(String value) {
+            addCriterion("FunctionName >", value, "functionName");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionNameGreaterThanOrEqualTo(String value) {
+            addCriterion("FunctionName >=", value, "functionName");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionNameLessThan(String value) {
+            addCriterion("FunctionName <", value, "functionName");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionNameLessThanOrEqualTo(String value) {
+            addCriterion("FunctionName <=", value, "functionName");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionNameLike(String value) {
+            addCriterion("FunctionName like", value, "functionName");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionNameNotLike(String value) {
+            addCriterion("FunctionName not like", value, "functionName");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionNameIn(List<String> values) {
+            addCriterion("FunctionName in", values, "functionName");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionNameNotIn(List<String> values) {
+            addCriterion("FunctionName not in", values, "functionName");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionNameBetween(String value1, String value2) {
+            addCriterion("FunctionName between", value1, value2, "functionName");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionNameNotBetween(String value1, String value2) {
+            addCriterion("FunctionName not between", value1, value2, "functionName");
+            return (Criteria) this;
+        }
     }
     }
 
 
     public static class Criteria extends GeneratedCriteria {
     public static class Criteria extends GeneratedCriteria {

+ 22 - 0
src/main/java/com/bowintek/smartsearch/services/impl/system/LogServiceImpl.java

@@ -52,5 +52,27 @@ public class LogServiceImpl implements LogService {
         return 1;
         return 1;
     }
     }
 
 
+
+    public Integer save2(String pageName, String pageUrl, String actionName, String userID, String functionCode, String functionName) {
+        try{
+            SysLog sysLog = new SysLog();
+            sysLog.setLogID(UUID.randomUUID().toString());
+            sysLog.setPageName(pageName);
+            sysLog.setPageUrl(pageUrl);
+            sysLog.setActionName(actionName);
+            sysLog.setUserID(userID);
+            sysLog.setFunctionCode(functionCode);
+            sysLog.setFunctionName(functionName);
+            sysLog.setLogTime(new Date());
+
+            sysLogMapper.insert(sysLog);
+        }
+        catch (Exception ex){
+
+        }
+
+        return 1;
+    }
+
 }
 }
 
 

+ 1 - 0
src/main/java/com/bowintek/smartsearch/services/service/system/LogService.java

@@ -11,5 +11,6 @@ public interface LogService {
     PageInfo<LogModel> getList(Integer page, Integer rows, String loginID, String userName, Date startDate, Date endDate, List<String> idList);
     PageInfo<LogModel> getList(Integer page, Integer rows, String loginID, String userName, Date startDate, Date endDate, List<String> idList);
 
 
     Integer save(String pageName,String pageUrl,String actionName, String userID);
     Integer save(String pageName,String pageUrl,String actionName, String userID);
+    Integer save2(String pageName,String pageUrl,String actionName, String userID, String functionCode, String functionName);
 
 
 }
 }

+ 37 - 7
src/main/resources/mapping/SysLogMapper.xml

@@ -8,6 +8,8 @@
     <result column="ActionName" jdbcType="VARCHAR" property="actionName" />
     <result column="ActionName" jdbcType="VARCHAR" property="actionName" />
     <result column="UserID" jdbcType="VARCHAR" property="userID" />
     <result column="UserID" jdbcType="VARCHAR" property="userID" />
     <result column="LogTime" jdbcType="TIMESTAMP" property="logTime" />
     <result column="LogTime" jdbcType="TIMESTAMP" property="logTime" />
+    <result column="FunctionCode" jdbcType="VARCHAR" property="functionCode" />
+    <result column="FunctionName" jdbcType="VARCHAR" property="functionName" />
   </resultMap>
   </resultMap>
   <sql id="Example_Where_Clause">
   <sql id="Example_Where_Clause">
     <where>
     <where>
@@ -68,7 +70,7 @@
     </where>
     </where>
   </sql>
   </sql>
   <sql id="Base_Column_List">
   <sql id="Base_Column_List">
-    LogID, PageName, PageUrl, ActionName, UserID, LogTime
+    LogID, PageName, PageUrl, ActionName, UserID, LogTime, FunctionCode, FunctionName
   </sql>
   </sql>
   <select id="selectByExample" parameterType="com.bowintek.smartsearch.model.SysLogExample" resultMap="BaseResultMap">
   <select id="selectByExample" parameterType="com.bowintek.smartsearch.model.SysLogExample" resultMap="BaseResultMap">
     select
     select
@@ -102,11 +104,11 @@
   </delete>
   </delete>
   <insert id="insert" parameterType="com.bowintek.smartsearch.model.SysLog">
   <insert id="insert" parameterType="com.bowintek.smartsearch.model.SysLog">
     insert into sys_log (LogID, PageName, PageUrl, 
     insert into sys_log (LogID, PageName, PageUrl, 
-      ActionName, UserID, LogTime
-      )
+      ActionName, UserID, LogTime, 
+      FunctionCode, FunctionName)
     values (#{logID,jdbcType=VARCHAR}, #{pageName,jdbcType=VARCHAR}, #{pageUrl,jdbcType=VARCHAR}, 
     values (#{logID,jdbcType=VARCHAR}, #{pageName,jdbcType=VARCHAR}, #{pageUrl,jdbcType=VARCHAR}, 
-      #{actionName,jdbcType=VARCHAR}, #{userID,jdbcType=VARCHAR}, #{logTime,jdbcType=TIMESTAMP}
-      )
+      #{actionName,jdbcType=VARCHAR}, #{userID,jdbcType=VARCHAR}, #{logTime,jdbcType=TIMESTAMP}, 
+      #{functionCode,jdbcType=VARCHAR}, #{functionName,jdbcType=VARCHAR})
   </insert>
   </insert>
   <insert id="insertSelective" parameterType="com.bowintek.smartsearch.model.SysLog">
   <insert id="insertSelective" parameterType="com.bowintek.smartsearch.model.SysLog">
     insert into sys_log
     insert into sys_log
@@ -129,6 +131,12 @@
       <if test="logTime != null">
       <if test="logTime != null">
         LogTime,
         LogTime,
       </if>
       </if>
+      <if test="functionCode != null">
+        FunctionCode,
+      </if>
+      <if test="functionName != null">
+        FunctionName,
+      </if>
     </trim>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="logID != null">
       <if test="logID != null">
@@ -149,6 +157,12 @@
       <if test="logTime != null">
       <if test="logTime != null">
         #{logTime,jdbcType=TIMESTAMP},
         #{logTime,jdbcType=TIMESTAMP},
       </if>
       </if>
+      <if test="functionCode != null">
+        #{functionCode,jdbcType=VARCHAR},
+      </if>
+      <if test="functionName != null">
+        #{functionName,jdbcType=VARCHAR},
+      </if>
     </trim>
     </trim>
   </insert>
   </insert>
   <select id="countByExample" parameterType="com.bowintek.smartsearch.model.SysLogExample" resultType="java.lang.Long">
   <select id="countByExample" parameterType="com.bowintek.smartsearch.model.SysLogExample" resultType="java.lang.Long">
@@ -178,6 +192,12 @@
       <if test="row.logTime != null">
       <if test="row.logTime != null">
         LogTime = #{row.logTime,jdbcType=TIMESTAMP},
         LogTime = #{row.logTime,jdbcType=TIMESTAMP},
       </if>
       </if>
+      <if test="row.functionCode != null">
+        FunctionCode = #{row.functionCode,jdbcType=VARCHAR},
+      </if>
+      <if test="row.functionName != null">
+        FunctionName = #{row.functionName,jdbcType=VARCHAR},
+      </if>
     </set>
     </set>
     <if test="example != null">
     <if test="example != null">
       <include refid="Update_By_Example_Where_Clause" />
       <include refid="Update_By_Example_Where_Clause" />
@@ -190,7 +210,9 @@
       PageUrl = #{row.pageUrl,jdbcType=VARCHAR},
       PageUrl = #{row.pageUrl,jdbcType=VARCHAR},
       ActionName = #{row.actionName,jdbcType=VARCHAR},
       ActionName = #{row.actionName,jdbcType=VARCHAR},
       UserID = #{row.userID,jdbcType=VARCHAR},
       UserID = #{row.userID,jdbcType=VARCHAR},
-      LogTime = #{row.logTime,jdbcType=TIMESTAMP}
+      LogTime = #{row.logTime,jdbcType=TIMESTAMP},
+      FunctionCode = #{row.functionCode,jdbcType=VARCHAR},
+      FunctionName = #{row.functionName,jdbcType=VARCHAR}
     <if test="example != null">
     <if test="example != null">
       <include refid="Update_By_Example_Where_Clause" />
       <include refid="Update_By_Example_Where_Clause" />
     </if>
     </if>
@@ -213,6 +235,12 @@
       <if test="logTime != null">
       <if test="logTime != null">
         LogTime = #{logTime,jdbcType=TIMESTAMP},
         LogTime = #{logTime,jdbcType=TIMESTAMP},
       </if>
       </if>
+      <if test="functionCode != null">
+        FunctionCode = #{functionCode,jdbcType=VARCHAR},
+      </if>
+      <if test="functionName != null">
+        FunctionName = #{functionName,jdbcType=VARCHAR},
+      </if>
     </set>
     </set>
     where LogID = #{logID,jdbcType=VARCHAR}
     where LogID = #{logID,jdbcType=VARCHAR}
   </update>
   </update>
@@ -222,7 +250,9 @@
       PageUrl = #{pageUrl,jdbcType=VARCHAR},
       PageUrl = #{pageUrl,jdbcType=VARCHAR},
       ActionName = #{actionName,jdbcType=VARCHAR},
       ActionName = #{actionName,jdbcType=VARCHAR},
       UserID = #{userID,jdbcType=VARCHAR},
       UserID = #{userID,jdbcType=VARCHAR},
-      LogTime = #{logTime,jdbcType=TIMESTAMP}
+      LogTime = #{logTime,jdbcType=TIMESTAMP},
+      FunctionCode = #{functionCode,jdbcType=VARCHAR},
+      FunctionName = #{functionName,jdbcType=VARCHAR}
     where LogID = #{logID,jdbcType=VARCHAR}
     where LogID = #{logID,jdbcType=VARCHAR}
   </update>
   </update>
 </mapper>
 </mapper>

+ 2 - 1
src/main/resources/mapping/cquery/SysLogCQuery.xml

@@ -2,7 +2,8 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
 <mapper namespace="com.bowintek.smartsearch.mapper.cquery.SysLogCQuery">
 <mapper namespace="com.bowintek.smartsearch.mapper.cquery.SysLogCQuery">
     <select id="selectLogList" resultType="com.bowintek.smartsearch.vo.system.LogModel">
     <select id="selectLogList" resultType="com.bowintek.smartsearch.vo.system.LogModel">
-        select l.logID,l.pageUrl,l.actionName,l.userID,l.logTime,us.name as userName,us.loginID,l.pageName
+        select l.logID,l.pageUrl,l.actionName,l.userID,l.logTime,us.name as userName,us.loginID,l.pageName,
+        l.functionCode, l.functionName
         from sys_log l
         from sys_log l
         inner join sys_user us on l.userID = us.userID
         inner join sys_user us on l.userID = us.userID
         where 1=1
         where 1=1

+ 37 - 7
target/classes/mapping/SysLogMapper.xml

@@ -8,6 +8,8 @@
     <result column="ActionName" jdbcType="VARCHAR" property="actionName" />
     <result column="ActionName" jdbcType="VARCHAR" property="actionName" />
     <result column="UserID" jdbcType="VARCHAR" property="userID" />
     <result column="UserID" jdbcType="VARCHAR" property="userID" />
     <result column="LogTime" jdbcType="TIMESTAMP" property="logTime" />
     <result column="LogTime" jdbcType="TIMESTAMP" property="logTime" />
+    <result column="FunctionCode" jdbcType="VARCHAR" property="functionCode" />
+    <result column="FunctionName" jdbcType="VARCHAR" property="functionName" />
   </resultMap>
   </resultMap>
   <sql id="Example_Where_Clause">
   <sql id="Example_Where_Clause">
     <where>
     <where>
@@ -68,7 +70,7 @@
     </where>
     </where>
   </sql>
   </sql>
   <sql id="Base_Column_List">
   <sql id="Base_Column_List">
-    LogID, PageName, PageUrl, ActionName, UserID, LogTime
+    LogID, PageName, PageUrl, ActionName, UserID, LogTime, FunctionCode, FunctionName
   </sql>
   </sql>
   <select id="selectByExample" parameterType="com.bowintek.smartsearch.model.SysLogExample" resultMap="BaseResultMap">
   <select id="selectByExample" parameterType="com.bowintek.smartsearch.model.SysLogExample" resultMap="BaseResultMap">
     select
     select
@@ -102,11 +104,11 @@
   </delete>
   </delete>
   <insert id="insert" parameterType="com.bowintek.smartsearch.model.SysLog">
   <insert id="insert" parameterType="com.bowintek.smartsearch.model.SysLog">
     insert into sys_log (LogID, PageName, PageUrl, 
     insert into sys_log (LogID, PageName, PageUrl, 
-      ActionName, UserID, LogTime
-      )
+      ActionName, UserID, LogTime, 
+      FunctionCode, FunctionName)
     values (#{logID,jdbcType=VARCHAR}, #{pageName,jdbcType=VARCHAR}, #{pageUrl,jdbcType=VARCHAR}, 
     values (#{logID,jdbcType=VARCHAR}, #{pageName,jdbcType=VARCHAR}, #{pageUrl,jdbcType=VARCHAR}, 
-      #{actionName,jdbcType=VARCHAR}, #{userID,jdbcType=VARCHAR}, #{logTime,jdbcType=TIMESTAMP}
-      )
+      #{actionName,jdbcType=VARCHAR}, #{userID,jdbcType=VARCHAR}, #{logTime,jdbcType=TIMESTAMP}, 
+      #{functionCode,jdbcType=VARCHAR}, #{functionName,jdbcType=VARCHAR})
   </insert>
   </insert>
   <insert id="insertSelective" parameterType="com.bowintek.smartsearch.model.SysLog">
   <insert id="insertSelective" parameterType="com.bowintek.smartsearch.model.SysLog">
     insert into sys_log
     insert into sys_log
@@ -129,6 +131,12 @@
       <if test="logTime != null">
       <if test="logTime != null">
         LogTime,
         LogTime,
       </if>
       </if>
+      <if test="functionCode != null">
+        FunctionCode,
+      </if>
+      <if test="functionName != null">
+        FunctionName,
+      </if>
     </trim>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="logID != null">
       <if test="logID != null">
@@ -149,6 +157,12 @@
       <if test="logTime != null">
       <if test="logTime != null">
         #{logTime,jdbcType=TIMESTAMP},
         #{logTime,jdbcType=TIMESTAMP},
       </if>
       </if>
+      <if test="functionCode != null">
+        #{functionCode,jdbcType=VARCHAR},
+      </if>
+      <if test="functionName != null">
+        #{functionName,jdbcType=VARCHAR},
+      </if>
     </trim>
     </trim>
   </insert>
   </insert>
   <select id="countByExample" parameterType="com.bowintek.smartsearch.model.SysLogExample" resultType="java.lang.Long">
   <select id="countByExample" parameterType="com.bowintek.smartsearch.model.SysLogExample" resultType="java.lang.Long">
@@ -178,6 +192,12 @@
       <if test="row.logTime != null">
       <if test="row.logTime != null">
         LogTime = #{row.logTime,jdbcType=TIMESTAMP},
         LogTime = #{row.logTime,jdbcType=TIMESTAMP},
       </if>
       </if>
+      <if test="row.functionCode != null">
+        FunctionCode = #{row.functionCode,jdbcType=VARCHAR},
+      </if>
+      <if test="row.functionName != null">
+        FunctionName = #{row.functionName,jdbcType=VARCHAR},
+      </if>
     </set>
     </set>
     <if test="example != null">
     <if test="example != null">
       <include refid="Update_By_Example_Where_Clause" />
       <include refid="Update_By_Example_Where_Clause" />
@@ -190,7 +210,9 @@
       PageUrl = #{row.pageUrl,jdbcType=VARCHAR},
       PageUrl = #{row.pageUrl,jdbcType=VARCHAR},
       ActionName = #{row.actionName,jdbcType=VARCHAR},
       ActionName = #{row.actionName,jdbcType=VARCHAR},
       UserID = #{row.userID,jdbcType=VARCHAR},
       UserID = #{row.userID,jdbcType=VARCHAR},
-      LogTime = #{row.logTime,jdbcType=TIMESTAMP}
+      LogTime = #{row.logTime,jdbcType=TIMESTAMP},
+      FunctionCode = #{row.functionCode,jdbcType=VARCHAR},
+      FunctionName = #{row.functionName,jdbcType=VARCHAR}
     <if test="example != null">
     <if test="example != null">
       <include refid="Update_By_Example_Where_Clause" />
       <include refid="Update_By_Example_Where_Clause" />
     </if>
     </if>
@@ -213,6 +235,12 @@
       <if test="logTime != null">
       <if test="logTime != null">
         LogTime = #{logTime,jdbcType=TIMESTAMP},
         LogTime = #{logTime,jdbcType=TIMESTAMP},
       </if>
       </if>
+      <if test="functionCode != null">
+        FunctionCode = #{functionCode,jdbcType=VARCHAR},
+      </if>
+      <if test="functionName != null">
+        FunctionName = #{functionName,jdbcType=VARCHAR},
+      </if>
     </set>
     </set>
     where LogID = #{logID,jdbcType=VARCHAR}
     where LogID = #{logID,jdbcType=VARCHAR}
   </update>
   </update>
@@ -222,7 +250,9 @@
       PageUrl = #{pageUrl,jdbcType=VARCHAR},
       PageUrl = #{pageUrl,jdbcType=VARCHAR},
       ActionName = #{actionName,jdbcType=VARCHAR},
       ActionName = #{actionName,jdbcType=VARCHAR},
       UserID = #{userID,jdbcType=VARCHAR},
       UserID = #{userID,jdbcType=VARCHAR},
-      LogTime = #{logTime,jdbcType=TIMESTAMP}
+      LogTime = #{logTime,jdbcType=TIMESTAMP},
+      FunctionCode = #{functionCode,jdbcType=VARCHAR},
+      FunctionName = #{functionName,jdbcType=VARCHAR}
     where LogID = #{logID,jdbcType=VARCHAR}
     where LogID = #{logID,jdbcType=VARCHAR}
   </update>
   </update>
 </mapper>
 </mapper>

+ 2 - 1
target/classes/mapping/cquery/SysLogCQuery.xml

@@ -2,7 +2,8 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
 <mapper namespace="com.bowintek.smartsearch.mapper.cquery.SysLogCQuery">
 <mapper namespace="com.bowintek.smartsearch.mapper.cquery.SysLogCQuery">
     <select id="selectLogList" resultType="com.bowintek.smartsearch.vo.system.LogModel">
     <select id="selectLogList" resultType="com.bowintek.smartsearch.vo.system.LogModel">
-        select l.logID,l.pageUrl,l.actionName,l.userID,l.logTime,us.name as userName,us.loginID,l.pageName
+        select l.logID,l.pageUrl,l.actionName,l.userID,l.logTime,us.name as userName,us.loginID,l.pageName,
+        l.functionCode, l.functionName
         from sys_log l
         from sys_log l
         inner join sys_user us on l.userID = us.userID
         inner join sys_user us on l.userID = us.userID
         where 1=1
         where 1=1

+ 16 - 0
vue/src/api/system/log/index.ts

@@ -58,3 +58,19 @@ export function save(title: string, url: string, actionName: string) {
     },
     },
   );
   );
 }
 }
+
+
+export function save2(title: string, url: string, actionName: string, functionCode: string, functionName: string) {
+  return request<object>(
+    {
+      url: 'system/log/save2',
+      method: 'post',
+      data: {pageName: title, pageUrl: url, actionName: actionName, functionCode: functionCode, functionName: functionName},
+    },
+    {
+      isNew: true,
+      successMsg: '',
+      errorMsg: ''
+    },
+  );
+}

+ 16 - 1
vue/src/components/basic/button/button.vue

@@ -5,6 +5,7 @@
     :type="buttonType"
     :type="buttonType"
     :class="[`ant-btn-${type}`]"
     :class="[`ant-btn-${type}`]"
     v-if="isPerms"
     v-if="isPerms"
+    @click="operationRcord"
   >
   >
     <template v-for="(_, key) in $slots" #[key]>
     <template v-for="(_, key) in $slots" #[key]>
       <slot :name="key"></slot>
       <slot :name="key"></slot>
@@ -18,6 +19,8 @@
   import type { PropType, ComputedRef } from 'vue';
   import type { PropType, ComputedRef } from 'vue';
   import type { ButtonType as AButtonType } from 'ant-design-vue/es/button';
   import type { ButtonType as AButtonType } from 'ant-design-vue/es/button';
   import {useUserStore} from "@/store/modules/user";
   import {useUserStore} from "@/store/modules/user";
+  import {save2} from "@/api/system/log/index";
+
 
 
   const props = defineProps({
   const props = defineProps({
     ...buttonProps(),
     ...buttonProps(),
@@ -42,7 +45,19 @@
   }) as ComputedRef<AButtonType>;
   }) as ComputedRef<AButtonType>;
 
 
   const perms = useUserStore().perms;
   const perms = useUserStore().perms;
-  const isPerms = props.functioncode!='' ? perms!=null && perms.length>0 && perms.indexOf(props.functioncode)>=0:true;
+  const isPerms = props.functioncode!='' && props.functioncode!='-1' ? perms!=null && perms.length>0 && perms.indexOf(props.functioncode)>=0:true;
+
+  const operationRcord = (event: any)=>{
+    console.log(event.target.textContent)
+    if(props.functioncode=='')
+      return false;
+
+    let currentMenu = localStorage.getItem("currentMenu");
+    if (currentMenu != null) {
+      const menu: any = JSON.parse(currentMenu);
+      save2(menu.pageName, menu.pageUrl, '点击按钮', props.functioncode, event.target.textContent)
+    }
+  }
 </script>
 </script>
 
 
 <style lang="less" scoped>
 <style lang="less" scoped>

+ 1 - 1
vue/src/components/basic/excel/exportExcel/exportExcel.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <a-button type="primary" @click="exportData">{{ exportLoad ? "正在导出..." : title }}</a-button>
+  <a-button type="primary" functioncode="-1" @click="exportData">{{ exportLoad ? "正在导出..." : title }}</a-button>
 </template>
 </template>
 <script lang="ts">
 <script lang="ts">
 import {defineComponent, ref} from "vue";
 import {defineComponent, ref} from "vue";

+ 1 - 2
vue/src/components/basic/file-preview/index.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
   <a-spin tip="" size="small" :spinning="spinning">
   <a-spin tip="" size="small" :spinning="spinning">
-    <a-button type="link" size="small" @click="loadFile">预览</a-button>
+    <a-button functioncode="-1"  type="link" size="small" @click="loadFile">预览</a-button>
   </a-spin>
   </a-spin>
   <a-modal :visible="visible" :ok-button-props="{ style: { display: 'none' } }"
   <a-modal :visible="visible" :ok-button-props="{ style: { display: 'none' } }"
            wrap-class-name="full-modal" style="text-align: center" :title="title"
            wrap-class-name="full-modal" style="text-align: center" :title="title"
@@ -71,7 +71,6 @@ export default defineComponent({
         fileName: fileName,
         fileName: fileName,
         filePath: filePath
         filePath: filePath
       }, "获取文件失败!").then(res => {
       }, "获取文件失败!").then(res => {
-        debugger
         let fileReader = new FileReader()
         let fileReader = new FileReader()
         fileReader.readAsArrayBuffer(res.data);
         fileReader.readAsArrayBuffer(res.data);
         fileReader.onload = () => {
         fileReader.onload = () => {

+ 1 - 0
vue/src/layout/menu/menu.vue

@@ -112,6 +112,7 @@
 
 
     if(item.menuname){
     if(item.menuname){
       save(item.menuname,key,"点击菜单");
       save(item.menuname,key,"点击菜单");
+      localStorage.setItem("currentMenu", JSON.stringify({pageName: item.menuname,	pageUrl: key}));
     }
     }
   };
   };
 </script>
 </script>

+ 4 - 0
vue/src/layout/tabs/tabs-view.vue

@@ -196,6 +196,10 @@ const editTabItem = (targetKey, action: string) => {
 };
 };
 // 切换页面
 // 切换页面
 const changePage = (key) => {
 const changePage = (key) => {
+  const tabs: any = tabsList.value.find((item) => item.fullPath == key);
+  if(tabs){
+    localStorage.setItem("currentMenu", JSON.stringify({pageName: tabs.meta.title,	pageUrl: tabs.fullPath}));
+  }
   Object.is(route.fullPath, key) || router.push(key);
   Object.is(route.fullPath, key) || router.push(key);
 };
 };
 
 

+ 2 - 2
vue/src/views/applyform/apply.vue

@@ -39,7 +39,7 @@
                bordered>
                bordered>
         <template #bodyCell="{ column,record }">
         <template #bodyCell="{ column,record }">
           <template v-if="column.key === 'operation'">
           <template v-if="column.key === 'operation'">
-            <a-button type="link" size="small" @click="showFile(record.applyId)">查看文件
+            <a-button type="link" size="small" functioncode="-1" @click="showFile(record.applyId)">查看文件
             </a-button>
             </a-button>
           </template>
           </template>
         </template>
         </template>
@@ -52,7 +52,7 @@
             <a-list-item>
             <a-list-item>
               <template #actions>
               <template #actions>
                 <filePreview :fileName="item.file_name" :filePath="item.storage_path"  :title="item.well_common_name"></filePreview>
                 <filePreview :fileName="item.file_name" :filePath="item.storage_path"  :title="item.well_common_name"></filePreview>
-                <a-button type="link" @click="downFile(item)" v-if="item.status==2" danger>下载</a-button>
+                <a-button functioncode="-1"  type="link" @click="downFile(item)" v-if="item.status==2" danger>下载</a-button>
               </template>
               </template>
               <a-list-item-meta
               <a-list-item-meta
                 :description="item.file_business_type">
                 :description="item.file_business_type">

+ 3 - 3
vue/src/views/applyform/reviewer.vue

@@ -39,11 +39,11 @@
                bordered>
                bordered>
         <template #bodyCell="{ column,record }">
         <template #bodyCell="{ column,record }">
           <template v-if="column.key === 'operation'">
           <template v-if="column.key === 'operation'">
-            <a-button type="link" size="small" @click="approve(record)" v-if="record.status==1">处理
+            <a-button type="link" functioncode="-1" size="small" @click="approve(record)" v-if="record.status==1">处理
             </a-button>
             </a-button>
           </template>
           </template>
           <template v-if="column.key === 'files'">
           <template v-if="column.key === 'files'">
-            <a-button type="link" size="small" @click="showFile(record.applyId)">查看
+            <a-button type="link" functioncode="-1" size="small" @click="showFile(record.applyId)">查看
             </a-button>
             </a-button>
           </template>
           </template>
         </template>
         </template>
@@ -56,7 +56,7 @@
             <a-list-item>
             <a-list-item>
               <template #actions>
               <template #actions>
                 <filePreview :fileName="item.file_name" :filePath="item.storage_path" :title="item.well_common_name"></filePreview>
                 <filePreview :fileName="item.file_name" :filePath="item.storage_path" :title="item.well_common_name"></filePreview>
-                <a-button type="link" @click="downFile(item)" danger>下载</a-button>
+                <a-button type="link" functioncode="-1" @click="downFile(item)" danger>下载</a-button>
               </template>
               </template>
               <a-list-item-meta
               <a-list-item-meta
                 :description="item.file_business_type">
                 :description="item.file_business_type">

+ 4 - 4
vue/src/views/esindex/edit.vue

@@ -42,7 +42,7 @@
               <Space>
               <Space>
                 <BImportExcel :options="importOptions" @success="onImportSuccess"></BImportExcel>
                 <BImportExcel :options="importOptions" @success="onImportSuccess"></BImportExcel>
                 &nbsp;
                 &nbsp;
-                <a-button @click="add()">
+                <a-button functioncode="-1" @click="add()">
                   <template #icon>
                   <template #icon>
                     <plus-circle-outlined/>
                     <plus-circle-outlined/>
                   </template>
                   </template>
@@ -59,11 +59,11 @@
                      :rowClassName="record => record.childFields&&record.childFields.length>0?'': 'noExpand'">
                      :rowClassName="record => record.childFields&&record.childFields.length>0?'': 'noExpand'">
               <template #bodyCell="{ column ,record,index}">
               <template #bodyCell="{ column ,record,index}">
                 <template v-if="column.key === 'operation'">
                 <template v-if="column.key === 'operation'">
-                  <a-button type="link" size="small" @click="edit(record)">修改</a-button>
+                  <a-button type="link" functioncode="-1" size="small" @click="edit(record)">修改</a-button>
                   <a-popconfirm placement="leftTop"
                   <a-popconfirm placement="leftTop"
                                 title="是否删除数据?"
                                 title="是否删除数据?"
                                 @confirm="onDelete(index)">
                                 @confirm="onDelete(index)">
-                    <a-button type="link" size="small">删除</a-button>
+                    <a-button type="link" functioncode="-1" size="small">删除</a-button>
                   </a-popconfirm>
                   </a-popconfirm>
                 </template>
                 </template>
               </template>
               </template>
@@ -79,7 +79,7 @@
             <Space>
             <Space>
               <a-form-item class="buttom-btns">
               <a-form-item class="buttom-btns">
                 <a-button @click="onClose">取消</a-button>
                 <a-button @click="onClose">取消</a-button>
-                <a-button type="primary" html-type="submit">提交</a-button>
+                <a-button  functioncode="-1" type="primary" html-type="submit">提交</a-button>
               </a-form-item>
               </a-form-item>
             </Space>
             </Space>
           </a-col>
           </a-col>

+ 4 - 4
vue/src/views/esindex/fieldedit.vue

@@ -78,7 +78,7 @@
               <Space>
               <Space>
                 <BImportExcel :options="importOptions" @success="onImportSuccess"></BImportExcel>
                 <BImportExcel :options="importOptions" @success="onImportSuccess"></BImportExcel>
                 &nbsp;
                 &nbsp;
-                <a-button @click="add()">
+                <a-button functioncode="-1" @click="add()">
                   <template #icon>
                   <template #icon>
                     <plus-circle-outlined/>
                     <plus-circle-outlined/>
                   </template>
                   </template>
@@ -95,11 +95,11 @@
                      bordered>
                      bordered>
               <template #bodyCell="{ column ,record,index}">
               <template #bodyCell="{ column ,record,index}">
                 <template v-if="column.key === 'operation'">
                 <template v-if="column.key === 'operation'">
-                  <a-button type="link" size="small" @click="edit(record)">修改</a-button>
+                  <a-button functioncode="-1" type="link" size="small" @click="edit(record)">修改</a-button>
                   <a-popconfirm placement="leftTop"
                   <a-popconfirm placement="leftTop"
                                 title="是否删除数据?"
                                 title="是否删除数据?"
                                 @confirm="onDelete(index)">
                                 @confirm="onDelete(index)">
-                    <a-button type="link" size="small">删除</a-button>
+                    <a-button type="link" functioncode="-1" size="small">删除</a-button>
                   </a-popconfirm>
                   </a-popconfirm>
                 </template>
                 </template>
               </template>
               </template>
@@ -110,7 +110,7 @@
       <a-row style="height: 20px"></a-row>
       <a-row style="height: 20px"></a-row>
       <a-row type="flex">
       <a-row type="flex">
         <a-col :span="24" style="text-align: right;margin-right: 20px;">
         <a-col :span="24" style="text-align: right;margin-right: 20px;">
-          <a-button type="primary" html-type="submit">提交</a-button>
+          <a-button type="primary" functioncode="-1" html-type="submit">提交</a-button>
         </a-col>
         </a-col>
       </a-row>
       </a-row>
     </Form>
     </Form>

+ 1 - 1
vue/src/views/query/index.vue

@@ -66,7 +66,7 @@
             </a-col>
             </a-col>
             <a-col :span="6" style="text-align: left">
             <a-col :span="6" style="text-align: left">
               <a-button type="primary" html-type="submit" @click="getQuery">查询预览</a-button>
               <a-button type="primary" html-type="submit" @click="getQuery">查询预览</a-button>
-              <a-button html-type="submit" @click="onFinish" style="margin-left: 10px;">保存模板</a-button>
+              <a-button functioncode="-1" html-type="submit" @click="onFinish" style="margin-left: 10px;">保存模板</a-button>
             </a-col>
             </a-col>
             <a-col :span="18">
             <a-col :span="18">
               <a-form-item name="remark">
               <a-form-item name="remark">

+ 1 - 1
vue/src/views/subject/edit.vue

@@ -61,7 +61,7 @@
               <Space>
               <Space>
                 <BImportExcel :options="importOptions" @success="onImportSuccess"></BImportExcel>
                 <BImportExcel :options="importOptions" @success="onImportSuccess"></BImportExcel>
                 &nbsp;
                 &nbsp;
-                <a-button @click="add()">
+                <a-button functioncode="-1" @click="add()">
                   <template #icon>
                   <template #icon>
                     <plus-circle-outlined/>
                     <plus-circle-outlined/>
                   </template>
                   </template>

+ 1 - 0
vue/src/views/system/log/index.vue

@@ -81,6 +81,7 @@ export default defineComponent({
       {title: '登录账号', dataIndex: 'loginID', key: 'loginID'},
       {title: '登录账号', dataIndex: 'loginID', key: 'loginID'},
       {title: '姓名', dataIndex: 'userName', key: 'userName',align:"center"},
       {title: '姓名', dataIndex: 'userName', key: 'userName',align:"center"},
       {title: '操作页面', dataIndex: 'pageName', key: 'pageName',align:"center"},
       {title: '操作页面', dataIndex: 'pageName', key: 'pageName',align:"center"},
+      {title: '点击按钮', dataIndex: 'functionName', key: 'functionName',align:"center"},
       {
       {
         title: '操作时间',
         title: '操作时间',
         dataIndex: 'logTime',
         dataIndex: 'logTime',

+ 1 - 2
vue/src/views/wellinfo/index.vue

@@ -356,7 +356,7 @@
               <template #actions>
               <template #actions>
                 <PlusOutlined v-if="!item.isApply" @click="onAddCart(item)" title="加入购物车"
                 <PlusOutlined v-if="!item.isApply" @click="onAddCart(item)" title="加入购物车"
                               :style="{fontSize: '16px', color: '#08c'}"/>
                               :style="{fontSize: '16px', color: '#08c'}"/>
-                <a-button type="link" @click="downFile(item)" v-if="item.isDown" danger>下载</a-button>
+                <a-button functioncode="-1" type="link" @click="downFile(item)" v-if="item.isDown" danger>下载</a-button>
                 <filePreview :fileName="item.file_name" :filePath="item.storage_path" :title="item.well_common_name"></filePreview>
                 <filePreview :fileName="item.file_name" :filePath="item.storage_path" :title="item.well_common_name"></filePreview>
               </template>
               </template>
               <a-list-item-meta
               <a-list-item-meta
@@ -829,7 +829,6 @@ export default defineComponent({
       subjectTrees.value.autoExpandParent = false;
       subjectTrees.value.autoExpandParent = false;
     }
     }
     const treeOnSelect = function (selected, selectedNodes, node) {
     const treeOnSelect = function (selected, selectedNodes, node) {
-      debugger;
       console.log(selected, selectedNodes, node);
       console.log(selected, selectedNodes, node);
       //组织机构
       //组织机构
       if (activeTab.value == "1") {
       if (activeTab.value == "1") {