|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
package com.engine.salary.elog.service.impl;
|
|
|
|
|
package com.engine.hrmelog.service.impl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
@ -7,21 +7,22 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.cloudstore.eccom.pc.table.WeaTable;
|
|
|
|
|
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
|
|
|
|
import com.engine.core.impl.Service;
|
|
|
|
|
import com.engine.salary.elog.annotation.OperateType;
|
|
|
|
|
import com.engine.salary.elog.entity.dto.ElogBean;
|
|
|
|
|
import com.engine.salary.elog.entity.dto.FilterConditionDto;
|
|
|
|
|
import com.engine.salary.elog.entity.dto.LoggerContext;
|
|
|
|
|
import com.engine.salary.elog.entity.dto.ShowColumsDto;
|
|
|
|
|
import com.engine.salary.elog.entity.param.ELogGetLogParam;
|
|
|
|
|
import com.engine.salary.elog.entity.param.GetDetailChangesParam;
|
|
|
|
|
import com.engine.salary.elog.enums.ElogConsts;
|
|
|
|
|
import com.engine.salary.elog.service.ILoggerTableService;
|
|
|
|
|
import com.engine.salary.elog.util.*;
|
|
|
|
|
import com.engine.salary.elog.util.db.MapperProxyFactory;
|
|
|
|
|
import com.engine.salary.elog.util.page.Column;
|
|
|
|
|
import com.engine.salary.elog.util.page.PageInfo;
|
|
|
|
|
import com.engine.salary.elog.util.page.SalaryPageUtil;
|
|
|
|
|
import com.engine.salary.mapper.elog.LocalElogDaoMapper;
|
|
|
|
|
import com.engine.hrmelog.annotation.OperateType;
|
|
|
|
|
import com.engine.hrmelog.entity.dto.ElogBean;
|
|
|
|
|
import com.engine.hrmelog.entity.dto.FilterConditionDto;
|
|
|
|
|
import com.engine.hrmelog.entity.dto.LoggerContext;
|
|
|
|
|
import com.engine.hrmelog.entity.dto.ShowColumsDto;
|
|
|
|
|
import com.engine.hrmelog.entity.param.ELogGetLogParam;
|
|
|
|
|
import com.engine.hrmelog.entity.param.GetDetailChangesParam;
|
|
|
|
|
import com.engine.hrmelog.enums.ElogConsts;
|
|
|
|
|
import com.engine.hrmelog.util.ElogSeviceUtils;
|
|
|
|
|
import com.engine.hrmelog.util.I18nUtil;
|
|
|
|
|
import com.engine.hrmelog.util.page.Column;
|
|
|
|
|
import com.engine.hrmelog.util.page.PageUtil;
|
|
|
|
|
import com.engine.hrmelog.service.ILoggerTableService;
|
|
|
|
|
import com.engine.hrmelog.util.db.MapperProxyFactory;
|
|
|
|
|
import com.engine.hrmelog.util.page.PageInfo;
|
|
|
|
|
import com.engine.hrmelog.mapper.LocalElogDaoMapper;
|
|
|
|
|
import com.github.pagehelper.Page;
|
|
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
@ -70,7 +71,7 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
@Override
|
|
|
|
|
public PageInfo queryLogs(String data) {
|
|
|
|
|
//解析数据
|
|
|
|
|
ElogBean elogBean = ElogServiceUtils.getElogBean(data);
|
|
|
|
|
ElogBean elogBean = com.engine.hrmelog.util.ElogServiceUtils.getElogBean(data);
|
|
|
|
|
// columIndex统一转为小写
|
|
|
|
|
Optional.ofNullable(elogBean.getShowColumns())
|
|
|
|
|
.ifPresent(list -> {
|
|
|
|
@ -81,27 +82,27 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
List<ShowColumsDto> showColums = elogBean.getShowColumns();
|
|
|
|
|
List<com.engine.hrmelog.entity.dto.ShowColumsDto> showColums = elogBean.getShowColumns();
|
|
|
|
|
String module = elogBean.getModule();
|
|
|
|
|
String function = elogBean.getFunction();
|
|
|
|
|
String searchMap = elogBean.getSearchMap();
|
|
|
|
|
String pageSize = elogBean.getPageSize();
|
|
|
|
|
String pageNum = elogBean.getCurrent();
|
|
|
|
|
String downloadSize = elogBean.getDownloadSize();
|
|
|
|
|
List<FilterConditionDto> filterConditionDtos = elogBean.getFilterConditionDtos();
|
|
|
|
|
List<com.engine.hrmelog.entity.dto.FilterConditionDto> filterConditionDtos = elogBean.getFilterConditionDtos();
|
|
|
|
|
String transMethod = elogBean.getTransMethod();
|
|
|
|
|
Map authParamsJson = elogBean.getAuthParamsJson();
|
|
|
|
|
|
|
|
|
|
//获取 context 数据
|
|
|
|
|
LoggerContext context = new LoggerContext();
|
|
|
|
|
com.engine.hrmelog.entity.dto.LoggerContext context = new com.engine.hrmelog.entity.dto.LoggerContext();
|
|
|
|
|
context.setModuleName(module);
|
|
|
|
|
context.setFunctionName(function);
|
|
|
|
|
context.setTenant_key(getTenantKey());
|
|
|
|
|
// context.setOperator(getEmployeeId());
|
|
|
|
|
//获取主表
|
|
|
|
|
String tableName = ElogSeviceUtils.getTableName(module, function);
|
|
|
|
|
String tableName = com.engine.hrmelog.util.ElogSeviceUtils.getTableName(module, function);
|
|
|
|
|
//获取weaTable
|
|
|
|
|
List<Column> columns = getWeaColumns(data, showColums, module, function);
|
|
|
|
|
List<com.engine.hrmelog.util.page.Column> columns = getWeaColumns(data, showColums, module, function);
|
|
|
|
|
//获取条件sql
|
|
|
|
|
String searchMapsql = getSearchMapSql(searchMap, module, function, elogBean.getShowColumns());
|
|
|
|
|
String sb = getQueryCondition(filterConditionDtos);
|
|
|
|
@ -111,9 +112,9 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
// 分页
|
|
|
|
|
Page page = null;
|
|
|
|
|
if (StringUtils.isEmpty(downloadSize)) {
|
|
|
|
|
page = new Page(ElogSeviceUtils.getIntValue(pageNum, 1), ElogSeviceUtils.getIntValue(pageSize, 10));
|
|
|
|
|
page = new Page(com.engine.hrmelog.util.ElogSeviceUtils.getIntValue(pageNum, 1), com.engine.hrmelog.util.ElogSeviceUtils.getIntValue(pageSize, 10));
|
|
|
|
|
} else {
|
|
|
|
|
int pagesize = ElogSeviceUtils.getIntValue(downloadSize, 5000);
|
|
|
|
|
int pagesize = com.engine.hrmelog.util.ElogSeviceUtils.getIntValue(downloadSize, 5000);
|
|
|
|
|
page = new Page(1, pagesize);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -132,15 +133,15 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//处理转换其他数据库类型值
|
|
|
|
|
list = ElogSeviceSwitchUtils.getSwitchDatabaseData(list);
|
|
|
|
|
list = com.engine.hrmelog.util.ElogSeviceSwitchUtils.getSwitchDatabaseData(list);
|
|
|
|
|
//处理用户信息Data
|
|
|
|
|
|
|
|
|
|
// 大小写转换
|
|
|
|
|
ElogSeviceSwitchUtils.changKey2Lower(list);
|
|
|
|
|
com.engine.hrmelog.util.ElogSeviceSwitchUtils.changKey2Lower(list);
|
|
|
|
|
|
|
|
|
|
// 存放结果集
|
|
|
|
|
PageInfo pageInfo = SalaryPageUtil.buildPage(page.getPageNum(), page.getPageSize(), switchString(list));
|
|
|
|
|
pageInfo.setTotal(ElogSeviceUtils.getLongValue(countMap.get("counts") + "", 0));
|
|
|
|
|
PageInfo pageInfo = PageUtil.buildPage(page.getPageNum(), page.getPageSize(), switchString(list));
|
|
|
|
|
pageInfo.setTotal(com.engine.hrmelog.util.ElogSeviceUtils.getLongValue(countMap.get("counts") + "", 0));
|
|
|
|
|
pageInfo.setColumns(columns);
|
|
|
|
|
return pageInfo;
|
|
|
|
|
}
|
|
|
|
@ -156,10 +157,10 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String getshowColumsStr(List<ShowColumsDto> showColums) {
|
|
|
|
|
private String getshowColumsStr(List<com.engine.hrmelog.entity.dto.ShowColumsDto> showColums) {
|
|
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
|
|
sb.append("id,uuid,targetid,params,operatetype,link_id,link_type,");
|
|
|
|
|
for (ShowColumsDto showColum : showColums) {
|
|
|
|
|
for (com.engine.hrmelog.entity.dto.ShowColumsDto showColum : showColums) {
|
|
|
|
|
String columIndex = showColum.getColumIndex();
|
|
|
|
|
if ("date".equalsIgnoreCase(columIndex) || "createdate".equalsIgnoreCase(columIndex)) {
|
|
|
|
|
columIndex = "log_date";
|
|
|
|
@ -200,31 +201,31 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
private List<Column> getWeaColumns(String data, List<ShowColumsDto> showColums, String module, String function) {
|
|
|
|
|
List<Column> columns = new ArrayList<>();
|
|
|
|
|
private List<com.engine.hrmelog.util.page.Column> getWeaColumns(String data, List<com.engine.hrmelog.entity.dto.ShowColumsDto> showColums, String module, String function) {
|
|
|
|
|
List<com.engine.hrmelog.util.page.Column> columns = new ArrayList<>();
|
|
|
|
|
if (showColums != null && showColums.size() > 0) {
|
|
|
|
|
for (ShowColumsDto showColum : showColums) {
|
|
|
|
|
for (com.engine.hrmelog.entity.dto.ShowColumsDto showColum : showColums) {
|
|
|
|
|
if (StringUtils.isNotBlank(showColum.getAliasColumName())) {
|
|
|
|
|
columns.add(new Column(showColum.getAliasColumName(), showColum.getColumIndex(), showColum.getColumIndex()));
|
|
|
|
|
columns.add(new com.engine.hrmelog.util.page.Column(showColum.getAliasColumName(), showColum.getColumIndex(), showColum.getColumIndex()));
|
|
|
|
|
} else if (StringUtils.isNotBlank(showColum.getColumName())) {
|
|
|
|
|
columns.add(new Column(FieldNameMap.getMainFieldNameMap(data, function, showColum.getColumName()), showColum.getColumIndex(), showColum.getColumIndex()));
|
|
|
|
|
columns.add(new com.engine.hrmelog.util.page.Column(com.engine.hrmelog.util.FieldNameMap.getMainFieldNameMap(data, function, showColum.getColumName()), showColum.getColumIndex(), showColum.getColumIndex()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
columns.add(new Column(FieldNameMap.getMainFieldNameMap(module, function, "moduleName"), "modulenamespan", "modulenamespan"));
|
|
|
|
|
columns.add(new Column(FieldNameMap.getMainFieldNameMap(module, function, "functionName"), "functionnamespan", "functionnamespan"));
|
|
|
|
|
columns.add(new Column(FieldNameMap.getMainFieldNameMap(module, function, "clientIp"), "clientip", "clientip"));
|
|
|
|
|
columns.add(new Column(FieldNameMap.getMainFieldNameMap(module, function, "operateTypeName"), "operatetypename", "operatetypename"));
|
|
|
|
|
columns.add(new Column(FieldNameMap.getMainFieldNameMap(module, function, "targetName"), "targetname", "targetname"));
|
|
|
|
|
columns.add(new Column(FieldNameMap.getMainFieldNameMap(module, function, "date"), "createdate", "createdate"));
|
|
|
|
|
columns.add(new Column(FieldNameMap.getMainFieldNameMap(module, function, "operatorName"), "operatorname", "operatorname"));
|
|
|
|
|
columns.add(new com.engine.hrmelog.util.page.Column(com.engine.hrmelog.util.FieldNameMap.getMainFieldNameMap(module, function, "moduleName"), "modulenamespan", "modulenamespan"));
|
|
|
|
|
columns.add(new com.engine.hrmelog.util.page.Column(com.engine.hrmelog.util.FieldNameMap.getMainFieldNameMap(module, function, "functionName"), "functionnamespan", "functionnamespan"));
|
|
|
|
|
columns.add(new com.engine.hrmelog.util.page.Column(com.engine.hrmelog.util.FieldNameMap.getMainFieldNameMap(module, function, "clientIp"), "clientip", "clientip"));
|
|
|
|
|
columns.add(new com.engine.hrmelog.util.page.Column(com.engine.hrmelog.util.FieldNameMap.getMainFieldNameMap(module, function, "operateTypeName"), "operatetypename", "operatetypename"));
|
|
|
|
|
columns.add(new com.engine.hrmelog.util.page.Column(com.engine.hrmelog.util.FieldNameMap.getMainFieldNameMap(module, function, "targetName"), "targetname", "targetname"));
|
|
|
|
|
columns.add(new com.engine.hrmelog.util.page.Column(com.engine.hrmelog.util.FieldNameMap.getMainFieldNameMap(module, function, "date"), "createdate", "createdate"));
|
|
|
|
|
columns.add(new Column(com.engine.hrmelog.util.FieldNameMap.getMainFieldNameMap(module, function, "operatorName"), "operatorname", "operatorname"));
|
|
|
|
|
}
|
|
|
|
|
return columns;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String getTargetid(List<FilterConditionDto> filterConditionDtos) {
|
|
|
|
|
private String getTargetid(List<com.engine.hrmelog.entity.dto.FilterConditionDto> filterConditionDtos) {
|
|
|
|
|
if (!filterConditionDtos.isEmpty()) {
|
|
|
|
|
for (FilterConditionDto filterConditionDto : filterConditionDtos) {
|
|
|
|
|
for (com.engine.hrmelog.entity.dto.FilterConditionDto filterConditionDto : filterConditionDtos) {
|
|
|
|
|
if ("targetid".equalsIgnoreCase(filterConditionDto.getColumIndex())) {
|
|
|
|
|
return filterConditionDto.getValue();
|
|
|
|
|
}
|
|
|
|
@ -360,7 +361,7 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
* @param showColum
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private String getColumnsWidth(ShowColumsDto showColum) {
|
|
|
|
|
private String getColumnsWidth(com.engine.hrmelog.entity.dto.ShowColumsDto showColum) {
|
|
|
|
|
if (StringUtils.isBlank(showColum.getWidth())) {
|
|
|
|
|
return "5%";
|
|
|
|
|
} else {
|
|
|
|
@ -408,7 +409,7 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
* @param function
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private String getSearchMapSql(String searchMap, String module, String function, List<ShowColumsDto> showColumns) {
|
|
|
|
|
private String getSearchMapSql(String searchMap, String module, String function, List<com.engine.hrmelog.entity.dto.ShowColumsDto> showColumns) {
|
|
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
|
|
Map map = JSON.parseObject(searchMap);
|
|
|
|
|
if (map == null) {
|
|
|
|
@ -427,8 +428,8 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
if (dates != null && dates.size() == 2) {
|
|
|
|
|
Object startDate = dates.get(0);
|
|
|
|
|
Object endDate = dates.get(1);
|
|
|
|
|
startDate = ElogSeviceUtils.checkValSql(startDate.toString());
|
|
|
|
|
endDate = ElogSeviceUtils.checkValSql(endDate.toString());
|
|
|
|
|
startDate = com.engine.hrmelog.util.ElogSeviceUtils.checkValSql(startDate.toString());
|
|
|
|
|
endDate = com.engine.hrmelog.util.ElogSeviceUtils.checkValSql(endDate.toString());
|
|
|
|
|
if (StringUtils.isNotBlank(startDate.toString()) && StringUtils.isNotBlank(endDate.toString())) {
|
|
|
|
|
startDate = startDate.toString().replaceAll("'", "''");
|
|
|
|
|
endDate = endDate.toString().replaceAll("'", "''");
|
|
|
|
@ -449,7 +450,7 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
Object operator = next.getValue();
|
|
|
|
|
if (operator != null) {
|
|
|
|
|
if (StringUtils.isNotBlank(operator.toString())) {
|
|
|
|
|
operator = ElogSeviceUtils.checkValSql(operator.toString());
|
|
|
|
|
operator = com.engine.hrmelog.util.ElogSeviceUtils.checkValSql(operator.toString());
|
|
|
|
|
operator = operator.toString().replaceAll("'", "''");
|
|
|
|
|
if (StringUtils.isNumeric(operator.toString()) && operator.toString().length() > 15) {
|
|
|
|
|
sb.append(" and log_operator = ").append(operator.toString()).append(" ");
|
|
|
|
@ -464,11 +465,11 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
if (moduleName != null) {
|
|
|
|
|
moduleName = moduleName.toString().replaceAll("'", "''");
|
|
|
|
|
if (StringUtils.isNotBlank(moduleName.toString())) {
|
|
|
|
|
moduleName = ElogSeviceUtils.checkValSql(moduleName.toString());
|
|
|
|
|
moduleName = com.engine.hrmelog.util.ElogSeviceUtils.checkValSql(moduleName.toString());
|
|
|
|
|
//sb.append(" and modulename = '").append(moduleName.toString()).append("' ");
|
|
|
|
|
StringBuffer stringBuffer = new StringBuffer();
|
|
|
|
|
if (isEnglish(moduleName.toString())) {
|
|
|
|
|
Map<String, Integer> moduleMap = ElogSeviceSwitchUtils.moduleMap;
|
|
|
|
|
Map<String, Integer> moduleMap = com.engine.hrmelog.util.ElogSeviceSwitchUtils.moduleMap;
|
|
|
|
|
Iterator<Map.Entry<String, Integer>> iterator = moduleMap.entrySet().iterator();
|
|
|
|
|
while (iterator.hasNext()) {
|
|
|
|
|
Map.Entry<String, Integer> nextObj = iterator.next();
|
|
|
|
@ -478,11 +479,11 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
Map<String, Integer> moduleMap = ElogSeviceSwitchUtils.moduleMap;
|
|
|
|
|
Map<String, Integer> moduleMap = com.engine.hrmelog.util.ElogSeviceSwitchUtils.moduleMap;
|
|
|
|
|
Iterator<Map.Entry<String, Integer>> iterator = moduleMap.entrySet().iterator();
|
|
|
|
|
while (iterator.hasNext()) {
|
|
|
|
|
Map.Entry<String, Integer> nextObj = iterator.next();
|
|
|
|
|
String val = ElogSeviceSwitchUtils.getModuleName(nextObj.getValue() + "");
|
|
|
|
|
String val = com.engine.hrmelog.util.ElogSeviceSwitchUtils.getModuleName(nextObj.getValue() + "");
|
|
|
|
|
if (val.contains(moduleName.toString())) {
|
|
|
|
|
stringBuffer.append("'").append(nextObj.getKey()).append("',");
|
|
|
|
|
}
|
|
|
|
@ -498,10 +499,10 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (databaseId.equalsIgnoreCase(ElogConsts.POSTGRESQL) && "targetid".equalsIgnoreCase(next.getKey())) {
|
|
|
|
|
} else if (databaseId.equalsIgnoreCase(com.engine.hrmelog.enums.ElogConsts.POSTGRESQL) && "targetid".equalsIgnoreCase(next.getKey())) {
|
|
|
|
|
//兼容PG环境int类型不支持模糊搜索的问题
|
|
|
|
|
String value = next.getValue().toString().replaceAll("'", "''");
|
|
|
|
|
value = ElogSeviceUtils.checkValSql(value.toString());
|
|
|
|
|
value = com.engine.hrmelog.util.ElogSeviceUtils.checkValSql(value.toString());
|
|
|
|
|
if (value.startsWith("_")) {
|
|
|
|
|
value = value.replace("_", "\\_");
|
|
|
|
|
}
|
|
|
|
@ -511,7 +512,7 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
|
|
|
|
|
if (next.getValue() != null && StringUtils.isNotBlank(key) && StringUtils.isNotBlank(next.getValue().toString())) {
|
|
|
|
|
String value = next.getValue().toString().replaceAll("'", "''");
|
|
|
|
|
value = ElogSeviceUtils.checkValSql(value.toString());
|
|
|
|
|
value = com.engine.hrmelog.util.ElogSeviceUtils.checkValSql(value.toString());
|
|
|
|
|
StringBuilder stringBuffer = new StringBuilder();
|
|
|
|
|
// if (isLikeSearch(showColumns, key)) {
|
|
|
|
|
// String logSearchSql = I18nUtil.getLogSearchSql(ElogSeviceUtils.getTableName(module, function), key, value);
|
|
|
|
@ -551,14 +552,14 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
str = str.replace("_", "\\_");
|
|
|
|
|
}
|
|
|
|
|
if ("operatetypename".equals(key)) {
|
|
|
|
|
String s = ElogSeviceUtils.checkValSql(next.getValue().toString());
|
|
|
|
|
String s = com.engine.hrmelog.util.ElogSeviceUtils.checkValSql(next.getValue().toString());
|
|
|
|
|
sb.append(matchOperatetype(s));
|
|
|
|
|
}
|
|
|
|
|
sb.append(" or ").append(key).append(" in (").append(str).append(")) ");
|
|
|
|
|
} else {
|
|
|
|
|
if ("operatetypename".equals(key)) {
|
|
|
|
|
sb.append(" and (").append(key).append(" like '%").append(value).append("%' ");
|
|
|
|
|
String s = ElogSeviceUtils.checkValSql(next.getValue().toString());
|
|
|
|
|
String s = com.engine.hrmelog.util.ElogSeviceUtils.checkValSql(next.getValue().toString());
|
|
|
|
|
sb.append(matchOperatetype(s)).append(")");
|
|
|
|
|
} else {
|
|
|
|
|
if (value.startsWith("_")) {
|
|
|
|
@ -591,9 +592,9 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
private String getSwithDatabaseDate(String date) {
|
|
|
|
|
if (ElogConsts.ORACLE.equals(databaseId)) {
|
|
|
|
|
if (com.engine.hrmelog.enums.ElogConsts.ORACLE.equals(databaseId)) {
|
|
|
|
|
return " to_date('" + date + "','yyyy-mm-dd hh24:mi:ss') ";
|
|
|
|
|
} else if (ElogConsts.POSTGRESQL.equals(databaseId)) {
|
|
|
|
|
} else if (com.engine.hrmelog.enums.ElogConsts.POSTGRESQL.equals(databaseId)) {
|
|
|
|
|
return " to_timestamp('" + date + "', 'YYYY-MM-DD HH24:MI:SS') ";
|
|
|
|
|
} else if (ElogConsts.SQLSERVER.equals(databaseId)) {
|
|
|
|
|
return " convert(nvarchar(19),'" + date + "',120) ";
|
|
|
|
@ -607,9 +608,9 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
// return "";
|
|
|
|
|
// }
|
|
|
|
|
List<String> list = new ArrayList();
|
|
|
|
|
list.add(OperateType.add);
|
|
|
|
|
list.add(OperateType.update);
|
|
|
|
|
list.add(OperateType.view);
|
|
|
|
|
list.add(com.engine.hrmelog.annotation.OperateType.add);
|
|
|
|
|
list.add(com.engine.hrmelog.annotation.OperateType.update);
|
|
|
|
|
list.add(com.engine.hrmelog.annotation.OperateType.view);
|
|
|
|
|
list.add(OperateType.delete);
|
|
|
|
|
|
|
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
|
@ -643,10 +644,10 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
* @param filterConditionDtos
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private String getQueryCondition(List<FilterConditionDto> filterConditionDtos) {
|
|
|
|
|
private String getQueryCondition(List<com.engine.hrmelog.entity.dto.FilterConditionDto> filterConditionDtos) {
|
|
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
|
|
if (filterConditionDtos != null && filterConditionDtos.size() > 0) {
|
|
|
|
|
for (FilterConditionDto filterConditionDto : filterConditionDtos) {
|
|
|
|
|
for (com.engine.hrmelog.entity.dto.FilterConditionDto filterConditionDto : filterConditionDtos) {
|
|
|
|
|
if (StringUtils.isNotBlank(filterConditionDto.getColumIndex())) {
|
|
|
|
|
sb.append(getsql(filterConditionDto));
|
|
|
|
|
}
|
|
|
|
@ -661,11 +662,11 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
* @param filterConditionDto
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private String getsql(FilterConditionDto filterConditionDto) {
|
|
|
|
|
private String getsql(com.engine.hrmelog.entity.dto.FilterConditionDto filterConditionDto) {
|
|
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
|
|
filterConditionDto.setConnectCondition(ElogSeviceUtils.checkConditionSql(filterConditionDto.getConnectCondition()));
|
|
|
|
|
filterConditionDto.setType(ElogSeviceUtils.checkTypeSql(filterConditionDto.getType()));
|
|
|
|
|
filterConditionDto.setValue(ElogSeviceUtils.checkValSql(filterConditionDto.getValue()));
|
|
|
|
|
filterConditionDto.setConnectCondition(com.engine.hrmelog.util.ElogSeviceUtils.checkConditionSql(filterConditionDto.getConnectCondition()));
|
|
|
|
|
filterConditionDto.setType(com.engine.hrmelog.util.ElogSeviceUtils.checkTypeSql(filterConditionDto.getType()));
|
|
|
|
|
filterConditionDto.setValue(com.engine.hrmelog.util.ElogSeviceUtils.checkValSql(filterConditionDto.getValue()));
|
|
|
|
|
switchDatabaseFieldIndex(filterConditionDto);
|
|
|
|
|
if ("LIKE".equalsIgnoreCase(filterConditionDto.getType())) {
|
|
|
|
|
if (filterConditionDto.getLike() != null) {
|
|
|
|
@ -797,7 +798,7 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
return sb.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void switchDatabaseFieldIndex(FilterConditionDto filterConditionDto) {
|
|
|
|
|
private void switchDatabaseFieldIndex(com.engine.hrmelog.entity.dto.FilterConditionDto filterConditionDto) {
|
|
|
|
|
if ("operator".equalsIgnoreCase(filterConditionDto.getColumIndex())) {
|
|
|
|
|
filterConditionDto.setColumIndex("log_operator");
|
|
|
|
|
} else if ("date".equalsIgnoreCase(filterConditionDto.getColumIndex())) {
|
|
|
|
@ -862,13 +863,13 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
List<Map<String, Object>> list = getDetailChangesMethod(module, function, mainid, null, page);
|
|
|
|
|
|
|
|
|
|
//查询分页总数
|
|
|
|
|
String tableName = ElogSeviceUtils.getTableName(module, function, true);
|
|
|
|
|
String tableName = com.engine.hrmelog.util.ElogSeviceUtils.getTableName(module, function, true);
|
|
|
|
|
Integer total = getLocalElogDaoMapper().queryAllChangesPageCounts(tableName, mainid);
|
|
|
|
|
WeaTable weaTable = new WeaTable();
|
|
|
|
|
weaTable.setColumns(getDetailColumns(list));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PageInfo pageInfo = SalaryPageUtil.buildPage(pageNum, size, list);
|
|
|
|
|
PageInfo pageInfo = PageUtil.buildPage(pageNum, size, list);
|
|
|
|
|
pageInfo.setTotal(total);
|
|
|
|
|
|
|
|
|
|
return weaTable;
|
|
|
|
@ -896,12 +897,12 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
public List<Map<String, Object>> getDetailChangesMethod(String module, String function, String mainid, String detailTransMethod, Page page) {
|
|
|
|
|
|
|
|
|
|
List list = new ArrayList<>();
|
|
|
|
|
String tableName = ElogSeviceUtils.getTableName(module, function, true);
|
|
|
|
|
String maintableName = ElogSeviceUtils.getTableName(module, function, false);
|
|
|
|
|
String tableName = com.engine.hrmelog.util.ElogSeviceUtils.getTableName(module, function, true);
|
|
|
|
|
String maintableName = com.engine.hrmelog.util.ElogSeviceUtils.getTableName(module, function, false);
|
|
|
|
|
List<Map> maps = getLocalElogDaoMapper().queryAllMainData(maintableName, mainid);
|
|
|
|
|
|
|
|
|
|
maps = ElogSeviceSwitchUtils.getSwitchDatabaseData(maps);
|
|
|
|
|
ElogSeviceSwitchUtils.changKey2Lower(maps);
|
|
|
|
|
maps = com.engine.hrmelog.util.ElogSeviceSwitchUtils.getSwitchDatabaseData(maps);
|
|
|
|
|
com.engine.hrmelog.util.ElogSeviceSwitchUtils.changKey2Lower(maps);
|
|
|
|
|
List<Map> allChangesData = new ArrayList<>();
|
|
|
|
|
//如果有分页数据则走分页方法
|
|
|
|
|
if (Objects.nonNull(page)) {
|
|
|
|
@ -912,8 +913,8 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
//没有被则不分页
|
|
|
|
|
allChangesData = getLocalElogDaoMapper().queryAllChangesData(tableName, mainid);
|
|
|
|
|
}
|
|
|
|
|
ElogSeviceSwitchUtils.changKey2Lower(allChangesData);
|
|
|
|
|
allChangesData = ElogSeviceSwitchUtils.getSwitchDatabaseData(allChangesData);
|
|
|
|
|
com.engine.hrmelog.util.ElogSeviceSwitchUtils.changKey2Lower(allChangesData);
|
|
|
|
|
allChangesData = com.engine.hrmelog.util.ElogSeviceSwitchUtils.getSwitchDatabaseData(allChangesData);
|
|
|
|
|
List<Map> mainlist = new ArrayList<>();
|
|
|
|
|
List<Map> detaillist = new ArrayList<>();
|
|
|
|
|
if (allChangesData != null && allChangesData.size() > 0) {
|
|
|
|
@ -933,8 +934,8 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
//List<Map> moduleInfo = queryCommonTabeMapper.queryModuleNameInfo(module);
|
|
|
|
|
List<Map> moduleInfo = new ArrayList<>();
|
|
|
|
|
processDetailInfo(mainlist, detaillist, moduleInfo);
|
|
|
|
|
Map<String, Object> map = ElogSeviceSwitchUtils.switchChangeValue(mainlist, maps);
|
|
|
|
|
Map<String, Object> detailMap = ElogSeviceSwitchUtils.switchDetailChangeValue(detaillist);
|
|
|
|
|
Map<String, Object> map = com.engine.hrmelog.util.ElogSeviceSwitchUtils.switchChangeValue(mainlist, maps);
|
|
|
|
|
Map<String, Object> detailMap = com.engine.hrmelog.util.ElogSeviceSwitchUtils.switchDetailChangeValue(detaillist);
|
|
|
|
|
map.putAll(detailMap);
|
|
|
|
|
if (maps != null && maps.size() > 0) {
|
|
|
|
|
Map maininfoMap = maps.get(0);
|
|
|
|
@ -942,11 +943,11 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
String targetname = (String) maininfoMap.get("targetname");
|
|
|
|
|
//长度大于1避免部分模块为1,2,3这类的操作类型
|
|
|
|
|
if (StringUtils.isNumeric(operatetypename) && operatetypename.length() > 1 && operatetypename.length() < 10) {
|
|
|
|
|
String transfOperatetypename = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(operatetypename), operatetypename);
|
|
|
|
|
String transfOperatetypename = com.engine.hrmelog.util.ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(operatetypename), operatetypename);
|
|
|
|
|
maininfoMap.put("operatetypename", transfOperatetypename);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNumeric(targetname) && targetname.length() > 1 && targetname.length() < 10) {
|
|
|
|
|
String transfTargetname = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(targetname), targetname);
|
|
|
|
|
String transfTargetname = com.engine.hrmelog.util.ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(targetname), targetname);
|
|
|
|
|
maininfoMap.put("targetname", transfTargetname);
|
|
|
|
|
}
|
|
|
|
|
map.put("maininfo", maininfoMap);
|
|
|
|
@ -1001,17 +1002,17 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
String oldvalue = mainMapJs.getString("oldvalue");
|
|
|
|
|
String newvalue = mainMapJs.getString("newvalue");
|
|
|
|
|
if (fieldnameMap.get(fielddesc) != null) {
|
|
|
|
|
mainlistMap.put("fielddesc", ElogSeviceSwitchUtils.transfLanguageLableid(ElogSeviceUtils.getLongValue(fieldnameMap.get(fielddesc).toString()), fieldnameMap.get(fielddesc).toString()));
|
|
|
|
|
mainlistMap.put("fielddesc", com.engine.hrmelog.util.ElogSeviceSwitchUtils.transfLanguageLableid(com.engine.hrmelog.util.ElogSeviceUtils.getLongValue(fieldnameMap.get(fielddesc).toString()), fieldnameMap.get(fielddesc).toString()));
|
|
|
|
|
}
|
|
|
|
|
if (valueMap.get(fielddesc) != null) {
|
|
|
|
|
JSONObject jsonObject = JSONObject.parseObject(valueMap.get(fielddesc).toString());
|
|
|
|
|
String oldvalueStr = jsonObject.getString(oldvalue);
|
|
|
|
|
String newvalueStr = jsonObject.getString(newvalue);
|
|
|
|
|
if (StringUtils.isNotBlank(oldvalueStr)) {
|
|
|
|
|
mainlistMap.put("oldvalue", ElogSeviceSwitchUtils.transfLanguageLableid(ElogSeviceUtils.getLongValue(oldvalueStr), oldvalue));
|
|
|
|
|
mainlistMap.put("oldvalue", com.engine.hrmelog.util.ElogSeviceSwitchUtils.transfLanguageLableid(com.engine.hrmelog.util.ElogSeviceUtils.getLongValue(oldvalueStr), oldvalue));
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(newvalueStr)) {
|
|
|
|
|
mainlistMap.put("newvalue", ElogSeviceSwitchUtils.transfLanguageLableid(ElogSeviceUtils.getLongValue(newvalueStr), newvalue));
|
|
|
|
|
mainlistMap.put("newvalue", com.engine.hrmelog.util.ElogSeviceSwitchUtils.transfLanguageLableid(com.engine.hrmelog.util.ElogSeviceUtils.getLongValue(newvalueStr), newvalue));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1025,20 +1026,20 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
String oldvalue = mainMapJs.getString("oldvalue");
|
|
|
|
|
String newvalue = mainMapJs.getString("newvalue");
|
|
|
|
|
if (tablenameMap.get(tablename) != null) {
|
|
|
|
|
detaillistMap.put("tablename", ElogSeviceSwitchUtils.transfLanguageLableid(ElogSeviceUtils.getLongValue(tablenameMap.get(tablename).toString()), tablenameMap.get(tablename).toString()));
|
|
|
|
|
detaillistMap.put("tablename", com.engine.hrmelog.util.ElogSeviceSwitchUtils.transfLanguageLableid(com.engine.hrmelog.util.ElogSeviceUtils.getLongValue(tablenameMap.get(tablename).toString()), tablenameMap.get(tablename).toString()));
|
|
|
|
|
}
|
|
|
|
|
if (fieldnameMap.get(fielddesc) != null) {
|
|
|
|
|
detaillistMap.put("fielddesc", ElogSeviceSwitchUtils.transfLanguageLableid(ElogSeviceUtils.getLongValue(fieldnameMap.get(fielddesc).toString()), fieldnameMap.get(fielddesc).toString()));
|
|
|
|
|
detaillistMap.put("fielddesc", com.engine.hrmelog.util.ElogSeviceSwitchUtils.transfLanguageLableid(com.engine.hrmelog.util.ElogSeviceUtils.getLongValue(fieldnameMap.get(fielddesc).toString()), fieldnameMap.get(fielddesc).toString()));
|
|
|
|
|
}
|
|
|
|
|
if (valueMap.get(fielddesc) != null) {
|
|
|
|
|
JSONObject jsonObject = JSONObject.parseObject(valueMap.get(fielddesc).toString());
|
|
|
|
|
String oldvalueStr = jsonObject.getString(oldvalue);
|
|
|
|
|
String newvalueStr = jsonObject.getString(newvalue);
|
|
|
|
|
if (StringUtils.isNotBlank(oldvalueStr)) {
|
|
|
|
|
detaillistMap.put("oldvalue", ElogSeviceSwitchUtils.transfLanguageLableid(ElogSeviceUtils.getLongValue(oldvalueStr), oldvalue));
|
|
|
|
|
detaillistMap.put("oldvalue", com.engine.hrmelog.util.ElogSeviceSwitchUtils.transfLanguageLableid(com.engine.hrmelog.util.ElogSeviceUtils.getLongValue(oldvalueStr), oldvalue));
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(newvalueStr)) {
|
|
|
|
|
detaillistMap.put("newvalue", ElogSeviceSwitchUtils.transfLanguageLableid(ElogSeviceUtils.getLongValue(newvalueStr), newvalue));
|
|
|
|
|
detaillistMap.put("newvalue", com.engine.hrmelog.util.ElogSeviceSwitchUtils.transfLanguageLableid(com.engine.hrmelog.util.ElogSeviceUtils.getLongValue(newvalueStr), newvalue));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1048,7 +1049,7 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List queryLogList(ELogGetLogParam param) {
|
|
|
|
|
LoggerContext context = new LoggerContext();
|
|
|
|
|
com.engine.hrmelog.entity.dto.LoggerContext context = new com.engine.hrmelog.entity.dto.LoggerContext();
|
|
|
|
|
context.setModuleName(param.getModule());
|
|
|
|
|
context.setFunctionName(param.getFunction());
|
|
|
|
|
int pagenum = Util.getIntValue(param.getCurrent(), 1) - 1;
|
|
|
|
@ -1058,9 +1059,9 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
Page<Map> page = new Page(pagenum, size);
|
|
|
|
|
String limit = " limit " + start + "," + (end - start);
|
|
|
|
|
|
|
|
|
|
String tableName = ElogSeviceUtils.getTableName(param.getModule(), param.getFunction());
|
|
|
|
|
String tableName = com.engine.hrmelog.util.ElogSeviceUtils.getTableName(param.getModule(), param.getFunction());
|
|
|
|
|
List<Map> list = getLocalElogDaoMapper().queryElogList(page, context, null, tableName, null, "*");
|
|
|
|
|
list = ElogSeviceSwitchUtils.getSwitchDatabaseData(list);
|
|
|
|
|
list = com.engine.hrmelog.util.ElogSeviceSwitchUtils.getSwitchDatabaseData(list);
|
|
|
|
|
return switchString(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1076,8 +1077,8 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
String sColum = "";
|
|
|
|
|
String fColum = "";
|
|
|
|
|
String transMethod = null;
|
|
|
|
|
List<ShowColumsDto> showColums = new ArrayList<>();
|
|
|
|
|
List<FilterConditionDto> filterConditionDtos = new ArrayList<>();
|
|
|
|
|
List<com.engine.hrmelog.entity.dto.ShowColumsDto> showColums = new ArrayList<>();
|
|
|
|
|
List<com.engine.hrmelog.entity.dto.FilterConditionDto> filterConditionDtos = new ArrayList<>();
|
|
|
|
|
String authParams = "";
|
|
|
|
|
Map jsonObject = new HashMap();
|
|
|
|
|
if (map != null) {
|
|
|
|
@ -1088,14 +1089,14 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
//dataset = map.get("dataset").toString();
|
|
|
|
|
searchMap = map.getString("searchMap");
|
|
|
|
|
sColum = map.getString("showColums");
|
|
|
|
|
showColums = JSONArray.parseArray(sColum, ShowColumsDto.class);
|
|
|
|
|
showColums = JSONArray.parseArray(sColum, com.engine.hrmelog.entity.dto.ShowColumsDto.class);
|
|
|
|
|
fColum = map.getString("filterConditions");
|
|
|
|
|
transMethod = map.getString("transMethod");
|
|
|
|
|
filterConditionDtos = JSONArray.parseArray(fColum, FilterConditionDto.class);
|
|
|
|
|
authParams = map.getString("authParams");
|
|
|
|
|
jsonObject = JSONObject.parseObject(authParams);
|
|
|
|
|
}
|
|
|
|
|
LoggerContext context = new LoggerContext();
|
|
|
|
|
com.engine.hrmelog.entity.dto.LoggerContext context = new com.engine.hrmelog.entity.dto.LoggerContext();
|
|
|
|
|
context.setModuleName(module);
|
|
|
|
|
context.setFunctionName(function);
|
|
|
|
|
context.setTenant_key(getTenantKey().toLowerCase());
|
|
|
|
@ -1106,24 +1107,24 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
// 消费到消息,通过MethodHandler调用对应的方法
|
|
|
|
|
String customSql = getCustomSql(transMethod, sb, "before");
|
|
|
|
|
|
|
|
|
|
Page pages = new Page(ElogSeviceUtils.getIntValue(pageNum, 1), ElogSeviceUtils.getIntValue(pageSize, 10));
|
|
|
|
|
Page pages = new Page(com.engine.hrmelog.util.ElogSeviceUtils.getIntValue(pageNum, 1), com.engine.hrmelog.util.ElogSeviceUtils.getIntValue(pageSize, 10));
|
|
|
|
|
int page = Util.getIntValue(pages.getPageNum() + "", 1) - 1;
|
|
|
|
|
int size = Util.getIntValue(pages.getPageSize() + "", 10);
|
|
|
|
|
int start = page * size;
|
|
|
|
|
int end = start + size;
|
|
|
|
|
String limit = " limit " + start + "," + (end - start);
|
|
|
|
|
String tableName = ElogSeviceUtils.getTableName(module, function);
|
|
|
|
|
String tableName = com.engine.hrmelog.util.ElogSeviceUtils.getTableName(module, function);
|
|
|
|
|
|
|
|
|
|
//String columns = getshowColumsStr(showColums);
|
|
|
|
|
List<Map> list = new ArrayList<>();
|
|
|
|
|
Map<String, Object> countMap = new HashMap<>();
|
|
|
|
|
list = getLocalElogDaoMapper().queryElogList(pages, context, null, tableName, customSql, "*");
|
|
|
|
|
countMap = getLocalElogDaoMapper().elogCount(context, tableName, customSql);
|
|
|
|
|
list = ElogSeviceSwitchUtils.getSwitchDatabaseData(list);
|
|
|
|
|
list = com.engine.hrmelog.util.ElogSeviceSwitchUtils.getSwitchDatabaseData(list);
|
|
|
|
|
|
|
|
|
|
if (list != null && list.size() > 0) {
|
|
|
|
|
//if ("1".equals(pageNum)){
|
|
|
|
|
list.get(0).put("total", ElogSeviceUtils.getLongValue(countMap.get("counts") + "", 0));
|
|
|
|
|
list.get(0).put("total", com.engine.hrmelog.util.ElogSeviceUtils.getLongValue(countMap.get("counts") + "", 0));
|
|
|
|
|
//}
|
|
|
|
|
}
|
|
|
|
|
transUserInfo(list);
|
|
|
|
@ -1139,7 +1140,7 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
* @param lists
|
|
|
|
|
* @param showColums
|
|
|
|
|
*/
|
|
|
|
|
public static List transfLanguageData(List<Map> lists, List<ShowColumsDto> showColums) {
|
|
|
|
|
public static List transfLanguageData(List<Map> lists, List<com.engine.hrmelog.entity.dto.ShowColumsDto> showColums) {
|
|
|
|
|
if (lists != null && lists.size() > 0) {
|
|
|
|
|
for (Map map : lists) {
|
|
|
|
|
if (map != null) {
|
|
|
|
@ -1149,7 +1150,7 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
for (ShowColumsDto showColum : showColums) {
|
|
|
|
|
if (StringUtils.isNotBlank(showColum.getColumIndex()) && showColum.isTransfLanguage() && entry.getKey().equals(showColum.getColumIndex()) && !Objects.isNull(entry.getValue()) && StringUtils.isNumeric(entry.getValue().toString())) {
|
|
|
|
|
if (entry.getValue() instanceof Integer || entry.getValue() instanceof Long || entry.getValue() instanceof String) {
|
|
|
|
|
map.put(entry.getKey(), ElogSeviceSwitchUtils.transfLanguageLableid(ElogSeviceUtils.getLongValue(entry.getValue().toString()), entry.getValue().toString()));
|
|
|
|
|
map.put(entry.getKey(), com.engine.hrmelog.util.ElogSeviceSwitchUtils.transfLanguageLableid(com.engine.hrmelog.util.ElogSeviceUtils.getLongValue(entry.getValue().toString()), entry.getValue().toString()));
|
|
|
|
|
} else {
|
|
|
|
|
//map.put(entry.getKey(), ElogSeviceSwitchUtils.handlerBaseDataMethod(entry.getValue().toString()));
|
|
|
|
|
map.put(entry.getKey(), entry.getValue());
|
|
|
|
@ -1157,18 +1158,18 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
} else if (StringUtils.isNotBlank(showColum.getColumIndex()) && showColum.isTransfLanguage() && entry.getKey().equals(showColum.getColumIndex()) && !Objects.isNull(entry.getValue())) {
|
|
|
|
|
//read view add edit update delete
|
|
|
|
|
if ("add".equals(entry.getValue().toString()) || "创建".equals(entry.getValue().toString())) {
|
|
|
|
|
map.put(entry.getKey(), SalaryI18nUtil.getI18nLabel(1111111, "新增"));
|
|
|
|
|
map.put(entry.getKey(), I18nUtil.getI18nLabel(1111111, "新增"));
|
|
|
|
|
} else if ("read".equals(entry.getValue().toString()) || "view".equals(entry.getValue().toString()) || "查看".equals(entry.getValue().toString())) {
|
|
|
|
|
map.put(entry.getKey(), SalaryI18nUtil.getI18nLabel(1111111, "查看"));
|
|
|
|
|
map.put(entry.getKey(), I18nUtil.getI18nLabel(1111111, "查看"));
|
|
|
|
|
} else if ("edit".equals(entry.getValue().toString()) || "update".equals(entry.getValue().toString()) || "更新".equals(entry.getValue().toString())) {
|
|
|
|
|
map.put(entry.getKey(), SalaryI18nUtil.getI18nLabel(1111111, "修改"));
|
|
|
|
|
map.put(entry.getKey(), I18nUtil.getI18nLabel(1111111, "修改"));
|
|
|
|
|
} else if ("delete".equals(entry.getValue().toString()) || "删除".equals(entry.getValue().toString())) {
|
|
|
|
|
map.put(entry.getKey(), SalaryI18nUtil.getI18nLabel(63254, "删除"));
|
|
|
|
|
map.put(entry.getKey(), I18nUtil.getI18nLabel(63254, "删除"));
|
|
|
|
|
} else if (entry.getValue().toString().contains("取消关联标签 ")) {
|
|
|
|
|
String val = entry.getValue().toString().replace("取消关联标签 ", SalaryI18nUtil.getI18nLabel(1111111, "取消关联标签 ") + " ");
|
|
|
|
|
String val = entry.getValue().toString().replace("取消关联标签 ", I18nUtil.getI18nLabel(1111111, "取消关联标签 ") + " ");
|
|
|
|
|
map.put(entry.getKey(), val);
|
|
|
|
|
} else if (entry.getValue().toString().contains("关联标签 ")) {
|
|
|
|
|
String val = entry.getValue().toString().replace("关联标签 ", SalaryI18nUtil.getI18nLabel(1111111, "关联标签 ") + " ");
|
|
|
|
|
String val = entry.getValue().toString().replace("关联标签 ", I18nUtil.getI18nLabel(1111111, "关联标签 ") + " ");
|
|
|
|
|
map.put(entry.getKey(), val);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1183,17 +1184,17 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map countLog(String module, String function) {
|
|
|
|
|
LoggerContext context = new LoggerContext();
|
|
|
|
|
com.engine.hrmelog.entity.dto.LoggerContext context = new com.engine.hrmelog.entity.dto.LoggerContext();
|
|
|
|
|
context.setModuleName(module);
|
|
|
|
|
context.setFunctionName(function);
|
|
|
|
|
context.setTenant_key(getTenantKey());
|
|
|
|
|
String tableName = ElogSeviceUtils.getTableName(module, function);
|
|
|
|
|
String tableName = com.engine.hrmelog.util.ElogSeviceUtils.getTableName(module, function);
|
|
|
|
|
return getLocalElogDaoMapper().elogCount(context, tableName, null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List queryDetailLogList(String module, String function, String current, String pageSize, String condition, String mainId) {
|
|
|
|
|
LoggerContext context = new LoggerContext();
|
|
|
|
|
com.engine.hrmelog.entity.dto.LoggerContext context = new com.engine.hrmelog.entity.dto.LoggerContext();
|
|
|
|
|
context.setModuleName(module);
|
|
|
|
|
context.setFunctionName(function);
|
|
|
|
|
context.setTenant_key(getTenantKey());
|
|
|
|
@ -1204,20 +1205,20 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
int end = start + size;
|
|
|
|
|
String limit = " limit " + start + "," + (end - start);
|
|
|
|
|
// 还需要支持下查询
|
|
|
|
|
String tableName = ElogSeviceUtils.getTableName(module, function, true);
|
|
|
|
|
String tableName = com.engine.hrmelog.util.ElogSeviceUtils.getTableName(module, function, true);
|
|
|
|
|
List<Map> list = getLocalElogDaoMapper().queryDetailElogList(context, limit, tableName, null);
|
|
|
|
|
list = ElogSeviceSwitchUtils.getSwitchDatabaseData(list);
|
|
|
|
|
list = com.engine.hrmelog.util.ElogSeviceSwitchUtils.getSwitchDatabaseData(list);
|
|
|
|
|
return switchString(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map countDestailLog(String module, String function, String mainId) {
|
|
|
|
|
LoggerContext context = new LoggerContext();
|
|
|
|
|
com.engine.hrmelog.entity.dto.LoggerContext context = new LoggerContext();
|
|
|
|
|
context.setModuleName(module);
|
|
|
|
|
context.setFunctionName(function);
|
|
|
|
|
context.setTenant_key(getTenantKey());
|
|
|
|
|
context.setUuid(mainId);
|
|
|
|
|
String tableName = ElogSeviceUtils.getTableName(module, function, true);
|
|
|
|
|
String tableName = com.engine.hrmelog.util.ElogSeviceUtils.getTableName(module, function, true);
|
|
|
|
|
return getLocalElogDaoMapper().elogDetailCount(context, tableName, null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1225,17 +1226,17 @@ public class LoggerTableService extends Service implements ILoggerTableService {
|
|
|
|
|
public WeaTable queryElogTraceInfo(String traceId, String module, String function, Integer currentPage, Integer pageSize, String traceTransMethod) {
|
|
|
|
|
WeaTable weaTable = new WeaTable();
|
|
|
|
|
if (StringUtils.isNotEmpty(traceId)) {
|
|
|
|
|
String tableName = ElogSeviceUtils.getTableName(module, function);
|
|
|
|
|
String tableName = com.engine.hrmelog.util.ElogSeviceUtils.getTableName(module, function);
|
|
|
|
|
Integer offset = (currentPage - 1) * pageSize;
|
|
|
|
|
List<Map> list = getLocalElogDaoMapper().queryElogTraceInfo(traceId, tableName, offset, pageSize);
|
|
|
|
|
for (Map map : list) {
|
|
|
|
|
if (map.get("modulename") != null) {
|
|
|
|
|
map.put("modulenamespan", ElogSeviceSwitchUtils.getModuleName(map.get("modulename").toString()));
|
|
|
|
|
map.put("modulenamespan", com.engine.hrmelog.util.ElogSeviceSwitchUtils.getModuleName(map.get("modulename").toString()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//list = ElogSeviceSwitchUtils.getSwitchDatabaseData(list);
|
|
|
|
|
int count = getLocalElogDaoMapper().queryElogTraceInfoCount(traceId, tableName);
|
|
|
|
|
PageInfo pageInfo = SalaryPageUtil.buildPage(currentPage, pageSize, list);
|
|
|
|
|
PageInfo pageInfo = PageUtil.buildPage(currentPage, pageSize, list);
|
|
|
|
|
// pageInfo.setColumns();
|
|
|
|
|
pageInfo.setTotal(count);
|
|
|
|
|
}
|