src/main/java/com/whyc/mapper/UserLogMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/pojo/UserLog.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/service/UserLogService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/util/CommonUtil.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/util/FaceIdentifyUtil.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/mapper/UserLogMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/whyc/mapper/UserLogMapper.java
@@ -2,5 +2,10 @@ import com.whyc.pojo.UserLog; import java.util.List; public interface UserLogMapper extends CustomMapper<UserLog> { List<UserLog> getList(UserLog userLog); } src/main/java/com/whyc/pojo/UserLog.java
@@ -32,6 +32,8 @@ private Date operationTime2; @TableField(exist = false) private String operationTypeStr; @TableField(exist = false) private String uName; public String getOperationTypeStr() { return operationTypeStr; @@ -104,4 +106,12 @@ public void setOperationDetail(String operationDetail) { this.operationDetail = operationDetail; } public String getUName() { return uName; } public void setUName(String uName) { this.uName = uName; } } src/main/java/com/whyc/service/UserLogService.java
@@ -25,18 +25,10 @@ @Resource private UserLogMapper mapper; public PageInfo<UserLog> getPage(int pageNum, int pageSize, UserLog userLog) { QueryWrapper<UserLog> wrapper = Wrappers.query(); if(userLog.getUId()!=null){ wrapper.eq("uId",userLog.getUId()); } if(userLog.getOperationType()!=null){ wrapper.eq("uOprateType",userLog.getOperationType()); } wrapper.between("uOprateDay",userLog.getOperationTime(),userLog.getOperationTime2()); public PageInfo<UserLog>getPage(int pageNum, int pageSize, UserLog userLog) { PageHelper.startPage(pageNum,pageSize,true); List<UserLog> userLogList = mapper.selectList(wrapper); //List<UserLog> userLogList = mapper.selectList(wrapper); List<UserLog> userLogList = mapper.getList(userLog); userLogList.stream().forEach(userLog1 -> { switch (userLog1.getOperationType()){ case 1: userLog1.setOperationTypeStr(UserOperation.TYPE_LOGIN.getTypeName());break; src/main/java/com/whyc/util/CommonUtil.java
@@ -1,8 +1,10 @@ package com.whyc.util; import com.whyc.pojo.UserInf; import org.springframework.boot.system.ApplicationHome; import javax.servlet.http.HttpServletRequest; import java.io.File; /** * 通用工具列 @@ -13,4 +15,10 @@ public static UserInf getUser(HttpServletRequest request) { return (UserInf) request.getSession().getAttribute("user"); } public static String classesPath(){ ApplicationHome applicationHome = new ApplicationHome(CommonUtil.class); File jarFile = applicationHome.getDir(); return jarFile.toString(); } } src/main/java/com/whyc/util/FaceIdentifyUtil.java
@@ -41,14 +41,15 @@ String appId4Linux =YamlProperties.appId4Linux; String sdkKey4Linux =YamlProperties.sdkKey4Linux; String realPath = ActionUtil.getApplication().getRealPath("/"); //String realPath = ActionUtil.getApplication().getRealPath("/"); String realPath = CommonUtil.classesPath(); System.out.println("========realPath=========:"+realPath); System.out.println("========faceEngine dll 路径=========:"+realPath+ File.separator+"WEB-INF"+File.separator+"lib"+File.separator+"WIN64"); System.out.println("========faceEngine dll 路径=========:"+realPath+ File.separator+"lib"+File.separator+"WIN64"); //判断是什么系统 if(System.getProperty("os.name").toLowerCase().contains("window")){ appId=appId4Win; sdkKey=sdkKey4Win; faceEngine = new FaceEngine(realPath+ File.separator+"WEB-INF"+File.separator+"lib"+File.separator+"WIN64"); faceEngine = new FaceEngine(realPath+ File.separator+"lib"+File.separator+"WIN64"); }else{ @@ -70,11 +71,11 @@ /**初始化*/ public static FaceEngine init(){ FaceEngine faceEngine=null; String realPath = ActionUtil.getApplication().getRealPath("/"); String realPath = CommonUtil.classesPath(); if(System.getProperty("os.name").toLowerCase().contains("window")) { faceEngine = new FaceEngine(realPath + File.separator + "WEB-INF" + File.separator + "lib" + File.separator + "WIN64"); faceEngine = new FaceEngine(realPath + File.separator + "lib" + File.separator + "WIN64"); }else{ faceEngine = new FaceEngine(realPath + File.separator + "WEB-INF" + File.separator + "lib" + File.separator + "LINUX64"); faceEngine = new FaceEngine(realPath + File.separator + "lib" + File.separator + "LINUX64"); } //引擎配置 EngineConfiguration engineConfiguration = new EngineConfiguration(); src/main/resources/mapper/UserLogMapper.xml
New file @@ -0,0 +1,26 @@ <?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.whyc.mapper.UserLogMapper" > <resultMap id="Map_UserLog" type="UserLog"> <id property="num" column="num"/> <result property="uId" column="uId"/> <result property="operationType" column="uOprateType"/> <result property="operationTime" column="uOprateDay"/> <result property="terminalIp" column="uTerminalIp"/> <result property="operationMsg" column="uOprateMsg"/> <result property="operationDetail" column="operation_detail"/> <result property="uName" column="uName"/> </resultMap> <select id="getList" resultMap="Map_UserLog"> select l.*,u.uName from db_user.tb_user_log l,db_user.tb_user_inf u where l.uId = u.uId and uOprateDay between #{operationTime} and #{operationTime2} <if test="uId !=null"> and l.uId = #{uId} </if> <if test="operationType !=null"> and l.uOprateType = #{operationType} </if> </select> </mapper>