更换elog位置,不依赖薪酬

main
钱涛 1 year ago
parent c9c2315d51
commit 1f2bbc9cb5

@ -1,4 +1,4 @@
package com.api.salary.elog;
package com.api.hrmelog;
import javax.ws.rs.Path;
@ -10,6 +10,6 @@ import javax.ws.rs.Path;
* @author qiantao
* @version 1.0
**/
@Path("/bs/hrmsalary/elog")
public class LoggerTableController extends com.engine.salary.elog.web.LoggerTableController{
@Path("/bs/hrmelog/elog")
public class LoggerTableController extends com.engine.hrmelog.web.LoggerTableController {
}

@ -1,4 +1,4 @@
package com.engine.salary.elog.annotation;
package com.engine.hrmelog.annotation;
import java.lang.annotation.*;

@ -1,4 +1,4 @@
package com.engine.salary.elog.annotation;
package com.engine.hrmelog.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;

@ -1,4 +1,4 @@
package com.engine.salary.elog.annotation;
package com.engine.hrmelog.annotation;
import java.lang.annotation.*;

@ -1,4 +1,4 @@
package com.engine.salary.elog.annotation;
package com.engine.hrmelog.annotation;
import java.lang.annotation.*;

@ -1,4 +1,4 @@
package com.engine.salary.elog.annotation;
package com.engine.hrmelog.annotation;
import java.lang.annotation.*;

@ -1,6 +1,6 @@
package com.engine.salary.elog.annotation;
package com.engine.hrmelog.annotation;
import com.engine.salary.elog.entity.dto.DataTypeEnum;
import com.engine.hrmelog.entity.dto.DataTypeEnum;
import java.lang.annotation.*;
@ -9,7 +9,7 @@ import java.lang.annotation.*;
@Target({ElementType.FIELD})
public @interface ElogField {
DataTypeEnum dataType() default DataTypeEnum.VARCHAR;
com.engine.hrmelog.entity.dto.DataTypeEnum dataType() default DataTypeEnum.VARCHAR;
int length() default 50;

@ -1,4 +1,4 @@
package com.engine.salary.elog.annotation;
package com.engine.hrmelog.annotation;
import java.lang.annotation.*;

@ -1,4 +1,4 @@
package com.engine.salary.elog.annotation;
package com.engine.hrmelog.annotation;
import java.lang.annotation.*;

@ -1,4 +1,4 @@
package com.engine.salary.elog.annotation;
package com.engine.hrmelog.annotation;
import java.lang.annotation.*;

@ -1,4 +1,4 @@
package com.engine.salary.elog.annotation;
package com.engine.hrmelog.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;

@ -1,4 +1,4 @@
package com.engine.salary.elog.annotation;
package com.engine.hrmelog.annotation;
import java.lang.annotation.*;

@ -1,4 +1,4 @@
package com.engine.salary.elog.annotation;
package com.engine.hrmelog.annotation;
public class OperateType {
public static final String view = "view";

@ -1,10 +1,8 @@
package com.engine.salary.elog.async;
package com.engine.hrmelog.async;
import com.engine.salary.elog.config.ELogTableChecker;
import com.engine.salary.elog.entity.dto.LoggerContext;
import com.engine.salary.elog.service.impl.LocalElogService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.engine.hrmelog.config.ELogTableChecker;
import com.engine.hrmelog.entity.dto.LoggerContext;
import com.engine.hrmelog.service.impl.LocalElogService;
/**
*
@ -16,7 +14,7 @@ import org.slf4j.LoggerFactory;
**/
public class LoggerMessageListener {
LocalElogService localElogService = new LocalElogService();
ELogTableChecker checker = new ELogTableChecker();
com.engine.hrmelog.config.ELogTableChecker checker = new ELogTableChecker();
public <T> void receiveold(LoggerContext messageBean) {
checker.check(messageBean);

@ -1,7 +1,7 @@
package com.engine.salary.elog.config;
package com.engine.hrmelog.config;
import com.engine.salary.mapper.elog.ElogTableCheckerMapper;
import com.engine.salary.elog.util.db.MapperProxyFactory;
import com.engine.hrmelog.mapper.ElogTableCheckerMapper;
import com.engine.hrmelog.util.db.MapperProxyFactory;
import java.util.HashMap;
import java.util.Map;

@ -1,9 +1,9 @@
package com.engine.salary.elog.config;
package com.engine.hrmelog.config;
import com.engine.salary.elog.entity.dto.LoggerContext;
import com.engine.salary.mapper.elog.ElogTableCheckerMapper;
import com.engine.salary.elog.util.db.IdGenerator;
import com.engine.salary.elog.util.db.MapperProxyFactory;
import com.engine.hrmelog.entity.dto.LoggerContext;
import com.engine.hrmelog.mapper.ElogTableCheckerMapper;
import com.engine.hrmelog.util.db.IdGenerator;
import com.engine.hrmelog.util.db.MapperProxyFactory;
public class ELogTableChecker {

@ -1,7 +1,7 @@
package com.engine.salary.elog.entity.dto;
package com.engine.hrmelog.entity.dto;
import com.engine.salary.elog.annotation.ApiModel;
import com.engine.salary.elog.annotation.ApiModelProperty;
import com.engine.hrmelog.annotation.ApiModel;
import com.engine.hrmelog.annotation.ApiModelProperty;
/**
*

@ -1,4 +1,4 @@
package com.engine.salary.elog.entity.dto;
package com.engine.hrmelog.entity.dto;
public enum DataTypeEnum {
VARCHAR,

@ -1,4 +1,4 @@
package com.engine.salary.elog.entity.dto;
package com.engine.hrmelog.entity.dto;
import java.io.Serializable;
import java.util.ArrayList;

@ -1,4 +1,4 @@
package com.engine.salary.elog.entity.dto;
package com.engine.hrmelog.entity.dto;
import java.io.Serializable;
@ -23,7 +23,7 @@ public class FilterConditionDto implements Serializable {
/**
*
*/
private Like like;
private com.engine.hrmelog.entity.dto.Like like;
/**
*
@ -60,7 +60,7 @@ public class FilterConditionDto implements Serializable {
this.type = type;
}
public Like getLike() {
public com.engine.hrmelog.entity.dto.Like getLike() {
return like;
}

@ -1,4 +1,4 @@
package com.engine.salary.elog.entity.dto;
package com.engine.hrmelog.entity.dto;
import java.io.Serializable;

@ -1,11 +1,11 @@
package com.engine.salary.elog.entity.dto;
package com.engine.hrmelog.entity.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.engine.salary.elog.annotation.ElogField;
import com.engine.salary.elog.annotation.ElogTable;
import com.engine.salary.elog.enums.ElogConsts;
import com.engine.salary.elog.annotation.ApiModel;
import com.engine.salary.elog.annotation.ApiModelProperty;
import com.engine.hrmelog.enums.ElogConsts;
import com.engine.hrmelog.annotation.ElogField;
import com.engine.hrmelog.annotation.ElogTable;
import com.engine.hrmelog.annotation.ApiModel;
import com.engine.hrmelog.annotation.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;
import weaver.hrm.User;
@ -31,49 +31,49 @@ public class LoggerContext<T> implements Serializable {
private User user;
@ElogField(comment = "ID", dataType = DataTypeEnum.BIGINT, isKey = true)
@ElogField(comment = "ID", dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.BIGINT, isKey = true)
@ApiModelProperty("日志ID")
private long id;
@ElogField(dataType = DataTypeEnum.VARCHAR, length = 36, comment = "日志UUID")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.VARCHAR, length = 36, comment = "日志UUID")
@ApiModelProperty("日志UUID")
private String uuid = "";
@ApiModelProperty("自定义日志字段信息")
private T customInfo;
@ElogField(dataType = DataTypeEnum.DATETIME, comment = "操作时间")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.DATETIME, comment = "操作时间")
@ApiModelProperty("操作时间")
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date date = new Date();
@ElogField(dataType = DataTypeEnum.VARCHAR, length = 500, comment = "终端信息")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.VARCHAR, length = 500, comment = "终端信息")
@ApiModelProperty("终端信息")
private String device = "";
@ElogField(dataType = DataTypeEnum.BIGINT, defaultValue = "-1", comment = "操作人")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.BIGINT, defaultValue = "-1", comment = "操作人")
@ApiModelProperty("操作人")
private String operator = "";
@ElogField(dataType = DataTypeEnum.VARCHAR, length = 100, comment = "操作人姓名")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.VARCHAR, length = 100, comment = "操作人姓名")
@ApiModelProperty("操作人姓名")
private String operatorName = "";
@ElogField(dataType = DataTypeEnum.VARCHAR, length = 10, comment = "租户id")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.VARCHAR, length = 10, comment = "租户id")
@ApiModelProperty("租户id")
private String tenant_key = "";
/**
*
*/
@ElogField(dataType = DataTypeEnum.BIGINT, defaultValue = "-1", comment = "操作目标id")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.BIGINT, defaultValue = "-1", comment = "操作目标id")
@ApiModelProperty("操作目标id")
private String targetId = "";
@ElogField(dataType = DataTypeEnum.TEXT, comment = "操作目标名称")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.TEXT, comment = "操作目标名称")
@ApiModelProperty("操作目标名称(用于显示)")
private String targetName = "";
@ElogField(dataType = DataTypeEnum.VARCHAR, length = 100, comment = "模块")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.VARCHAR, length = 100, comment = "模块")
@ApiModelProperty("目标对象类型(大分类,模块,服务)")
private String moduleName;// 模块
@ -82,27 +82,27 @@ public class LoggerContext<T> implements Serializable {
* _
* __
*/
@ElogField(dataType = DataTypeEnum.VARCHAR, length = 100, comment = "服务(方法)")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.VARCHAR, length = 100, comment = "服务(方法)")
@ApiModelProperty("目标对象类型(小分类,模块/服务下的子功能。子项目)")
private String functionName;
@ElogField(dataType = DataTypeEnum.VARCHAR, length = 100, comment = "访问接口名")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.VARCHAR, length = 100, comment = "访问接口名")
@ApiModelProperty("访问接口名")
private String interfaceName = "";
@ElogField(dataType = DataTypeEnum.VARCHAR, length = 200, comment = "请求全路径")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.VARCHAR, length = 200, comment = "请求全路径")
@ApiModelProperty("请求全路径")
private String requestUrl = "";
@ElogField(dataType = DataTypeEnum.VARCHAR, length = 200, comment = "请求地址")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.VARCHAR, length = 200, comment = "请求地址")
@ApiModelProperty("请求地址")
private String requestUri = "";
@ElogField(dataType = DataTypeEnum.VARCHAR, length = 50, comment = "操作类型")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.VARCHAR, length = 50, comment = "操作类型")
@ApiModelProperty("操作类型(增删改查等)")
private String operateType = "";
@ElogField(dataType = DataTypeEnum.VARCHAR, length = 100, comment = "操作类型名称")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.VARCHAR, length = 100, comment = "操作类型名称")
@ApiModelProperty("操作类型名称")
private String operateTypeName = "";
@ -110,13 +110,13 @@ public class LoggerContext<T> implements Serializable {
* TableChangeBean
*/
@ApiModelProperty("修改前、后的值")
private List<TableChangeBean> changeValues;// 操作表名,[字段名,值]
private List<com.engine.hrmelog.entity.dto.TableChangeBean> changeValues;// 操作表名,[字段名,值]
@ElogField(dataType = DataTypeEnum.VARCHAR, length = 3000, comment = "操作详细说明")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.VARCHAR, length = 3000, comment = "操作详细说明")
@ApiModelProperty("操作详细说明")
private String operatedesc = "";
@ElogField(dataType = DataTypeEnum.LONGTEXT, comment = "涉及的相关参数")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.LONGTEXT, comment = "涉及的相关参数")
@ApiModelProperty("涉及的相关参数")
private Map<String, Object> params;
@ -126,97 +126,97 @@ public class LoggerContext<T> implements Serializable {
/**
* belongMainId
*/
@ElogField(dataType = DataTypeEnum.VARCHAR, length = 36, comment = "所属主表uuid")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.VARCHAR, length = 36, comment = "所属主表uuid")
@ApiModelProperty("所属主表uuid")
private String belongMainId = "";
@ElogField(dataType = DataTypeEnum.VARCHAR, length = 50, comment = "操作IP")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.VARCHAR, length = 50, comment = "操作IP")
@ApiModelProperty("操作IP")
private String clientIp = "";
@ElogField(dataType = DataTypeEnum.VARCHAR, length = 50, comment = "分组")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.VARCHAR, length = 50, comment = "分组")
@ApiModelProperty("分组")
private String groupId = "";
/*@ApiModelProperty("是否明显表")
private boolean isDetail;*/
@ElogField(dataType = DataTypeEnum.VARCHAR, length = 1000, comment = "分组标题")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.VARCHAR, length = 1000, comment = "分组标题")
@ApiModelProperty("分组标题")
private String groupNameLabel = "";
@ElogField(dataType = DataTypeEnum.VARCHAR, length = 200, comment = "重做业务接口")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.VARCHAR, length = 200, comment = "重做业务接口")
@ApiModelProperty("重做业务接口")
private String redoService = "";
@ElogField(dataType = DataTypeEnum.LONGTEXT, comment = "重做参数")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.LONGTEXT, comment = "重做参数")
@ApiModelProperty("重做参数")
private RedoContext redoContext;
private com.engine.hrmelog.entity.dto.RedoContext redoContext;
@ApiModelProperty("重做参数-转String存储")
private String redoContextStr;
@ElogField(dataType = DataTypeEnum.VARCHAR, length = 200, comment = "撤销业务接口")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.VARCHAR, length = 200, comment = "撤销业务接口")
@ApiModelProperty("撤销业务接口")
private String cancelService = "";
@ElogField(dataType = DataTypeEnum.LONGTEXT, comment = "撤销参数")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.LONGTEXT, comment = "撤销参数")
@ApiModelProperty("撤销参数")
private CancelContext cancelContext;
private com.engine.hrmelog.entity.dto.CancelContext cancelContext;
@ApiModelProperty("撤销参数-转String存储")
private String cancelContextStr;
@ApiModelProperty("日志明细列表(值变化列表-自动赋值、或者自定义字段)")
private List<LoggerDetailContext> detailContexts;
private List<com.engine.hrmelog.entity.dto.LoggerDetailContext> detailContexts;
@ElogField(dataType = DataTypeEnum.DATETIME, defaultValue = "CURRENT_TIMESTAMP", comment = "创建时间")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.DATETIME, defaultValue = "CURRENT_TIMESTAMP", comment = "创建时间")
@ApiModelProperty("创建时间")
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date create_time;
@ElogField(dataType = DataTypeEnum.DATETIME, defaultValue = "CURRENT_TIMESTAMP", comment = "修改时间")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.DATETIME, defaultValue = "CURRENT_TIMESTAMP", comment = "修改时间")
@ApiModelProperty("修改时间")
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date update_time;
@ElogField(dataType = DataTypeEnum.BIGINT, defaultValue = "-1", comment = "创建人id")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.BIGINT, defaultValue = "-1", comment = "创建人id")
@ApiModelProperty("创建人id")
private long creator;
@ElogField(dataType = DataTypeEnum.INT, defaultValue = "0", comment = "是否删除")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.INT, defaultValue = "0", comment = "是否删除")
@ApiModelProperty("是否删除")
private int delete_type;
@ElogField(dataType = DataTypeEnum.BIGINT, defaultValue = "0", comment = "总运行时长")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.BIGINT, defaultValue = "0", comment = "总运行时长")
@ApiModelProperty("总运行时长")
private long totalRunTime;
@ElogField(dataType = DataTypeEnum.BIGINT, defaultValue = "0", comment = "主方法运行时长")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.BIGINT, defaultValue = "0", comment = "主方法运行时长")
@ApiModelProperty("主方法运行时长")
private long mainRunTime;
@ElogField(dataType = DataTypeEnum.VARCHAR, length = 100, defaultValue = "", comment = "运行结果标识")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.VARCHAR, length = 100, defaultValue = "", comment = "运行结果标识")
@ApiModelProperty("运行结果标识")
private String result = "";
@ElogField(dataType = DataTypeEnum.VARCHAR, length = 100, defaultValue = "", comment = "来自pc web")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.VARCHAR, length = 100, defaultValue = "", comment = "来自pc web")
@ApiModelProperty("来自终端")
private String fromTerminal = "";
@ElogField(dataType = DataTypeEnum.TEXT, comment = "运行结果描述")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.TEXT, comment = "运行结果描述")
@ApiModelProperty("运行结果描述")
private String resultDesc = "";
@ElogField(dataType = DataTypeEnum.VARCHAR, length = 3000, comment = "原先内容")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.VARCHAR, length = 3000, comment = "原先内容")
@ApiModelProperty("原先内容et用")
private String old_content = "";
@ElogField(dataType = DataTypeEnum.VARCHAR, length = 20, comment = "链接类型")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.VARCHAR, length = 20, comment = "链接类型")
@ApiModelProperty("链接类型et用")
private String link_type = "";
@ElogField(dataType = DataTypeEnum.BIGINT, defaultValue = "0", comment = "链接id")
@ElogField(dataType = com.engine.hrmelog.entity.dto.DataTypeEnum.BIGINT, defaultValue = "0", comment = "链接id")
@ApiModelProperty("链接idet用")
private long link_id;
@ -412,11 +412,11 @@ public class LoggerContext<T> implements Serializable {
this.operateType = operateType;
}
public List<TableChangeBean> getChangeValues() {
public List<com.engine.hrmelog.entity.dto.TableChangeBean> getChangeValues() {
return changeValues;
}
public void setChangeValues(List<TableChangeBean> changeValues) {
public void setChangeValues(List<com.engine.hrmelog.entity.dto.TableChangeBean> changeValues) {
this.changeValues = changeValues;
}
@ -492,7 +492,7 @@ public class LoggerContext<T> implements Serializable {
this.redoService = redoService;
}
public RedoContext getRedoContext() {
public com.engine.hrmelog.entity.dto.RedoContext getRedoContext() {
return redoContext;
}
@ -500,7 +500,7 @@ public class LoggerContext<T> implements Serializable {
this.redoContext = redoContext;
}
public CancelContext getCancelContext() {
public com.engine.hrmelog.entity.dto.CancelContext getCancelContext() {
return cancelContext;
}
@ -516,15 +516,15 @@ public class LoggerContext<T> implements Serializable {
this.cancelService = cancelService;
}
public List<LoggerDetailContext> getDetailContexts() {
public List<com.engine.hrmelog.entity.dto.LoggerDetailContext> getDetailContexts() {
return detailContexts;
}
public void setDetailContexts(List<LoggerDetailContext> detailContexts) {
public void setDetailContexts(List<com.engine.hrmelog.entity.dto.LoggerDetailContext> detailContexts) {
this.detailContexts = detailContexts;
}
public void addDetailContext(LoggerDetailContext loggerDetailContext) {
public void addDetailContext(com.engine.hrmelog.entity.dto.LoggerDetailContext loggerDetailContext) {
if (this.detailContexts != null) {
this.detailContexts.add(loggerDetailContext);
} else {
@ -551,7 +551,7 @@ public class LoggerContext<T> implements Serializable {
}
public void setOldValues(Object object) {
TableChangeBean bean = new TableChangeBean();
com.engine.hrmelog.entity.dto.TableChangeBean bean = new com.engine.hrmelog.entity.dto.TableChangeBean();
bean.setOldValue(object);
getChangeList().add(bean);
}
@ -567,10 +567,10 @@ public class LoggerContext<T> implements Serializable {
}
public void setNewValues(Object object) {
List<TableChangeBean> list = getChangeList();
List<com.engine.hrmelog.entity.dto.TableChangeBean> list = getChangeList();
boolean handled = false;
for (TableChangeBean bean : list) {
for (com.engine.hrmelog.entity.dto.TableChangeBean bean : list) {
if (bean.getNewValue() == null) {
bean.setNewValue(object);
handled = true;
@ -578,7 +578,7 @@ public class LoggerContext<T> implements Serializable {
}
}
if (!handled) {
TableChangeBean bean = new TableChangeBean();
com.engine.hrmelog.entity.dto.TableChangeBean bean = new com.engine.hrmelog.entity.dto.TableChangeBean();
bean.setNewValue(object);
list.add(bean);
}
@ -589,7 +589,7 @@ public class LoggerContext<T> implements Serializable {
}
public void setOldValues(Object object, String tableName, String dataId, String belongDataid, boolean isDetail) {
TableChangeBean bean = new TableChangeBean();
com.engine.hrmelog.entity.dto.TableChangeBean bean = new com.engine.hrmelog.entity.dto.TableChangeBean();
if (StringUtils.isNotEmpty(tableName))
bean.setTableName(tableName);
if (StringUtils.isNotEmpty(dataId))
@ -625,10 +625,10 @@ public class LoggerContext<T> implements Serializable {
}
public void setNewValues(Object object, String tableName, String dataId, String belongDataid, boolean isDetail) {
List<TableChangeBean> list = getChangeList();
List<com.engine.hrmelog.entity.dto.TableChangeBean> list = getChangeList();
boolean handled = false;
for (TableChangeBean bean : list) {
for (com.engine.hrmelog.entity.dto.TableChangeBean bean : list) {
if (bean.getNewValue() == null) {
bean.setNewValue(object);
if (StringUtils.isNotEmpty(tableName))
@ -644,7 +644,7 @@ public class LoggerContext<T> implements Serializable {
}
}
if (!handled) {
TableChangeBean bean = new TableChangeBean();
com.engine.hrmelog.entity.dto.TableChangeBean bean = new com.engine.hrmelog.entity.dto.TableChangeBean();
if (StringUtils.isNotEmpty(tableName))
bean.setTableName(tableName);
if (StringUtils.isNotEmpty(dataId))

@ -1,10 +1,10 @@
package com.engine.salary.elog.entity.dto;
package com.engine.hrmelog.entity.dto;
import com.engine.salary.elog.annotation.ElogDetailTable;
import com.engine.salary.elog.annotation.ElogField;
import com.engine.salary.elog.enums.ElogConsts;
import com.engine.salary.elog.annotation.ApiModel;
import com.engine.salary.elog.annotation.ApiModelProperty;
import com.engine.hrmelog.annotation.ElogDetailTable;
import com.engine.hrmelog.enums.ElogConsts;
import com.engine.hrmelog.annotation.ElogField;
import com.engine.hrmelog.annotation.ApiModel;
import com.engine.hrmelog.annotation.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;

@ -1,4 +1,4 @@
package com.engine.salary.elog.entity.dto;
package com.engine.hrmelog.entity.dto;
import java.io.Serializable;
import java.util.Date;

@ -1,7 +1,7 @@
package com.engine.salary.elog.entity.dto;
package com.engine.hrmelog.entity.dto;
import com.engine.salary.elog.annotation.ApiModel;
import com.engine.salary.elog.annotation.ApiModelProperty;
import com.engine.hrmelog.annotation.ApiModel;
import com.engine.hrmelog.annotation.ApiModelProperty;
/**
*

@ -1,4 +1,4 @@
package com.engine.salary.elog.entity.dto;
package com.engine.hrmelog.entity.dto;
import java.io.Serializable;

@ -1,7 +1,7 @@
package com.engine.salary.elog.entity.dto;
package com.engine.hrmelog.entity.dto;
import com.engine.salary.elog.annotation.ApiModel;
import com.engine.salary.elog.annotation.ApiModelProperty;
import com.engine.hrmelog.annotation.ApiModel;
import com.engine.hrmelog.annotation.ApiModelProperty;
import java.io.Serializable;

@ -1,7 +1,7 @@
package com.engine.salary.elog.entity.dto;
package com.engine.hrmelog.entity.dto;
import com.engine.salary.elog.annotation.ApiModel;
import com.engine.salary.elog.annotation.ApiModelProperty;
import com.engine.hrmelog.annotation.ApiModel;
import com.engine.hrmelog.annotation.ApiModelProperty;
/**
*
@ -27,7 +27,7 @@ public class TableColumnBean {
private String dataTypeStr;
@ApiModelProperty("字段类型")
private DataTypeEnum dataType;
private com.engine.hrmelog.entity.dto.DataTypeEnum dataType;
@ApiModelProperty("长度")
private long fieldLength;
@ -60,7 +60,7 @@ public class TableColumnBean {
this.columnType = columnType;
}
public DataTypeEnum getDataType() {
public com.engine.hrmelog.entity.dto.DataTypeEnum getDataType() {
return dataType;
}

@ -1,4 +1,4 @@
package com.engine.salary.elog.entity.param;
package com.engine.hrmelog.entity.param;
import lombok.AllArgsConstructor;
import lombok.Builder;

@ -1,4 +1,4 @@
package com.engine.salary.elog.entity.param;
package com.engine.hrmelog.entity.param;
import lombok.AllArgsConstructor;
import lombok.Builder;

@ -1,4 +1,4 @@
package com.engine.salary.elog.enums;
package com.engine.hrmelog.enums;
/**
*

@ -1,4 +1,4 @@
package com.engine.salary.elog.enums;
package com.engine.hrmelog.enums;
public enum FromTerminalType {
PC("pc","来自 pc web"),

@ -1,4 +1,4 @@
package com.engine.salary.elog.enums;
package com.engine.hrmelog.enums;
/**
* eteams-base-bean

@ -1,4 +1,4 @@
package com.engine.salary.elog.enums;
package com.engine.hrmelog.enums;
public class OperateAuditType {
//自动

@ -1,6 +1,6 @@
package com.engine.salary.mapper.elog;
package com.engine.hrmelog.mapper;
import com.engine.salary.elog.entity.dto.TableColumnBean;
import com.engine.hrmelog.entity.dto.TableColumnBean;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.engine.salary.mapper.elog.ElogTableCheckerMapper">
<mapper namespace="com.engine.hrmelog.mapper.ElogTableCheckerMapper">
<insert id="recordVersion">
insert into hrsa_elog_version (id, maintable, version) values (#{id},#{mainTable},#{version})
</insert>
@ -297,7 +297,7 @@
<!-- 获取表结构 -->
<select id="getTableStructure" resultType="com.engine.salary.elog.entity.dto.TableColumnBean" >
<select id="getTableStructure" resultType="com.engine.hrmelog.entity.dto.TableColumnBean" >
SELECT
COLUMN_NAME columnName,
DATA_TYPE dataTypeStr,
@ -312,13 +312,13 @@
table_name = #{tableName}
and TABLE_SCHEMA = (select database())
</select>
<select id="getTableStructure" resultType="com.engine.salary.elog.entity.dto.TableColumnBean" databaseId="postgresql">
<select id="getTableStructure" resultType="com.engine.hrmelog.entity.dto.TableColumnBean" databaseId="postgresql">
select *
from pg_tables
where tableowner = (select current_user)
and tablename = #{tableName}
</select>
<select id="getTableStructure" resultType="com.engine.salary.elog.entity.dto.TableColumnBean" databaseId="oracle">
<select id="getTableStructure" resultType="com.engine.hrmelog.entity.dto.TableColumnBean" databaseId="oracle">
SELECT
COLUMN_NAME columnName
FROM
@ -326,7 +326,7 @@
where
TABLE_NAME=UPPER(#{tableName})
</select>
<select id="getTableStructure" resultType="com.engine.salary.elog.entity.dto.TableColumnBean" databaseId="sqlserver">
<select id="getTableStructure" resultType="com.engine.hrmelog.entity.dto.TableColumnBean" databaseId="sqlserver">
SELECT
COLUMN_NAME columnName
FROM

@ -1,8 +1,8 @@
package com.engine.salary.mapper.elog;
package com.engine.hrmelog.mapper;
import com.engine.salary.elog.entity.dto.LoggerContext;
import com.engine.salary.elog.entity.dto.LoggerDetailContext;
import com.engine.hrmelog.entity.dto.LoggerContext;
import com.engine.hrmelog.entity.dto.LoggerDetailContext;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -22,7 +22,7 @@ public interface LocalElogAopDaoMapper {
int insertElogDetail(@Param(value="detailContext") LoggerDetailContext loggerDetailContext,
int insertElogDetail(@Param(value="detailContext") com.engine.hrmelog.entity.dto.LoggerDetailContext loggerDetailContext,
@Param(value="mainid")String mainid,
@Param(value="cusColumns")String cusColumns ,
@Param(value="cusValus")String cusValus,
@ -34,7 +34,7 @@ public interface LocalElogAopDaoMapper {
void batchInsertDetail(@Param("sql") String sql);
void insertElogDetailPrepared(@Param("tablename") String detailTableName, @Param("list") List<LoggerDetailContext> detailContexts, @Param("mainid") String mainid);
void insertElogDetailPrepared(@Param("tablename") String detailTableName, @Param("list") List<com.engine.hrmelog.entity.dto.LoggerDetailContext> detailContexts, @Param("mainid") String mainid);
void insertElogDetailPreparedHasCustonInfo(@Param("tablename") String detailTableName, @Param("list") List<LoggerDetailContext> detailContexts, @Param("mainid") String mainid, @Param(value="cusColumns")String cusColumns);

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.engine.salary.mapper.elog.LocalElogAopDaoMapper">
<mapper namespace="com.engine.hrmelog.mapper.LocalElogAopDaoMapper">
<insert id="insertElogContext">
insert into ${tableName} (id, uuid, log_date, tenant_key, modulename, functionName, operatetypename,

@ -1,7 +1,7 @@
package com.engine.salary.mapper.elog;
package com.engine.hrmelog.mapper;
import com.engine.salary.elog.entity.dto.LoggerContext;
import com.engine.salary.elog.entity.dto.ReadInfoEntity;
import com.engine.hrmelog.entity.dto.LoggerContext;
import com.engine.hrmelog.entity.dto.ReadInfoEntity;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
@ -17,20 +17,20 @@ import java.util.Map;
public interface LocalElogDaoMapper {
List<Map<String, Object>> queryCardElogList(@Param(value = "logContent") LoggerContext loggerContext,
List<Map<String, Object>> queryCardElogList(@Param(value = "logContent") com.engine.hrmelog.entity.dto.LoggerContext loggerContext,
@Param("limit") String limit,
@Param(value = "tableName") String tableName,
@Param(value = "conditionSql") String conditionSql);
List<Map> queryElogList(@Param(value = "page") Page page,
@Param(value = "logContent") LoggerContext loggerContext,
@Param(value = "logContent") com.engine.hrmelog.entity.dto.LoggerContext loggerContext,
@Param("limit") String limit,
@Param(value = "tableName") String tableName,
@Param(value = "conditionSql") String conditionSql,
@Param(value = "columns") String columns);
List<Map> queryElogListPapi(@Param(value = "page") Page page,
@Param(value = "logContent") LoggerContext loggerContext,
@Param(value = "logContent") com.engine.hrmelog.entity.dto.LoggerContext loggerContext,
@Param("limit") String limit,
@Param(value = "tableName") String tableName,
@Param(value = "conditionSql") String conditionSql,
@ -44,7 +44,7 @@ public interface LocalElogDaoMapper {
// permissionTargetId = "#{permissionTargetId}",
// permissionConfigSourceId = "#{permissionConfigSourceId}",
// permissionExcept = "true")
List<Map> queryElogList(@Param(value = "page") Page page, @Param(value = "logContent") LoggerContext loggerContext,
List<Map> queryElogList(@Param(value = "page") Page page, @Param(value = "logContent") com.engine.hrmelog.entity.dto.LoggerContext loggerContext,
@Param("limit") String limit,
@Param(value = "tableName") String tableName,
@Param(value = "conditionSql") String conditionSql,
@ -64,7 +64,7 @@ public interface LocalElogDaoMapper {
// mainDataTableAlias = "#{mainDataTableAlias}",
// primaryKey = "#{primaryKey}",
// permissionExcept = "true")
List<Map> queryElogListPapi(@Param(value = "page") Page page, @Param(value = "logContent") LoggerContext loggerContext,
List<Map> queryElogListPapi(@Param(value = "page") Page page, @Param(value = "logContent") com.engine.hrmelog.entity.dto.LoggerContext loggerContext,
@Param("limit") String limit,
@Param(value = "tableName") String tableName,
@Param(value = "conditionSql") String conditionSql,
@ -78,11 +78,11 @@ public interface LocalElogDaoMapper {
List<Map> queryAllChanges(@Param(value = "tableName") String tableName, @Param("mainid") String mainid);
Map<String, Object> elogCount(@Param(value = "logContent") LoggerContext loggerContext,
Map<String, Object> elogCount(@Param(value = "logContent") com.engine.hrmelog.entity.dto.LoggerContext loggerContext,
@Param(value = "tableName") String tableName,
@Param(value = "conditionSql") String conditionSql);
Map<String, Object> elogCountPapi(@Param(value = "logContent") LoggerContext loggerContext,
Map<String, Object> elogCountPapi(@Param(value = "logContent") com.engine.hrmelog.entity.dto.LoggerContext loggerContext,
@Param(value = "tableName") String tableName,
@Param(value = "conditionSql") String conditionSql);
@ -95,7 +95,7 @@ public interface LocalElogDaoMapper {
// permissionTargetId = "#{permissionTargetId}",
// permissionConfigSourceId = "#{permissionConfigSourceId}",
// permissionExcept = "true")
Map<String, Object> elogCountByMorePermission(@Param(value = "logContent") LoggerContext loggerContext,
Map<String, Object> elogCountByMorePermission(@Param(value = "logContent") com.engine.hrmelog.entity.dto.LoggerContext loggerContext,
@Param(value = "tableName") String tableName,
@Param(value = "conditionSql") String conditionSql,
@Param(value = "mainDataTable") String mainDataTable,
@ -115,7 +115,7 @@ public interface LocalElogDaoMapper {
// permissionConfigSourceId = "#{permissionConfigSourceId}",
// permissionCount = "count(*)",
// permissionExcept = "true")
Long elogCountOnlyNum(@Param(value = "logContent") LoggerContext loggerContext,
Long elogCountOnlyNum(@Param(value = "logContent") com.engine.hrmelog.entity.dto.LoggerContext loggerContext,
@Param(value = "tableName") String tableName,
@Param(value = "conditionSql") String conditionSql,
@Param(value = "mainDataTable") String mainDataTable,
@ -133,7 +133,7 @@ public interface LocalElogDaoMapper {
// mainDataTableAlias = "#{mainDataTableAlias}",
// primaryKey = "#{primaryKey}",
// permissionExcept = "true")
Map<String, Object> elogCount(@Param(value = "logContent") LoggerContext loggerContext,
Map<String, Object> elogCount(@Param(value = "logContent") com.engine.hrmelog.entity.dto.LoggerContext loggerContext,
@Param(value = "tableName") String tableName,
@Param(value = "conditionSql") String conditionSql,
@Param(value = "mainDataTable") String mainDataTable,
@ -148,7 +148,7 @@ public interface LocalElogDaoMapper {
// mainDataTableAlias = "#{mainDataTableAlias}",
// primaryKey = "#{primaryKey}",
// permissionExcept = "true")
Map<String, Object> elogCountPapi(@Param(value = "logContent") LoggerContext loggerContext,
Map<String, Object> elogCountPapi(@Param(value = "logContent") com.engine.hrmelog.entity.dto.LoggerContext loggerContext,
@Param(value = "tableName") String tableName,
@Param(value = "conditionSql") String conditionSql,
@Param(value = "mainDataTable") String mainDataTable,
@ -158,7 +158,7 @@ public interface LocalElogDaoMapper {
@Param(value = "primaryKey") String primaryKey);
List<Map> queryDetailElogList(@Param(value = "logContent") LoggerContext loggerContext,
List<Map> queryDetailElogList(@Param(value = "logContent") com.engine.hrmelog.entity.dto.LoggerContext loggerContext,
@Param("limit") String limit,
@Param(value = "tableName") String tableName,
@Param(value = "conditionSql") String conditionSql);
@ -171,17 +171,17 @@ public interface LocalElogDaoMapper {
// @Param(value = "targetId") String targetId,
// @Param(value = "operateType") String operateType);
List<ReadInfoEntity> queryReadInfoOperators(@Param(value = "tableName") String tableName,
@Param(value = "targetId") String targetId,
@Param(value = "operateType") String operateType,
@Param(value = "flag") Boolean flag);
List<ReadInfoEntity> queryReadInfoDateOperators(@Param(value = "tableName") String tableName,
@Param(value = "targetId") String targetId,
@Param(value = "operateType") String operateType,
@Param(value = "flag") Boolean flag,
@Param(value = "startDate") String startDate,
@Param(value = "endDate") String endDate);
List<com.engine.hrmelog.entity.dto.ReadInfoEntity> queryReadInfoOperators(@Param(value = "tableName") String tableName,
@Param(value = "targetId") String targetId,
@Param(value = "operateType") String operateType,
@Param(value = "flag") Boolean flag);
List<com.engine.hrmelog.entity.dto.ReadInfoEntity> queryReadInfoDateOperators(@Param(value = "tableName") String tableName,
@Param(value = "targetId") String targetId,
@Param(value = "operateType") String operateType,
@Param(value = "flag") Boolean flag,
@Param(value = "startDate") String startDate,
@Param(value = "endDate") String endDate);
List<Map> queryAllMainData(@Param(value = "tableName") String tableName, @Param("uuid") String uuid);

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.engine.salary.mapper.elog.LocalElogDaoMapper">
<mapper namespace="com.engine.hrmelog.mapper.LocalElogDaoMapper">
<select id="queryElogList" resultType="java.util.Map">
select ${columns},DATE_FORMAT(log_date,"%Y-%m-%d %H:%i:%S") createdate from ${tableName}
where modulename = #{logContent.moduleName} and functionname = #{logContent.functionName}
@ -189,7 +189,7 @@
<!-- group by log_operator-->
<!-- order by updateTime desc-->
<!-- </select>-->
<select id="queryReadInfoOperators" resultType="com.engine.salary.elog.entity.dto.ReadInfoEntity">
<select id="queryReadInfoOperators" resultType="com.engine.hrmelog.entity.dto.ReadInfoEntity">
select log_operator employeeId, max(log_date) date
from ${tableName}
where targetid = #{targetId}
@ -198,7 +198,7 @@
order by log_date desc
</select>
<select id="queryReadInfoOperators" resultType="com.engine.salary.elog.entity.dto.ReadInfoEntity" databaseId="postgresql">
<select id="queryReadInfoOperators" resultType="com.engine.hrmelog.entity.dto.ReadInfoEntity" databaseId="postgresql">
select log_operator employeeId, max(log_date) date
from ${tableName}
where targetid = #{targetId}
@ -207,7 +207,7 @@
order by date desc
</select>
<select id="queryReadInfoOperators" resultType="com.engine.salary.elog.entity.dto.ReadInfoEntity" databaseId="oracle">
<select id="queryReadInfoOperators" resultType="com.engine.hrmelog.entity.dto.ReadInfoEntity" databaseId="oracle">
select log_operator employeeId, max(log_date) "date"
from ${tableName}
where targetid = #{targetId}
@ -215,7 +215,7 @@
group by log_operator
order by "date" desc
</select>
<select id="queryReadInfoOperators" resultType="com.engine.salary.elog.entity.dto.ReadInfoEntity" databaseId="sqlserver">
<select id="queryReadInfoOperators" resultType="com.engine.hrmelog.entity.dto.ReadInfoEntity" databaseId="sqlserver">
select log_operator employeeId, max(log_date) "date"
from ${tableName}
where targetid = #{targetId}
@ -224,7 +224,7 @@
order by "date" desc
</select>
<select id="queryReadInfoDateOperators" resultType="com.engine.salary.elog.entity.dto.ReadInfoEntity">
<select id="queryReadInfoDateOperators" resultType="com.engine.hrmelog.entity.dto.ReadInfoEntity">
select log_operator employeeId, max(log_date) date from ${tableName} where targetid = #{targetId} and
operatetype = #{operateType}
<if test="startDate != null">
@ -236,7 +236,7 @@
group by log_operator order by log_date desc
</select>
<select id="queryReadInfoDateOperators" resultType="com.engine.salary.elog.entity.dto.ReadInfoEntity"
<select id="queryReadInfoDateOperators" resultType="com.engine.hrmelog.entity.dto.ReadInfoEntity"
databaseId="postgresql">
select log_operator employeeId, max(log_date) date from ${tableName} where targetid = #{targetId} and
operatetype = #{operateType}
@ -249,7 +249,7 @@
group by log_operator order by date desc
</select>
<select id="queryReadInfoDateOperators" resultType="com.engine.salary.elog.entity.dto.ReadInfoEntity" databaseId="oracle">
<select id="queryReadInfoDateOperators" resultType="com.engine.hrmelog.entity.dto.ReadInfoEntity" databaseId="oracle">
select log_operator employeeId, max(log_date) "date" from ${tableName} where targetid = #{targetId} and
operatetype = #{operateType}
<if test="startDate != null">
@ -261,7 +261,7 @@
group by log_operator order by "date" desc
</select>
<select id="queryReadInfoDateOperators" resultType="com.engine.salary.elog.entity.dto.ReadInfoEntity"
<select id="queryReadInfoDateOperators" resultType="com.engine.hrmelog.entity.dto.ReadInfoEntity"
databaseId="sqlserver">
select log_operator employeeId, max(log_date) "date" from ${tableName} where targetid = #{targetId} and
operatetype = #{operateType}
@ -347,7 +347,7 @@
order by showorder asc, id asc
</select>
<select id="queryTenantKeyOperators" resultType="com.engine.salary.elog.entity.dto.ReadInfoEntity">
<select id="queryTenantKeyOperators" resultType="com.engine.hrmelog.entity.dto.ReadInfoEntity">
select log_operator employeeId, max(log_date) date
from ${tableName}
where tenant_key = #{tenantKey}
@ -357,7 +357,7 @@
order by date desc
</select>
<select id="queryTenantKeyOperators" resultType="com.engine.salary.elog.entity.dto.ReadInfoEntity" databaseId="postgresql">
<select id="queryTenantKeyOperators" resultType="com.engine.hrmelog.entity.dto.ReadInfoEntity" databaseId="postgresql">
select log_operator employeeId, max(log_date) date
from ${tableName}
where tenant_key = #{tenantKey}
@ -368,7 +368,7 @@
</select>
<select id="queryTenantKeyOperators" resultType="com.engine.salary.elog.entity.dto.ReadInfoEntity" databaseId="oracle">
<select id="queryTenantKeyOperators" resultType="com.engine.hrmelog.entity.dto.ReadInfoEntity" databaseId="oracle">
select log_operator employeeId, max(log_date) "date"
from ${tableName}
where tenant_key = #{tenantKey}
@ -377,7 +377,7 @@
group by log_operator
order by "date" desc
</select>
<select id="queryTenantKeyOperators" resultType="com.engine.salary.elog.entity.dto.ReadInfoEntity" databaseId="sqlserver">
<select id="queryTenantKeyOperators" resultType="com.engine.hrmelog.entity.dto.ReadInfoEntity" databaseId="sqlserver">
select log_operator employeeId, max(log_date) "date"
from ${tableName}
where tenant_key = #{tenantKey}

@ -1,4 +1,4 @@
package com.engine.salary.mapper.elog;
package com.engine.hrmelog.mapper;
import java.util.Map;

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.engine.salary.mapper.elog.QueryCurretValusMapper">
<mapper namespace="com.engine.hrmelog.mapper.QueryCurretValusMapper">
<select id="queryValues" resultType="java.util.Map">
${querySql} limit 1

@ -1,7 +1,7 @@
package com.engine.salary.elog.service;
package com.engine.hrmelog.service;
import com.engine.salary.elog.entity.dto.LoggerContext;
import com.engine.salary.elog.entity.dto.LoggerDetailContext;
import com.engine.hrmelog.entity.dto.LoggerContext;
import com.engine.hrmelog.entity.dto.LoggerDetailContext;
public interface ILocalElogService {

@ -1,9 +1,9 @@
package com.engine.salary.elog.service;
package com.engine.hrmelog.service;
import com.cloudstore.eccom.pc.table.WeaTable;
import com.engine.salary.elog.entity.param.ELogGetLogParam;
import com.engine.salary.elog.entity.param.GetDetailChangesParam;
import com.engine.salary.elog.util.page.PageInfo;
import com.engine.hrmelog.entity.param.ELogGetLogParam;
import com.engine.hrmelog.entity.param.GetDetailChangesParam;
import com.engine.hrmelog.util.page.PageInfo;
import javax.servlet.http.HttpServletRequest;
import java.util.List;

@ -1,15 +1,15 @@
package com.engine.salary.elog.service.impl;
package com.engine.hrmelog.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.engine.salary.elog.entity.dto.LoggerContext;
import com.engine.salary.elog.entity.dto.LoggerDetailContext;
import com.engine.salary.elog.enums.ElogConsts;
import com.engine.salary.elog.service.ILocalElogService;
import com.engine.salary.elog.util.ElogUtils;
import com.engine.salary.elog.util.db.IdGenerator;
import com.engine.salary.elog.util.db.MapperProxyFactory;
import com.engine.salary.mapper.elog.LocalElogAopDaoMapper;
import com.engine.hrmelog.entity.dto.LoggerContext;
import com.engine.hrmelog.entity.dto.LoggerDetailContext;
import com.engine.hrmelog.enums.ElogConsts;
import com.engine.hrmelog.util.ElogUtils;
import com.engine.hrmelog.util.db.IdGenerator;
import com.engine.hrmelog.service.ILocalElogService;
import com.engine.hrmelog.util.db.MapperProxyFactory;
import com.engine.hrmelog.mapper.LocalElogAopDaoMapper;
import com.google.common.collect.Lists;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@ -50,7 +50,7 @@ public class LocalElogService implements ILocalElogService {
* @return
*/
@Override
public <T> int insertLocalElog(LoggerContext<T> context) {
public <T> int insertLocalElog(com.engine.hrmelog.entity.dto.LoggerContext<T> context) {
if (StringUtils.isEmpty(context.getUuid())) {
context.setUuid(UUID.randomUUID().toString().replace("-", ""));
}
@ -71,7 +71,7 @@ public class LocalElogService implements ILocalElogService {
if (ElogConsts.ORACLE.equals(databaseId)) {
//clob字段集合不为空且包含此字段
if (!CollectionUtils.isEmpty(clobFieldList) && clobFieldList.contains(key)) {
String clobColumnStr = ElogUtils.handleClobColumn(keystr);
String clobColumnStr = com.engine.hrmelog.util.ElogUtils.handleClobColumn(keystr);
cusValus = cusValus + ",TO_CLOB( " + clobColumnStr + " )";
} else if (checkStrIsDate(keystr)) {
//并且字符串为时间类型格式 则进行特殊处理
@ -110,10 +110,10 @@ public class LocalElogService implements ILocalElogService {
* @param detailTableName
* @param context
*/
private void insertBatchDetailPrepared(String detailTableName, LoggerContext context) {
private void insertBatchDetailPrepared(String detailTableName, com.engine.hrmelog.entity.dto.LoggerContext context) {
// 用mapper
//分两种 有无自定义字段
List<LoggerDetailContext> detailContexts = context.getDetailContexts();
List<com.engine.hrmelog.entity.dto.LoggerDetailContext> detailContexts = context.getDetailContexts();
Boolean hasCustonInfo = false;
String cusColumns = "";
if (Objects.nonNull(detailContexts.get(0).getCustomDetailInfo())) {
@ -125,7 +125,7 @@ public class LocalElogService implements ILocalElogService {
}
}
for (LoggerDetailContext detailContext : detailContexts) {
for (com.engine.hrmelog.entity.dto.LoggerDetailContext detailContext : detailContexts) {
if (StringUtils.isNotEmpty(detailContext.getNewValue())) {
String str = detailContext.getNewValue().replaceAll("[\\x{1F600}-\\x{1F64F}\\x{1F300}-\\x{1F5FF}]", "");
detailContext.setNewValue(str);
@ -148,7 +148,7 @@ public class LocalElogService implements ILocalElogService {
detailContext.setCreate_time(new Date());
detailContext.setUpdate_time(new Date());
detailContext.setCreator(context.getLogOperator());
detailContext.setId(IdGenerator.generate());
detailContext.setId(com.engine.hrmelog.util.db.IdGenerator.generate());
if (hasCustonInfo) {
String cusValus = "";
//如果有明细
@ -167,12 +167,12 @@ public class LocalElogService implements ILocalElogService {
if (hasCustonInfo) {
List<List<LoggerDetailContext>> partition = Lists.partition(detailContexts, 50);
List<List<com.engine.hrmelog.entity.dto.LoggerDetailContext>> partition = Lists.partition(detailContexts, 50);
for (int i = 0; i < partition.size(); i++) {
getLocalElogAopDaoMapper().insertElogDetailPreparedHasCustonInfo(detailTableName, partition.get(i), context.getUuid(), cusColumns);
}
} else {
List<List<LoggerDetailContext>> partition = Lists.partition(detailContexts, 50);
List<List<com.engine.hrmelog.entity.dto.LoggerDetailContext>> partition = Lists.partition(detailContexts, 50);
partition.forEach(part -> {
getLocalElogAopDaoMapper().insertElogDetailPrepared(detailTableName, part, context.getUuid());
});
@ -180,7 +180,7 @@ public class LocalElogService implements ILocalElogService {
}
private <T> void normalizationContext(LoggerContext<T> context) {
private <T> void normalizationContext(com.engine.hrmelog.entity.dto.LoggerContext<T> context) {
String params = "";
if (StringUtils.isNotEmpty(context.getParamsStr())) {
params = context.getParamsStr();
@ -232,14 +232,14 @@ public class LocalElogService implements ILocalElogService {
}
}
private void insertBatchDetailSql(String detailTableName, LoggerContext context) {
private void insertBatchDetailSql(String detailTableName, com.engine.hrmelog.entity.dto.LoggerContext context) {
String standardField = "id, mainid, uuid, tablename, fieldname, newvalue, oldvalue, fielddesc, showorder, dataid, belongDataid, isDetail, tenant_key,creator, newRealValue, oldRealValue,tableNameDesc, tableNameLabelId,fieldNameLabelId, create_time, update_time";
Boolean hasCustonInfo = false;
StringBuilder sb = new StringBuilder();
sb.append("INSERT INTO ").append(detailTableName).append("(").append(standardField);
//List<LoggerDetailContext> collect = detailContexts.stream().filter(s -> Objects.nonNull(s.getCustomDetailInfo())).collect(Collectors.toList());
List<LoggerDetailContext> detailContexts = context.getDetailContexts();
List<com.engine.hrmelog.entity.dto.LoggerDetailContext> detailContexts = context.getDetailContexts();
if (Objects.nonNull(detailContexts.get(0).getCustomDetailInfo())) {
hasCustonInfo = true;
//有自定义明细字段
@ -272,12 +272,12 @@ public class LocalElogService implements ILocalElogService {
LocalDateTime localDateTime = LocalDateTime.now();
String nowDate = localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
List<LoggerDetailContext> detailContexts = context.getDetailContexts();
List<com.engine.hrmelog.entity.dto.LoggerDetailContext> detailContexts = context.getDetailContexts();
List<String> batchValue = new ArrayList<>();
for (LoggerDetailContext detailContext : detailContexts) {
for (com.engine.hrmelog.entity.dto.LoggerDetailContext detailContext : detailContexts) {
detailContext.setTenant_key(context.getTenant_key());
detailContext.setCreator(context.getLogOperator());
detailContext.setId(IdGenerator.generate());
detailContext.setId(com.engine.hrmelog.util.db.IdGenerator.generate());
StringBuilder sb = new StringBuilder();
sb.append(isOracle ? " SELECT " : " ( ");

@ -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避免部分模块为123这类的操作类型
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);
}

@ -1,18 +1,18 @@
package com.engine.salary.elog.threadlocal;
package com.engine.hrmelog.threadlocal;
import com.alibaba.fastjson.JSONObject;
import com.engine.salary.elog.entity.dto.LoggerContext;
import com.engine.hrmelog.entity.dto.LoggerContext;
import java.util.ArrayList;
import java.util.List;
public class ElogThreadLocal {
private static final ThreadLocal<List<LoggerContext>> loggerContextList = new ThreadLocal<>();
private static final ThreadLocal<List<com.engine.hrmelog.entity.dto.LoggerContext>> loggerContextList = new ThreadLocal<>();
private static final ThreadLocal<JSONObject> requestBody = new ThreadLocal<>();
public static LoggerContext currentLoggerContext() {
List<LoggerContext> list = loggerContextList.get();
public static com.engine.hrmelog.entity.dto.LoggerContext currentLoggerContext() {
List<com.engine.hrmelog.entity.dto.LoggerContext> list = loggerContextList.get();
if(list == null || list.size() == 0) {
return null;
@ -21,10 +21,10 @@ public class ElogThreadLocal {
}
}
public static void addLoggerContext(LoggerContext loggerContext) {
public static void addLoggerContext(com.engine.hrmelog.entity.dto.LoggerContext loggerContext) {
if(loggerContext == null)
return;
List<LoggerContext> list = loggerContextList.get();
List<com.engine.hrmelog.entity.dto.LoggerContext> list = loggerContextList.get();
if(list == null) {
list = new ArrayList<>();
loggerContextList.set(list);
@ -34,7 +34,7 @@ public class ElogThreadLocal {
}
public static List<LoggerContext> getLoggerContextList() {
public static List<com.engine.hrmelog.entity.dto.LoggerContext> getLoggerContextList() {
return loggerContextList.get();
}

@ -1,11 +1,11 @@
package com.engine.salary.elog.util;
package com.engine.hrmelog.util;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.engine.salary.elog.entity.dto.ElogBean;
import com.engine.salary.elog.entity.dto.FilterConditionDto;
import com.engine.salary.elog.entity.dto.ShowColumsDto;
import com.engine.salary.elog.enums.ElogConsts;
import com.engine.hrmelog.enums.ElogConsts;
import com.engine.hrmelog.entity.dto.ElogBean;
import com.engine.hrmelog.entity.dto.FilterConditionDto;
import com.engine.hrmelog.entity.dto.ShowColumsDto;
import java.util.List;
import java.util.Map;
@ -25,7 +25,7 @@ public class ElogServiceUtils {
}
public static String getTableName(String module, String function, boolean isDetail) {
String tablename = module + ElogConsts.TABLE_SPACER + function + ElogConsts.TABLE_SUFFIX + (isDetail ? ElogConsts.DETAIL_TABLE_SUFFIX : "");
String tablename = module + com.engine.hrmelog.enums.ElogConsts.TABLE_SPACER + function + com.engine.hrmelog.enums.ElogConsts.TABLE_SUFFIX + (isDetail ? ElogConsts.DETAIL_TABLE_SUFFIX : "");
sqlCheck(tablename);
return tablename;
}

@ -1,4 +1,4 @@
package com.engine.salary.elog.util;
package com.engine.hrmelog.util;
import cn.hutool.core.map.CaseInsensitiveMap;
import com.alibaba.druid.proxy.jdbc.ClobProxyImpl;
@ -7,9 +7,8 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.cloudstore.eccom.pc.table.WeaTable;
import com.cloudstore.eccom.pc.table.WeaTableColumn;
import com.engine.salary.elog.annotation.OperateType;
import com.engine.salary.elog.enums.ElogConsts;
import com.engine.salary.elog.util.SalaryI18nUtil;
import com.engine.hrmelog.enums.ElogConsts;
import com.engine.hrmelog.annotation.OperateType;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -519,7 +518,7 @@ public class ElogSeviceSwitchUtils {
while (iterator.hasNext()) {
Map.Entry<String, Object> entry = iterator.next();
if (entry.getValue() instanceof Integer || entry.getValue() instanceof Long || entry.getValue() instanceof String) {
map.put(entry.getKey(), transfLanguageLableid(ElogSeviceUtils.getLongValue(entry.getValue().toString()), entry.getValue().toString()));
map.put(entry.getKey(), transfLanguageLableid(com.engine.hrmelog.util.ElogSeviceUtils.getLongValue(entry.getValue().toString()), entry.getValue().toString()));
} else {
map.put(entry.getKey(), entry.getValue());
}
@ -549,7 +548,7 @@ public class ElogSeviceSwitchUtils {
}
public static String transfLanguageLableid(Long lableid) {
return SalaryI18nUtil.getI18nLabel(Integer.parseInt(lableid.toString()), lableid.toString());
return I18nUtil.getI18nLabel(Integer.parseInt(lableid.toString()), lableid.toString());
}
/**
@ -560,7 +559,7 @@ public class ElogSeviceSwitchUtils {
* @return
*/
public static String transfLanguageLableid(Long lableid, String def) {
return SalaryI18nUtil.getI18nLabel(Integer.parseInt(lableid.toString()), def);
return I18nUtil.getI18nLabel(Integer.parseInt(lableid.toString()), def);
}
@ -757,8 +756,8 @@ public class ElogSeviceSwitchUtils {
}
public static String valueChangeFormat() {
return "【%s】" + SalaryI18nUtil.getI18nLabel(61695, "由") +
"[%s] " + SalaryI18nUtil.getI18nLabel(61697, "改为") + " [%s]";
return "【%s】" + I18nUtil.getI18nLabel(61695, "由") +
"[%s] " + I18nUtil.getI18nLabel(61697, "改为") + " [%s]";
}
public static void changKey2Lower(List<Map> list) {
@ -796,15 +795,15 @@ public class ElogSeviceSwitchUtils {
map = new CaseInsensitiveMap<>(hashMap);
List<Map> detailmap = new ArrayList<>();
HashMap<String, Object> detailoldMap = new HashMap<>();
detailoldMap.put("operator", SalaryI18nUtil.getI18nLabel(63248, "操作(旧)"));
detailoldMap.put("operator", I18nUtil.getI18nLabel(63248, "操作(旧)"));
detailoldMap.put("dataid", map.get("dataid"));
HashMap<String, Object> detailnewMap = new HashMap<>();
detailnewMap.put("operator", SalaryI18nUtil.getI18nLabel(63249, "操作(新)"));
detailnewMap.put("operator", I18nUtil.getI18nLabel(63249, "操作(新)"));
detailnewMap.put("dataid", map.get("dataid"));
detailmap.add(detailoldMap);
detailmap.add(detailnewMap);
WeaTable wea = new WeaTable();
wea.getColumns().add(new WeaTableColumn("5%",SalaryI18nUtil.getI18nLabel(63250, "操作"), "operator"));
wea.getColumns().add(new WeaTableColumn("5%", I18nUtil.getI18nLabel(63250, "操作"), "operator"));
// wea.getColumns().add(new WeaTableColumn("dataid", "dataid", true));
Object tablename = map.get("tablename");
Object tablenamelabelid = map.get("tablenamelabelid");
@ -934,9 +933,9 @@ public class ElogSeviceSwitchUtils {
if (dataId.equals(data_id)) {
Object operator = detail.get("operator");
if (operator != null) {
if (SalaryI18nUtil.getI18nLabel(63248, "操作(旧)").equals(operator.toString())) {
if (I18nUtil.getI18nLabel(63248, "操作(旧)").equals(operator.toString())) {
detail.put(dataIndex, oldValue);
} else if (SalaryI18nUtil.getI18nLabel(63249, "操作(新)").equals(operator.toString())) {
} else if (I18nUtil.getI18nLabel(63249, "操作(新)").equals(operator.toString())) {
detail.put(dataIndex, newValue);
}
}
@ -946,19 +945,19 @@ public class ElogSeviceSwitchUtils {
if (dataId.equals(newDetail.get("dataid"))) {
Object operator = detail.get("operator");
if (operator != null) {
if (SalaryI18nUtil.getI18nLabel(63248, "操作(旧)").equals(operator.toString())) {
if (I18nUtil.getI18nLabel(63248, "操作(旧)").equals(operator.toString())) {
detail.put(dataIndex, oldValue);
} else if (SalaryI18nUtil.getI18nLabel(63249, "操作(新)").equals(operator.toString())) {
} else if (I18nUtil.getI18nLabel(63249, "操作(新)").equals(operator.toString())) {
detail.put(dataIndex, newValue);
}
}
} else {
HashMap<String, Object> detailoldMap = new HashMap<>();
detailoldMap.put("operator", SalaryI18nUtil.getI18nLabel(63248, "操作(旧)"));
detailoldMap.put("operator", I18nUtil.getI18nLabel(63248, "操作(旧)"));
detailoldMap.put("dataid", map.get("dataid"));
detailoldMap.put(dataIndex, oldValue);
HashMap<String, Object> detailnewMap = new HashMap<>();
detailnewMap.put("operator", SalaryI18nUtil.getI18nLabel(63249, "操作(新)"));
detailnewMap.put("operator", I18nUtil.getI18nLabel(63249, "操作(新)"));
detailnewMap.put("dataid", map.get("dataid"));
detailnewMap.put(dataIndex, newValue);
newDetails.add(detailoldMap);
@ -975,11 +974,11 @@ public class ElogSeviceSwitchUtils {
}
if (count == 0) {
HashMap<String, Object> detailoldMap = new HashMap<>();
detailoldMap.put("operator", SalaryI18nUtil.getI18nLabel(63248, "操作(旧)"));
detailoldMap.put("operator", I18nUtil.getI18nLabel(63248, "操作(旧)"));
detailoldMap.put("dataid", map.get("dataid"));
detailoldMap.put(dataIndex, oldValue);
HashMap<String, Object> detailnewMap = new HashMap<>();
detailnewMap.put("operator", SalaryI18nUtil.getI18nLabel(63249, "操作(新)"));
detailnewMap.put("operator", I18nUtil.getI18nLabel(63249, "操作(新)"));
detailnewMap.put("dataid", map.get("dataid"));
detailnewMap.put(dataIndex, newValue);
newDetails.add(detailoldMap);
@ -1034,15 +1033,15 @@ public class ElogSeviceSwitchUtils {
for (Map detailContext : detailContexts) {
List<Map> detailmap = new ArrayList<>();
HashMap<String, Object> detailoldMap = new HashMap<>();
detailoldMap.put("operator", SalaryI18nUtil.getI18nLabel(63248, "操作(旧)"));
detailoldMap.put("operator", I18nUtil.getI18nLabel(63248, "操作(旧)"));
detailoldMap.put("dataid", detailContext.get("dataid"));
HashMap<String, Object> detailnewMap = new HashMap<>();
detailnewMap.put("operator", SalaryI18nUtil.getI18nLabel(63249, "操作(新)"));
detailnewMap.put("operator", I18nUtil.getI18nLabel(63249, "操作(新)"));
detailnewMap.put("dataid", detailContext.get("dataid"));
detailmap.add(detailoldMap);
detailmap.add(detailnewMap);
WeaTable wea = new WeaTable();
wea.getColumns().add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(63250, "操作"), "operator", "5%"));
wea.getColumns().add(new WeaTableColumn(I18nUtil.getI18nLabel(63250, "操作"), "operator", "5%"));
// wea.getColumns().add(new WeaTableColumn("dataid", "dataid", true));
Object tableName = detailContext.get("tableName");
Object tablenamelabelid = detailContext.get("tableNameLabelId");
@ -1173,9 +1172,9 @@ public class ElogSeviceSwitchUtils {
if (dataId.equals(data_id)) {
Object operator = d.get("operator");
if (operator != null) {
if (SalaryI18nUtil.getI18nLabel(63248, "操作(旧)").equals(operator.toString())) {
if (I18nUtil.getI18nLabel(63248, "操作(旧)").equals(operator.toString())) {
d.put(dataIndex, oldValue);
} else if (SalaryI18nUtil.getI18nLabel(63249, "操作(新)").equals(operator.toString())) {
} else if (I18nUtil.getI18nLabel(63249, "操作(新)").equals(operator.toString())) {
d.put(dataIndex, newValue);
}
}
@ -1185,19 +1184,19 @@ public class ElogSeviceSwitchUtils {
if (dataId.equals(newDetail.get("dataid"))) {
Object operator = d.get("operator");
if (operator != null) {
if (SalaryI18nUtil.getI18nLabel(63248, "操作(旧)").equals(operator.toString())) {
if (I18nUtil.getI18nLabel(63248, "操作(旧)").equals(operator.toString())) {
d.put(dataIndex, oldValue);
} else if (SalaryI18nUtil.getI18nLabel(63249, "操作(新)").equals(operator.toString())) {
} else if (I18nUtil.getI18nLabel(63249, "操作(新)").equals(operator.toString())) {
d.put(dataIndex, newValue);
}
}
} else {
HashMap<String, Object> detailoldMap = new HashMap<>();
detailoldMap.put("operator", SalaryI18nUtil.getI18nLabel(63248, "操作(旧)"));
detailoldMap.put("operator", I18nUtil.getI18nLabel(63248, "操作(旧)"));
detailoldMap.put("dataid", detailContext.get("dataid"));
detailoldMap.put(dataIndex, oldValue);
HashMap<String, Object> detailnewMap = new HashMap<>();
detailnewMap.put("operator", SalaryI18nUtil.getI18nLabel(63249, "操作(新)"));
detailnewMap.put("operator", I18nUtil.getI18nLabel(63249, "操作(新)"));
detailnewMap.put("dataid", detailContext.get("dataid"));
detailnewMap.put(dataIndex, newValue);
newDetails.add(detailoldMap);
@ -1214,11 +1213,11 @@ public class ElogSeviceSwitchUtils {
}
if (count == 0) {
HashMap<String, Object> detailoldMap = new HashMap<>();
detailoldMap.put("operator", SalaryI18nUtil.getI18nLabel(63248, "操作(旧)"));
detailoldMap.put("operator", I18nUtil.getI18nLabel(63248, "操作(旧)"));
detailoldMap.put("dataid", detailContext.get("dataid"));
detailoldMap.put(dataIndex, oldValue);
HashMap<String, Object> detailnewMap = new HashMap<>();
detailnewMap.put("operator", SalaryI18nUtil.getI18nLabel(63249, "操作(新)"));
detailnewMap.put("operator", I18nUtil.getI18nLabel(63249, "操作(新)"));
detailnewMap.put("dataid", detailContext.get("dataid"));
detailnewMap.put(dataIndex, newValue);
newDetails.add(detailoldMap);
@ -1270,7 +1269,7 @@ public class ElogSeviceSwitchUtils {
public static List getSwitchDatabaseData(List<Map> list) {
String databaseId = new RecordSet().getDBType();
if (ElogConsts.ORACLE.equalsIgnoreCase(databaseId) || ElogConsts.SQLSERVER.equalsIgnoreCase(databaseId)) {
if (com.engine.hrmelog.enums.ElogConsts.ORACLE.equalsIgnoreCase(databaseId) || com.engine.hrmelog.enums.ElogConsts.SQLSERVER.equalsIgnoreCase(databaseId)) {
List<Map> arrayList = new ArrayList<>();
for (Map map : list) {
Set<Map.Entry> en = map.entrySet();
@ -1335,8 +1334,8 @@ public class ElogSeviceSwitchUtils {
return hashMap;
}
for (String module : modules) {
String modulenum = ElogSeviceUtils.null2String(moduleMap.get(module), module);
String modulename = ElogSeviceUtils.isLongValue(modulenum) ? SalaryI18nUtil.getI18nLabel(Integer.parseInt(modulenum), modulenum) : modulenum;
String modulenum = com.engine.hrmelog.util.ElogSeviceUtils.null2String(moduleMap.get(module), module);
String modulename = ElogSeviceUtils.isLongValue(modulenum) ? I18nUtil.getI18nLabel(Integer.parseInt(modulenum), modulenum) : modulenum;
hashMap.put(module, modulename);
}
return hashMap;
@ -1391,7 +1390,7 @@ public class ElogSeviceSwitchUtils {
moduleMap.forEach((k, v) -> {
List<String> list = new ArrayList<>();
Integer moduleCode = moduleMap.get(k);
String htmlLabelName = SalaryI18nUtil.getI18nLabel(moduleCode, "");
String htmlLabelName = I18nUtil.getI18nLabel(moduleCode, "");
if (dataMap.containsKey(htmlLabelName)) {
list = dataMap.get(htmlLabelName);
list.add(k);

@ -1,8 +1,8 @@
package com.engine.salary.elog.util;
package com.engine.hrmelog.util;
import com.engine.salary.elog.entity.dto.LoggerContext;
import com.engine.salary.elog.enums.FromTerminalType;
import com.engine.hrmelog.entity.dto.LoggerContext;
import com.engine.hrmelog.enums.FromTerminalType;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -377,17 +377,17 @@ public class ElogSeviceUtils {
String setFT = "";
if (StringUtils.isNotEmpty(device)) {
if (!device.contains("wxwork") && device.contains("MicroMessenger")) {//来自微信
setFT = FromTerminalType.MICO_MSG.getCode();
setFT = com.engine.hrmelog.enums.FromTerminalType.MICO_MSG.getCode();
} else if (device.contains("wxwork") && device.contains("MicroMessenger")) {//企业微信
setFT = FromTerminalType.WECHAT.getCode();
setFT = com.engine.hrmelog.enums.FromTerminalType.WECHAT.getCode();
} else if (device.contains("iPhone") && device.contains("Mac")) {//来自 Iphone
setFT = FromTerminalType.IOS.getCode();
setFT = com.engine.hrmelog.enums.FromTerminalType.IOS.getCode();
} else if (device.contains("Mac OS") && !device.contains("iPhone") && device.contains("weapp-pc")) {//来自 mac_client
setFT = FromTerminalType.MAC_CLIENT.getCode();//mac_client
setFT = com.engine.hrmelog.enums.FromTerminalType.MAC_CLIENT.getCode();//mac_client
} else if (!device.contains("wxwork") && device.contains("Mobile")) {//移动端
setFT = FromTerminalType.H5.getCode();
setFT = com.engine.hrmelog.enums.FromTerminalType.H5.getCode();
} else if (device.contains("Android") && !device.contains("wxwork")) {//来自安卓 包含安卓并且不包含微信
setFT = FromTerminalType.ANDROID.getCode();
setFT = com.engine.hrmelog.enums.FromTerminalType.ANDROID.getCode();
} else {//pc
setFT = FromTerminalType.PC.getCode();
}

@ -1,15 +1,14 @@
package com.engine.salary.elog.util;
package com.engine.hrmelog.util;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.engine.salary.elog.entity.dto.LoggerContext;
import com.engine.salary.elog.enums.FromTerminalType;
import com.engine.salary.elog.threadlocal.ElogThreadLocal;
import com.engine.hrmelog.entity.dto.LoggerContext;
import com.engine.hrmelog.enums.FromTerminalType;
import com.engine.hrmelog.threadlocal.ElogThreadLocal;
import org.apache.commons.lang3.StringUtils;
import org.apache.dubbo.common.utils.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import weaver.hrm.User;
import javax.servlet.http.HttpServletRequest;

@ -1,4 +1,4 @@
package com.engine.salary.elog.util;
package com.engine.hrmelog.util;
import org.apache.commons.lang3.StringUtils;

@ -1,4 +1,4 @@
package com.engine.salary.elog.util;
package com.engine.hrmelog.util;
/**
*
@ -8,7 +8,7 @@ package com.engine.salary.elog.util;
* @author qiantao
* @version 1.0
**/
public class SalaryI18nUtil {
public class I18nUtil {
/**
*

@ -1,18 +1,18 @@
package com.engine.salary.elog.util;
package com.engine.hrmelog.util;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.parser.Feature;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.engine.salary.elog.annotation.ElogTransform;
import com.engine.salary.elog.async.LoggerMessageListener;
import com.engine.salary.elog.entity.dto.LoggerContext;
import com.engine.salary.elog.entity.dto.LoggerDetailContext;
import com.engine.salary.elog.entity.dto.TableChangeBean;
import com.engine.salary.elog.util.db.IdGenerator;
import com.engine.salary.elog.annotation.ApiModel;
import com.engine.salary.elog.annotation.ApiModelProperty;
import com.engine.hrmelog.annotation.ElogTransform;
import com.engine.hrmelog.async.LoggerMessageListener;
import com.engine.hrmelog.entity.dto.LoggerContext;
import com.engine.hrmelog.entity.dto.LoggerDetailContext;
import com.engine.hrmelog.entity.dto.TableChangeBean;
import com.engine.hrmelog.util.db.IdGenerator;
import com.engine.hrmelog.annotation.ApiModel;
import com.engine.hrmelog.annotation.ApiModelProperty;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;

@ -1,4 +1,4 @@
package com.engine.salary.elog.util;
package com.engine.hrmelog.util;
/**
*

@ -1,4 +1,4 @@
package com.engine.salary.elog.util;
package com.engine.hrmelog.util;
import com.alibaba.fastjson.JSONObject;
@ -6,7 +6,6 @@ import com.alibaba.fastjson.serializer.SerializerFeature;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import weaver.general.BaseBean;
import weaver.hrm.User;
import java.util.HashMap;
@ -42,10 +41,10 @@ public class ResponseResult<T, R> {
try {
return Ok(f.apply(t));
} catch (RuntimeException e) {
log.error("salary api run fail , param {}", t, e);
log.error("hrmelog api run fail , param {}", t, e);
return Error(e.getMessage());
} catch (Exception e) {
log.error("salary api run fail , param {}", t, e);
log.error("hrmelog api run fail , param {}", t, e);
return Error("系统异常!");
}
}
@ -58,10 +57,10 @@ public class ResponseResult<T, R> {
f.accept(t);
return Ok();
} catch (RuntimeException e) {
log.error("salary api run fail , param {}", t, e);
log.error("hrmelog api run fail , param {}", t, e);
return Error(e.getMessage());
} catch (Exception e) {
log.error("salary api run fail , param {}", t, e);
log.error("hrmelog api run fail , param {}", t, e);
return Error("系统异常!", e);
}
}
@ -74,10 +73,10 @@ public class ResponseResult<T, R> {
try {
return Ok(f.get());
} catch (RuntimeException e) {
log.error("salary api run fail", e);
log.error("hrmelog api run fail", e);
return Error(e.getMessage());
} catch (Exception e) {
log.error("salary api run fail", e);
log.error("hrmelog api run fail", e);
return Error("系统异常!", e);
}
}

@ -1,4 +1,4 @@
package com.engine.salary.elog.util.db;
package com.engine.hrmelog.util.db;
import java.util.concurrent.atomic.AtomicLong;

@ -1,7 +1,7 @@
/**
*
*/
package com.engine.salary.elog.util.db;
package com.engine.hrmelog.util.db;
import org.apache.ibatis.session.SqlSession;
import weaver.conn.mybatis.MyBatisFactory;

@ -1,4 +1,4 @@
package com.engine.salary.elog.util.page;
package com.engine.hrmelog.util.page;
import lombok.AllArgsConstructor;
import lombok.Builder;

@ -1,4 +1,4 @@
package com.engine.salary.elog.util.page;
package com.engine.hrmelog.util.page;
import lombok.Data;

@ -1,7 +1,5 @@
package com.engine.salary.elog.util.page;
package com.engine.hrmelog.util.page;
import com.engine.salary.elog.util.page.Column;
import com.engine.salary.elog.util.page.DataSource;
import lombok.Data;
import lombok.ToString;
@ -14,11 +12,11 @@ import java.util.List;
public class PageInfo<T> extends com.github.pagehelper.PageInfo<T> {
Class<T> clazz;
public void setColumns(List<Column> columns) {
public void setColumns(List<com.engine.hrmelog.util.page.Column> columns) {
this.columns.addAll(columns);
}
List<Column> columns = new ArrayList<>();
List<com.engine.hrmelog.util.page.Column> columns = new ArrayList<>();
List<DataSource> dataSource = new ArrayList<>();
public PageInfo() {
@ -40,7 +38,7 @@ public class PageInfo<T> extends com.github.pagehelper.PageInfo<T> {
}
public List<Column> buildColumns() {
public List<com.engine.hrmelog.util.page.Column> buildColumns() {
if(clazz==null){
return this.columns;
}
@ -53,7 +51,7 @@ public class PageInfo<T> extends com.github.pagehelper.PageInfo<T> {
String dataIndex = annotation.dataIndex();
String key = annotation.key();
boolean display = annotation.display();
Column column = Column.builder().title(title).dataIndex(dataIndex).key(key).display(display).build();
com.engine.hrmelog.util.page.Column column = Column.builder().title(title).dataIndex(dataIndex).key(key).display(display).build();
columns.add(column);
}
}

@ -1,6 +1,5 @@
package com.engine.salary.elog.util.page;
package com.engine.hrmelog.util.page;
import com.engine.salary.elog.util.page.PageInfo;
import com.github.pagehelper.PageHelper;
import org.apache.commons.collections4.CollectionUtils;
@ -12,7 +11,7 @@ import java.util.Collections;
import java.util.List;
public class SalaryPageUtil {
public class PageUtil {
public static void start(Integer pageNum, Integer pageSize) {
pageNum = pageNum == null || pageNum <= 0 ? 1 : pageNum;
@ -21,28 +20,28 @@ public class SalaryPageUtil {
}
public static <T> com.engine.salary.elog.util.page.PageInfo<T> buildPage(Integer pageNo, Integer pageSize) {
public static <T> PageInfo<T> buildPage(Integer pageNo, Integer pageSize) {
pageNo = pageNo == null || pageNo <= 0 ? 1 : pageNo;
pageSize = pageSize == null || pageSize <= 0 ? 10 : pageSize;
com.engine.salary.elog.util.page.PageInfo<T> pageInfo = new com.engine.salary.elog.util.page.PageInfo<>();
PageInfo<T> pageInfo = new PageInfo<>();
pageInfo.setPageNum(pageNo);
pageInfo.setPageSize(pageSize);
pageInfo.setList(new ArrayList<>());
return pageInfo;
}
public static <T> com.engine.salary.elog.util.page.PageInfo<T> buildPage(Integer pageNo, Integer pageSize, Class<T> clazz) {
public static <T> PageInfo<T> buildPage(Integer pageNo, Integer pageSize, Class<T> clazz) {
pageNo = pageNo == null || pageNo <= 0 ? 1 : pageNo;
pageSize = pageSize == null || pageSize <= 0 ? 10 : pageSize;
com.engine.salary.elog.util.page.PageInfo<T> pageInfo = new com.engine.salary.elog.util.page.PageInfo<>(clazz);
PageInfo<T> pageInfo = new PageInfo<>(clazz);
pageInfo.setPageNum(pageNo);
pageInfo.setPageSize(pageSize);
pageInfo.setList(new ArrayList<>());
return pageInfo;
}
public static <T> com.engine.salary.elog.util.page.PageInfo<T> buildPage(Integer pageNo, Integer pageSize, List<T> totalCollection) {
com.engine.salary.elog.util.page.PageInfo<T> pageInfo = new com.engine.salary.elog.util.page.PageInfo<>();
public static <T> PageInfo<T> buildPage(Integer pageNo, Integer pageSize, List<T> totalCollection) {
PageInfo<T> pageInfo = new PageInfo<>();
pageInfo.setTotal(totalCollection.size());
totalCollection = subList(pageNo, pageSize, totalCollection);
pageInfo.setPageNum(pageNo);
@ -61,10 +60,10 @@ public class SalaryPageUtil {
* @param <T>
* @return
*/
public static <T> com.engine.salary.elog.util.page.PageInfo<T> buildPage(Integer pageNo, Integer pageSize, List<T> source, Class<T> clazz) {
public static <T> PageInfo<T> buildPage(Integer pageNo, Integer pageSize, List<T> source, Class<T> clazz) {
pageNo = pageNo == null || pageNo <= 0 ? 1 : pageNo;
pageSize = pageSize == null || pageSize <= 0 ? 10 : pageSize;
com.engine.salary.elog.util.page.PageInfo<T> pageInfo = new PageInfo<>(clazz);
PageInfo<T> pageInfo = new PageInfo<>(clazz);
pageInfo.setPageNum(pageNo);
pageInfo.setPageSize(pageSize);
pageInfo.setTotal(source == null ? 0 : source.size());

@ -1,4 +1,4 @@
package com.engine.salary.elog.util.page;
package com.engine.hrmelog.util.page;
import java.lang.annotation.*;

@ -1,12 +1,12 @@
package com.engine.salary.elog.web;
package com.engine.hrmelog.web;
import com.engine.common.util.ServiceUtil;
import com.engine.salary.elog.entity.param.ELogGetLogParam;
import com.engine.salary.elog.entity.param.GetDetailChangesParam;
import com.engine.salary.elog.service.ILoggerTableService;
import com.engine.salary.elog.service.impl.LoggerTableService;
import com.engine.salary.elog.util.ResponseResult;
import com.engine.salary.elog.util.page.PageInfo;
import com.engine.hrmelog.entity.param.ELogGetLogParam;
import com.engine.hrmelog.entity.param.GetDetailChangesParam;
import com.engine.hrmelog.service.ILoggerTableService;
import com.engine.hrmelog.service.impl.LoggerTableService;
import com.engine.hrmelog.util.ResponseResult;
import com.engine.hrmelog.util.page.PageInfo;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;
Loading…
Cancel
Save