优化日志查询接口
This commit is contained in:
@@ -11,7 +11,7 @@ public interface LogMapperEx {
|
||||
|
||||
List<LogVo4List> selectByConditionLog(
|
||||
@Param("operation") String operation,
|
||||
@Param("userId") Integer userId,
|
||||
@Param("userInfo") String userInfo,
|
||||
@Param("clientIp") String clientIp,
|
||||
@Param("status") Integer status,
|
||||
@Param("beginTime") String beginTime,
|
||||
@@ -22,7 +22,7 @@ public interface LogMapperEx {
|
||||
|
||||
Long countsByLog(
|
||||
@Param("operation") String operation,
|
||||
@Param("userId") Integer userId,
|
||||
@Param("userInfo") String userInfo,
|
||||
@Param("clientIp") String clientIp,
|
||||
@Param("status") Integer status,
|
||||
@Param("beginTime") String beginTime,
|
||||
|
||||
@@ -4,10 +4,20 @@ import com.jsh.erp.datasource.entities.Log;
|
||||
|
||||
public class LogVo4List extends Log {
|
||||
|
||||
private String loginName;
|
||||
|
||||
private String userName;
|
||||
|
||||
private String createTimeStr;
|
||||
|
||||
public String getLoginName() {
|
||||
return loginName;
|
||||
}
|
||||
|
||||
public void setLoginName(String loginName) {
|
||||
this.loginName = loginName;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
@@ -32,13 +32,13 @@ public class LogComponent implements ICommonQuery {
|
||||
private List<?> getLogList(Map<String, String> map)throws Exception {
|
||||
String search = map.get(Constants.SEARCH);
|
||||
String operation = StringUtil.getInfo(search, "operation");
|
||||
Integer userId = StringUtil.parseInteger(StringUtil.getInfo(search, "userId"));
|
||||
String userInfo = StringUtil.getInfo(search, "userInfo");
|
||||
String clientIp = StringUtil.getInfo(search, "clientIp");
|
||||
Integer status = StringUtil.parseInteger(StringUtil.getInfo(search, "status"));
|
||||
String beginTime = StringUtil.getInfo(search, "beginTime");
|
||||
String endTime = StringUtil.getInfo(search, "endTime");
|
||||
String content = StringUtil.getInfo(search, "content");
|
||||
return logService.select(operation, userId, clientIp, status, beginTime, endTime, content,
|
||||
return logService.select(operation, userInfo, clientIp, status, beginTime, endTime, content,
|
||||
QueryUtils.offset(map), QueryUtils.rows(map));
|
||||
}
|
||||
|
||||
@@ -46,13 +46,13 @@ public class LogComponent implements ICommonQuery {
|
||||
public Long counts(Map<String, String> map)throws Exception {
|
||||
String search = map.get(Constants.SEARCH);
|
||||
String operation = StringUtil.getInfo(search, "operation");
|
||||
Integer userId = StringUtil.parseInteger(StringUtil.getInfo(search, "userId"));
|
||||
String userInfo = StringUtil.getInfo(search, "userInfo");
|
||||
String clientIp = StringUtil.getInfo(search, "clientIp");
|
||||
Integer status = StringUtil.parseInteger(StringUtil.getInfo(search, "status"));
|
||||
String beginTime = StringUtil.getInfo(search, "beginTime");
|
||||
String endTime = StringUtil.getInfo(search, "endTime");
|
||||
String content = StringUtil.getInfo(search, "content");
|
||||
return logService.countLog(operation, userId, clientIp, status, beginTime, endTime, content);
|
||||
return logService.countLog(operation, userInfo, clientIp, status, beginTime, endTime, content);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -63,13 +63,13 @@ public class LogService {
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<LogVo4List> select(String operation, Integer userId, String clientIp, Integer status, String beginTime, String endTime,
|
||||
public List<LogVo4List> select(String operation, String userInfo, String clientIp, Integer status, String beginTime, String endTime,
|
||||
String content, int offset, int rows)throws Exception {
|
||||
List<LogVo4List> list=null;
|
||||
try{
|
||||
beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME);
|
||||
endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME);
|
||||
list=logMapperEx.selectByConditionLog(operation, userId, clientIp, status, beginTime, endTime,
|
||||
list=logMapperEx.selectByConditionLog(operation, userInfo, clientIp, status, beginTime, endTime,
|
||||
content, offset, rows);
|
||||
if (null != list) {
|
||||
for (LogVo4List log : list) {
|
||||
@@ -82,13 +82,13 @@ public class LogService {
|
||||
return list;
|
||||
}
|
||||
|
||||
public Long countLog(String operation, Integer userId, String clientIp, Integer status, String beginTime, String endTime,
|
||||
public Long countLog(String operation, String userInfo, String clientIp, Integer status, String beginTime, String endTime,
|
||||
String content)throws Exception {
|
||||
Long result=null;
|
||||
try{
|
||||
beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME);
|
||||
endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME);
|
||||
result=logMapperEx.countsByLog(operation, userId, clientIp, status, beginTime, endTime, content);
|
||||
result=logMapperEx.countsByLog(operation, userInfo, clientIp, status, beginTime, endTime, content);
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user