操作日志前端接口
This commit is contained in:
parent
8b5703c894
commit
b7435554e8
|
|
@ -11,5 +11,5 @@ import javax.ws.rs.Path;
|
|||
* @version 1.0
|
||||
**/
|
||||
@Path("/bs/hrmsalary/elog")
|
||||
public class LoggerTableController {
|
||||
public class LoggerTableController extends com.engine.salary.elog.web.LoggerTableController{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.engine.salary.elog.annotation;
|
||||
|
||||
import com.engine.salary.elog.dto.DataTypeEnum;
|
||||
import com.engine.salary.elog.entity.dto.DataTypeEnum;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
package com.engine.salary.elog.annotation;
|
||||
|
||||
public class OperateType {
|
||||
public static final String view = "view";
|
||||
public static final String viewSpan = "查看";
|
||||
|
||||
public static final String add = "add";
|
||||
public static final String addSpan = "新增";
|
||||
|
||||
public static final String update = "update";
|
||||
public static final String updateSpan = "更新";
|
||||
|
||||
public static final String delete = "delete";
|
||||
public static final String deleteSpan = "删除";
|
||||
}
|
||||
|
|
@ -2,8 +2,8 @@ package com.engine.salary.elog.annotation.handle;
|
|||
|
||||
import com.engine.salary.elog.annotation.ElogField;
|
||||
import com.engine.salary.elog.annotation.ElogTable;
|
||||
import com.engine.salary.elog.dto.DataTypeEnum;
|
||||
import com.engine.salary.elog.dto.TableColumnBean;
|
||||
import com.engine.salary.elog.entity.dto.DataTypeEnum;
|
||||
import com.engine.salary.elog.entity.dto.TableColumnBean;
|
||||
import com.engine.salary.elog.util.ElogUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.reflections.Reflections;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.engine.salary.elog.async;
|
||||
|
||||
import com.engine.salary.elog.config.ELogTableChecker;
|
||||
import com.engine.salary.elog.dto.LoggerContext;
|
||||
import com.engine.salary.elog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.elog.service.impl.LocalElogService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.engine.salary.elog.config;
|
||||
|
||||
import com.engine.salary.elog.dto.LoggerContext;
|
||||
import com.engine.salary.elog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.mapper.elog.ElogTableCheckerMapper;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import dm.jdbc.util.IdGenerator;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package com.engine.salary.elog.dto;
|
||||
package com.engine.salary.elog.entity.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.engine.salary.elog.dto;
|
||||
package com.engine.salary.elog.entity.dto;
|
||||
|
||||
public enum DataTypeEnum {
|
||||
VARCHAR,
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.engine.salary.elog.dto;
|
||||
package com.engine.salary.elog.entity.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.engine.salary.elog.dto;
|
||||
package com.engine.salary.elog.entity.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.engine.salary.elog.entity.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @date: 2021/6/1 17:50
|
||||
* @author: deli.xu
|
||||
* @description:
|
||||
*/
|
||||
public class Like implements Serializable {
|
||||
private static final long serialVersionUID = -3399942468474767851L;
|
||||
private String prefix;
|
||||
private String suffix;
|
||||
|
||||
|
||||
public String getPrefix() {
|
||||
return prefix;
|
||||
}
|
||||
|
||||
public void setPrefix(String prefix) {
|
||||
this.prefix = prefix;
|
||||
}
|
||||
|
||||
public String getSuffix() {
|
||||
return suffix;
|
||||
}
|
||||
|
||||
public void setSuffix(String suffix) {
|
||||
this.suffix = suffix;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.engine.salary.elog.dto;
|
||||
package com.engine.salary.elog.entity.dto;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.engine.salary.elog.annotation.ElogField;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.engine.salary.elog.dto;
|
||||
package com.engine.salary.elog.entity.dto;
|
||||
|
||||
import com.engine.salary.elog.annotation.ElogDetailTable;
|
||||
import com.engine.salary.elog.annotation.ElogField;
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package com.engine.salary.elog.entity.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @date: 2022/5/14 13:52
|
||||
* @author: deli.xu
|
||||
* @description:
|
||||
*/
|
||||
|
||||
public class ReadInfoEntity implements Serializable {
|
||||
private static final long serialVersionUID = -8890667941835568289L;
|
||||
private Long employeeId;
|
||||
private Date date;
|
||||
|
||||
public Long getEmployeeId() {
|
||||
return this.employeeId;
|
||||
}
|
||||
|
||||
public void setEmployeeId(Long employeeId) {
|
||||
this.employeeId = employeeId;
|
||||
}
|
||||
|
||||
public Date getDate() {
|
||||
return this.date;
|
||||
}
|
||||
|
||||
public void setDate(Date date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
public ReadInfoEntity() {
|
||||
}
|
||||
|
||||
public ReadInfoEntity(Long employeeId, Date date) {
|
||||
this.employeeId = employeeId;
|
||||
this.date = date;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.engine.salary.elog.dto;
|
||||
package com.engine.salary.elog.entity.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.engine.salary.elog.dto;
|
||||
package com.engine.salary.elog.entity.dto;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.engine.salary.elog.dto;
|
||||
package com.engine.salary.elog.entity.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.engine.salary.elog.dto;
|
||||
package com.engine.salary.elog.entity.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.engine.salary.elog.entity.param;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ELogGetLogParam {
|
||||
/**
|
||||
* 服务(模块)名
|
||||
*/
|
||||
String module;
|
||||
/**
|
||||
* 方法名
|
||||
*/
|
||||
String function;
|
||||
/**
|
||||
* 查询条件
|
||||
*/
|
||||
String condition;
|
||||
/**
|
||||
* 每页多少数据
|
||||
*/
|
||||
String pageSize;
|
||||
/**
|
||||
* '
|
||||
* 当前页
|
||||
*/
|
||||
String current;
|
||||
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package com.engine.salary.elog.service;
|
||||
|
||||
import com.engine.salary.elog.dto.LoggerContext;
|
||||
import com.engine.salary.elog.dto.LoggerDetailContext;
|
||||
import com.engine.salary.elog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.elog.entity.dto.LoggerDetailContext;
|
||||
|
||||
public interface ILocalElogService {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
package com.engine.salary.elog.service;
|
||||
|
||||
import com.weaver.common.batch.entity.BatchDocumentMessage;
|
||||
import com.weaver.common.component.table.WeaTable;
|
||||
import com.cloudstore.eccom.pc.table.WeaTable;
|
||||
import com.engine.salary.elog.entity.param.ELogGetLogParam;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface ILoggerTableService {
|
||||
WeaTable queryLogs(String data);
|
||||
PageInfo queryLogs(String data);
|
||||
|
||||
WeaTable queryLogsPapi(String data, HttpServletRequest request);
|
||||
|
||||
|
|
@ -16,7 +17,7 @@ public interface ILoggerTableService {
|
|||
|
||||
List getDetailChangesPapi(String module, String function, String mainid, String transMethod, HttpServletRequest request);
|
||||
|
||||
List queryLogList(String module, String function, String current, String pageSize, String condition);
|
||||
List queryLogList(ELogGetLogParam param);
|
||||
|
||||
List queryCardLogList(String data);
|
||||
|
||||
|
|
@ -32,7 +33,7 @@ public interface ILoggerTableService {
|
|||
|
||||
List queryLogInfoByCustom(String module, String function, String field, String value);
|
||||
|
||||
BatchDocumentMessage downloadLog(String data);
|
||||
// BatchDocumentMessage downloadLog(String data);
|
||||
|
||||
WeaTable getDetailChangePages(String module, String function, String mainid, String detailTransMethod, String current, String pageSize);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ package com.engine.salary.elog.service.impl;
|
|||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.salary.elog.dto.LoggerContext;
|
||||
import com.engine.salary.elog.dto.LoggerDetailContext;
|
||||
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;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,7 +1,7 @@
|
|||
package com.engine.salary.elog.threadlocal;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.salary.elog.dto.LoggerContext;
|
||||
import com.engine.salary.elog.entity.dto.LoggerContext;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ package com.engine.salary.elog.util;
|
|||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.salary.elog.dto.ElogBean;
|
||||
import com.engine.salary.elog.dto.FilterConditionDto;
|
||||
import com.engine.salary.elog.dto.ShowColumsDto;
|
||||
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 java.util.List;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,18 +1,11 @@
|
|||
package com.engine.salary.elog.util;
|
||||
|
||||
import com.engine.salary.elog.dto.LoggerContext;
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.elog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.elog.enums.FromTerminalType;
|
||||
import com.weaver.common.component.table.page.Page;
|
||||
import com.weaver.common.security.util.SecurityUtil;
|
||||
import com.weaver.framework.log4j2.constant.ApmConstant;
|
||||
import com.weaver.framework.rpc.context.impl.TenantRpcContext;
|
||||
import com.weaver.framework.web.constant.EteamsConstant;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.dubbo.rpc.RpcContext;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.ByteArrayInputStream;
|
||||
|
|
@ -231,14 +224,14 @@ public class ElogSeviceUtils {
|
|||
|
||||
|
||||
|
||||
/**
|
||||
* 获取request请求
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static HttpServletRequest getRequest() {
|
||||
return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
||||
}
|
||||
// /**
|
||||
// * 获取request请求
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// public static HttpServletRequest getRequest() {
|
||||
// return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
||||
// }
|
||||
|
||||
/**
|
||||
* 将对象转换程字符串
|
||||
|
|
@ -263,14 +256,14 @@ public class ElogSeviceUtils {
|
|||
}
|
||||
}
|
||||
|
||||
public static Page getPage() {
|
||||
HttpServletRequest request = getRequest();
|
||||
String num = request.getParameter("pageNum");
|
||||
String size = request.getParameter("pageSize");
|
||||
|
||||
Page page = new Page(ElogSeviceUtils.getIntValue(num, 1), ElogSeviceUtils.getIntValue(size, 10));
|
||||
return page;
|
||||
}
|
||||
// public static Page getPage() {
|
||||
// HttpServletRequest request = getRequest();
|
||||
// String num = request.getParameter("pageNum");
|
||||
// String size = request.getParameter("pageSize");
|
||||
//
|
||||
// Page page = new Page(ElogSeviceUtils.getIntValue(num, 1), ElogSeviceUtils.getIntValue(size, 10));
|
||||
// return page;
|
||||
// }
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// //System.out.println(getTableName("select", "from"));
|
||||
|
|
@ -317,22 +310,10 @@ public class ElogSeviceUtils {
|
|||
}
|
||||
|
||||
public static String getTenantKey() {
|
||||
|
||||
String tenantKey = TenantRpcContext.getTenantKey();
|
||||
if (StringUtils.isNotBlank(tenantKey)) {
|
||||
return tenantKey;
|
||||
}
|
||||
|
||||
return "";
|
||||
return SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY;
|
||||
}
|
||||
|
||||
public static String getEmployeeId() {
|
||||
|
||||
String employeeId = TenantRpcContext.getEmployeeId();
|
||||
if (StringUtils.isNotBlank(employeeId)) {
|
||||
return employeeId;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
|
|
@ -358,37 +339,37 @@ public class ElogSeviceUtils {
|
|||
// return "";
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取rpc信息(客户端ip和来源设备)
|
||||
*
|
||||
* @param context
|
||||
*/
|
||||
public static void initRpcInfo(LoggerContext context) {
|
||||
String device = "";
|
||||
String clientIp = "";
|
||||
String traceId = "";
|
||||
try {
|
||||
device = RpcContext.getContext().getAttachment(EteamsConstant.DEVICE);
|
||||
clientIp = RpcContext.getContext().getAttachment(EteamsConstant.CLIENT_IP);
|
||||
traceId = RpcContext.getContext().getAttachment(ApmConstant.TRACE_ID);
|
||||
logger.info("rpc调用获取到 device:{},clientIp:{},traceId:{}", device, clientIp, traceId);
|
||||
} catch (Exception e) {
|
||||
logger.error("Exception", e);
|
||||
}
|
||||
if (StringUtils.isEmpty(context.getDevice()) && StringUtils.isNotEmpty(device)) {
|
||||
context.setDevice(device);
|
||||
}
|
||||
if (StringUtils.isEmpty(context.getFromTerminal()) && StringUtils.isNotEmpty(device)) {
|
||||
context.setFromTerminal(getFromTerminal(device));
|
||||
}
|
||||
|
||||
if (StringUtils.isEmpty(context.getClientIp()) && StringUtils.isNotEmpty(clientIp)) {
|
||||
context.setClientIp(clientIp);
|
||||
}
|
||||
if (StringUtils.isEmpty(context.getBelongMainId()) && StringUtils.isNotEmpty(traceId)) {
|
||||
context.setBelongMainId(traceId);
|
||||
}
|
||||
}
|
||||
// /**
|
||||
// * 获取rpc信息(客户端ip和来源设备)
|
||||
// *
|
||||
// * @param context
|
||||
// */
|
||||
// public static void initRpcInfo(LoggerContext context) {
|
||||
// String device = "";
|
||||
// String clientIp = "";
|
||||
// String traceId = "";
|
||||
// try {
|
||||
// device = RpcContext.getContext().getAttachment(EteamsConstant.DEVICE);
|
||||
// clientIp = RpcContext.getContext().getAttachment(EteamsConstant.CLIENT_IP);
|
||||
// traceId = RpcContext.getContext().getAttachment(ApmConstant.TRACE_ID);
|
||||
// logger.info("rpc调用获取到 device:{},clientIp:{},traceId:{}", device, clientIp, traceId);
|
||||
// } catch (Exception e) {
|
||||
// logger.error("Exception", e);
|
||||
// }
|
||||
// if (StringUtils.isEmpty(context.getDevice()) && StringUtils.isNotEmpty(device)) {
|
||||
// context.setDevice(device);
|
||||
// }
|
||||
// if (StringUtils.isEmpty(context.getFromTerminal()) && StringUtils.isNotEmpty(device)) {
|
||||
// context.setFromTerminal(getFromTerminal(device));
|
||||
// }
|
||||
//
|
||||
// if (StringUtils.isEmpty(context.getClientIp()) && StringUtils.isNotEmpty(clientIp)) {
|
||||
// context.setClientIp(clientIp);
|
||||
// }
|
||||
// if (StringUtils.isEmpty(context.getBelongMainId()) && StringUtils.isNotEmpty(traceId)) {
|
||||
// context.setBelongMainId(traceId);
|
||||
// }
|
||||
// }
|
||||
|
||||
public static String getFromTerminal(String device) {
|
||||
String setFT = "";
|
||||
|
|
@ -477,7 +458,7 @@ public class ElogSeviceUtils {
|
|||
if (count > 2) {
|
||||
return filterVal;
|
||||
}
|
||||
value = SecurityUtil.ecodeForSql(value);
|
||||
// value = SecurityUtil.ecodeForSql(value);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package com.engine.salary.elog.util;
|
|||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.salary.elog.dto.LoggerContext;
|
||||
import com.engine.salary.elog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.elog.enums.FromTerminalType;
|
||||
import com.engine.salary.elog.threadlocal.ElogThreadLocal;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,94 @@
|
|||
package com.engine.salary.elog.util;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: FieldNameMap
|
||||
* @Description TODO
|
||||
* @Author tanghj
|
||||
* @Date 2021/3/31 14:27
|
||||
*/
|
||||
public class FieldNameMap {
|
||||
|
||||
private static Map<String, String> mainFieldNameMap = new HashMap<>();
|
||||
|
||||
private static Map<String, String> detailFieldNameMap = new HashMap<>();
|
||||
|
||||
private static Map<String, Map<String, String>> mainCusFieldNameMap = new HashMap<>();
|
||||
|
||||
private static Map<String, Map<String, String>> detailCusFieldNameMap = new HashMap<>();
|
||||
|
||||
|
||||
public static void setMainFieldName(Map<String, String> fieldNameMap) {
|
||||
mainFieldNameMap.putAll(fieldNameMap);
|
||||
}
|
||||
|
||||
public static void setDetailFieldName(Map<String, String> fieldNameMap) {
|
||||
detailFieldNameMap.putAll(fieldNameMap);
|
||||
}
|
||||
|
||||
public static void setMainCusFieldName(String module, String function, Map<String, String> fieldNameMap) {
|
||||
mainCusFieldNameMap.put(getKey(module, function), fieldNameMap);
|
||||
}
|
||||
|
||||
public static void setDetailCusFieldName(String module, String function, Map<String, String> fieldNameMap) {
|
||||
detailCusFieldNameMap.put(getKey(module, function), fieldNameMap);
|
||||
}
|
||||
|
||||
|
||||
public static String getMainFieldNameMap(String module, String function, String key) {
|
||||
|
||||
String str = key.toLowerCase();
|
||||
if(mainFieldNameMap.containsKey(str)) {
|
||||
return StringUtils.isNotEmpty(mainFieldNameMap.get(str)) ? mainFieldNameMap.get(str) : key;
|
||||
} else {
|
||||
return getMainCusFieldNameMap(module, function,key);
|
||||
}
|
||||
}
|
||||
|
||||
public static String getDetailFieldNameMap(String module, String function, String key) {
|
||||
key = key.toLowerCase();
|
||||
if(detailFieldNameMap.containsKey(key)) {
|
||||
return StringUtils.isNotEmpty(detailFieldNameMap.get(key)) ? detailFieldNameMap.get(key) : key;
|
||||
} else {
|
||||
return getDetailCusFieldNameMap(module, function, key);
|
||||
}
|
||||
}
|
||||
|
||||
public static String getMainCusFieldNameMap(String module, String function, String key) {
|
||||
|
||||
if(mainCusFieldNameMap.containsKey(getKey(module, function))) {
|
||||
if(mainCusFieldNameMap.get(getKey(module, function)).containsKey(key)) {
|
||||
return StringUtils.isNotEmpty(mainCusFieldNameMap.get(getKey(module, function)).get(key)) ?
|
||||
mainCusFieldNameMap.get(getKey(module, function)).get(key) :
|
||||
key;
|
||||
} else {
|
||||
return key;
|
||||
}
|
||||
} else {
|
||||
return key;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getDetailCusFieldNameMap(String module, String function, String key) {
|
||||
|
||||
if(detailCusFieldNameMap.containsKey(getKey(module, function))) {
|
||||
if(detailCusFieldNameMap.get(getKey(module, function)).containsKey(key)) {
|
||||
return StringUtils.isNotEmpty(detailCusFieldNameMap.get(getKey(module, function)).get(key)) ?
|
||||
detailCusFieldNameMap.get(getKey(module, function)).get(key) :
|
||||
key;
|
||||
} else {
|
||||
return key;
|
||||
}
|
||||
} else {
|
||||
return key;
|
||||
}
|
||||
}
|
||||
|
||||
private static String getKey(String module, String function) {
|
||||
return module + "@" + function;
|
||||
}
|
||||
}
|
||||
|
|
@ -7,9 +7,9 @@ import com.alibaba.fastjson.serializer.SerializerFeature;
|
|||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.elog.annotation.ElogTransform;
|
||||
import com.engine.salary.elog.async.LoggerMessageListener;
|
||||
import com.engine.salary.elog.dto.LoggerContext;
|
||||
import com.engine.salary.elog.dto.LoggerDetailContext;
|
||||
import com.engine.salary.elog.dto.TableChangeBean;
|
||||
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 dm.jdbc.util.IdGenerator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
|
|||
|
|
@ -1,178 +1,187 @@
|
|||
package com.engine.salary.elog.web;
|
||||
|
||||
import com.weaver.common.authority.annotation.WeaPermission;
|
||||
import com.weaver.common.base.entity.result.WeaResult;
|
||||
import com.weaver.common.batch.entity.BatchDocumentMessage;
|
||||
import com.weaver.common.component.table.WeaTable;
|
||||
import com.weaver.common.elog.service.ApplicationContextProvider;
|
||||
import com.weaver.common.elog.service.ILoggerTableService;
|
||||
import com.weaver.common.elog.service.impl.LoggerTableService;
|
||||
import com.weaver.framework.spring.annotation.AopClass;
|
||||
import io.swagger.annotations.Api;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.elog.entity.param.ELogGetLogParam;
|
||||
import com.engine.salary.elog.service.ILoggerTableService;
|
||||
import com.engine.salary.elog.service.impl.LoggerTableService;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class LoggerTableController {
|
||||
|
||||
@Autowired
|
||||
@Qualifier("loggerTableService")
|
||||
private LoggerTableService loggerTableService;
|
||||
|
||||
@ApiOperation("获取日志")
|
||||
@RequestMapping(path = "getLogs", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
@WeaPermission(publicPermission = true)
|
||||
public WeaResult<WeaTable> getLogs(@RequestBody(required = false) @ApiParam("数据") String data){
|
||||
|
||||
WeaTable weaTable = loggerTableService.queryLogs(data);
|
||||
return WeaResult.success(weaTable);
|
||||
}
|
||||
|
||||
@ApiOperation("获取日志(卡片)")
|
||||
@RequestMapping(path = "getCardLogs", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
@WeaPermission(publicPermission = true)
|
||||
public WeaResult<List<Map<String, Object>>> carddatas(@RequestBody(required = false) @ApiParam("数据") String data){
|
||||
List<Map<String, Object>> list = loggerTableService.queryCardLogList(data);
|
||||
return WeaResult.success(list);
|
||||
}
|
||||
|
||||
@ApiOperation("获取单条操作记录的更新明细")
|
||||
@RequestMapping(path = "getDetailChanges", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
@WeaPermission(publicPermission = true)
|
||||
public WeaResult<List<Map<String, Object>>> getDetailChanges(@PathVariable("module") @ApiParam("服务(模块)名")String module,
|
||||
@PathVariable("function") @ApiParam("方法名")String function,
|
||||
@RequestParam("mainid") @ApiParam("主键id") String mainid,
|
||||
@RequestParam("detailTransMethod") @ApiParam("转换方法") String detailTransMethod) {
|
||||
return WeaResult.success(loggerTableService.getDetailChanges(module, function,mainid,detailTransMethod));
|
||||
private ILoggerTableService getLoggerTableService(User user) {
|
||||
return ServiceUtil.getService(LoggerTableService.class, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单条操作记录的更新明细(分页)
|
||||
* @param module 服务(模块)名
|
||||
* @param function 方法名
|
||||
* @param mainid 主键id
|
||||
* @param detailTransMethod 转换方法
|
||||
* @param current 页码
|
||||
* @param pageSize 每页条数
|
||||
* @return WeaTable
|
||||
* 获取日志
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("获取单条操作记录的更新明细(分页)")
|
||||
@RequestMapping(path = "getDetailChangePages", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
@WeaPermission(publicPermission = true)
|
||||
public WeaResult<WeaTable> getDetailChangePages(@PathVariable("module") @ApiParam("服务(模块)名")String module,
|
||||
@PathVariable("function") @ApiParam("方法名")String function,
|
||||
@RequestParam("mainid") @ApiParam("主键id") String mainid,
|
||||
@RequestParam("detailTransMethod") @ApiParam("转换方法") String detailTransMethod,
|
||||
@RequestParam("page") @ApiParam("页码") String current,
|
||||
@RequestParam("pageSize") @ApiParam("每页条数") String pageSize) {
|
||||
return WeaResult.success(loggerTableService.getDetailChangePages(module, function,mainid,detailTransMethod,current,pageSize));
|
||||
@POST
|
||||
@Path("/getLogs")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getLogs(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody String data) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<String, PageInfo>(user).run(getLoggerTableService(user)::queryLogs, data);
|
||||
}
|
||||
|
||||
@ApiOperation("获取日志(卡片)")
|
||||
@POST
|
||||
@Path("/getCardLogs")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String carddatas(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody String data) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<String, List<Map<String, Object>>>(user).run(getLoggerTableService(user)::queryCardLogList, data);
|
||||
}
|
||||
//
|
||||
// @ApiOperation("获取单条操作记录的更新明细")
|
||||
// @RequestMapping(path = "getDetailChanges", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
// @WeaPermission(publicPermission = true)
|
||||
// public WeaResult<List<Map<String, Object>>> getDetailChanges(@PathVariable("module") @ApiParam("服务(模块)名") String module,
|
||||
// @PathVariable("function") @ApiParam("方法名") String function,
|
||||
// @RequestParam("mainid") @ApiParam("主键id") String mainid,
|
||||
// @RequestParam("detailTransMethod") @ApiParam("转换方法") String detailTransMethod) {
|
||||
// return WeaResult.success(getLoggerTableService(user).getDetailChanges(module, function, mainid, detailTransMethod));
|
||||
// }
|
||||
// @ApiOperation("获取单条操作记录的更新明细")
|
||||
// @POST
|
||||
// @Path("/getDetailChanges")
|
||||
// @Produces(MediaType.APPLICATION_JSON)
|
||||
// public String getDetailChanges(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody String data) {
|
||||
// User user = HrmUserVarify.getUser(request, response);
|
||||
// return new ResponseResult<String, List<Map<String, Object>>>(user).run(getLoggerTableService(user)::getDetailChanges, data);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取单条操作记录的更新明细(分页)
|
||||
// *
|
||||
// * @param module 服务(模块)名
|
||||
// * @param function 方法名
|
||||
// * @param mainid 主键id
|
||||
// * @param detailTransMethod 转换方法
|
||||
// * @param current 页码
|
||||
// * @param pageSize 每页条数
|
||||
// * @return WeaTable
|
||||
// */
|
||||
// @ApiOperation("获取单条操作记录的更新明细(分页)")
|
||||
// @RequestMapping(path = "getDetailChangePages", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
// @WeaPermission(publicPermission = true)
|
||||
// public WeaResult<WeaTable> getDetailChangePages(@PathVariable("module") @ApiParam("服务(模块)名") String module,
|
||||
// @PathVariable("function") @ApiParam("方法名") String function,
|
||||
// @RequestParam("mainid") @ApiParam("主键id") String mainid,
|
||||
// @RequestParam("detailTransMethod") @ApiParam("转换方法") String detailTransMethod,
|
||||
// @RequestParam("page") @ApiParam("页码") String current,
|
||||
// @RequestParam("pageSize") @ApiParam("每页条数") String pageSize) {
|
||||
// return WeaResult.success(getLoggerTableService(user).getDetailChangePages(module, function, mainid, detailTransMethod, current, pageSize));
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取日志列表
|
||||
* @param request
|
||||
* @param response
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/datas")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String datas(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ELogGetLogParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<ELogGetLogParam, List>(user).run(getLoggerTableService(user)::queryLogList, param);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("获取日志列表")
|
||||
@RequestMapping(path = "datas", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
@WeaPermission(publicPermission = true)
|
||||
public WeaResult<List<Map<String, Object>>> datas(@PathVariable("module") @ApiParam("服务(模块)名")String module,
|
||||
@PathVariable("function") @ApiParam("方法名")String function,
|
||||
@Param("pageSize") @ApiParam("每页多少数据")String pageSize,
|
||||
@Param("current") @ApiParam("当前页")String current,
|
||||
@ApiParam("查询条件") String condition){
|
||||
|
||||
if("datasecurity".equals(module) && "auditLog".equals(function)) {
|
||||
try {
|
||||
ILoggerTableService tableService = ApplicationContextProvider.getBean("auditLogService", ILoggerTableService.class);
|
||||
if(tableService != null){
|
||||
List<Map<String, Object>> list = tableService.queryLogList(module, function, current, pageSize, condition);
|
||||
return WeaResult.success(list);
|
||||
}
|
||||
} catch ( Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
List<Map<String, Object>> list = loggerTableService.queryLogList(module, function, current, pageSize, condition);
|
||||
return WeaResult.success(list);
|
||||
}
|
||||
|
||||
@ApiOperation("获取日志总数")
|
||||
@RequestMapping(path = "counts", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
@WeaPermission(publicPermission = true)
|
||||
public WeaResult<Map<String, Object>> counts(@PathVariable("module") @ApiParam("服务(模块)名") String module,
|
||||
@PathVariable("function") @ApiParam("方法名")String function){
|
||||
return WeaResult.success(loggerTableService.countLog(module,function), "success");
|
||||
}
|
||||
|
||||
@ApiOperation("获取明细日志列表")
|
||||
@RequestMapping(path = "detaildatas", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
@WeaPermission(publicPermission = true)
|
||||
public WeaResult<List<Map<String, Object>>> detaildatas(@PathVariable("module") @ApiParam("服务(模块)名")String module,
|
||||
@PathVariable("function") @ApiParam("方法名")String function,
|
||||
@Param("pageSize") @ApiParam("每页多少数据")String pageSize,
|
||||
@Param("current") @ApiParam("当前页")String current,
|
||||
@Param("mainId") @ApiParam("主表id") String mainId,
|
||||
@ApiParam("查询条件") String condition){
|
||||
|
||||
if("datasecurity".equals(module) && "auditLog".equals(function)) {
|
||||
try {
|
||||
ILoggerTableService tableService = ApplicationContextProvider.getBean("auditLogService", ILoggerTableService.class);
|
||||
if(tableService != null){
|
||||
List<Map<String, Object>> list = tableService.queryDetailLogList(module, function, current, pageSize, condition, mainId);
|
||||
return WeaResult.success(list);
|
||||
}
|
||||
} catch ( Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
List<Map<String, Object>> list = loggerTableService.queryDetailLogList(module, function, current, pageSize, condition, mainId);
|
||||
return WeaResult.success(list);
|
||||
}
|
||||
|
||||
@ApiOperation("获取日志总数")
|
||||
@RequestMapping(path = "detailcounts", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
@WeaPermission(publicPermission = true)
|
||||
public WeaResult<Map<String, Object>> detailcounts(@PathVariable("module") @ApiParam("服务(模块)名") String module,
|
||||
@PathVariable("function") @ApiParam("方法名")String function,
|
||||
@Param("mainId") @ApiParam("主表id") String mainId){
|
||||
return WeaResult.success(loggerTableService.countDestailLog(module,function, mainId), "success");
|
||||
}
|
||||
|
||||
@ApiOperation("根据traceId获取链路列表")
|
||||
@RequestMapping(path = "queryLogTraceInfo", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
@WeaPermission(publicPermission = true)
|
||||
public WeaResult<WeaTable> queryLogTraceInfo(@PathVariable("module") @ApiParam("服务(模块)名") String module,
|
||||
@PathVariable("function") @ApiParam("方法名")String function,
|
||||
@Param("traceId") @ApiParam("traceId") String traceId,
|
||||
@Param("currentPage") @ApiParam("currentPage") Integer currentPage,
|
||||
@Param("pageSize") @ApiParam("pageSize") Integer pageSize,
|
||||
@Param("traceTransMethod") @ApiParam("traceTransMethod") String traceTransMethod
|
||||
){
|
||||
|
||||
if("datasecurity".equals(module) && "auditLog".equals(function)) {
|
||||
try {
|
||||
ILoggerTableService tableService = ApplicationContextProvider.getBean("auditLogService", ILoggerTableService.class);
|
||||
if(tableService != null){
|
||||
return WeaResult.success(tableService.queryElogTraceInfo(traceId,module,function,currentPage,pageSize,traceTransMethod ), "success");
|
||||
}
|
||||
} catch ( Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return WeaResult.success(loggerTableService.queryElogTraceInfo(traceId,module,function,currentPage,pageSize,traceTransMethod ), "success");
|
||||
}
|
||||
|
||||
@ApiOperation("日志下载")
|
||||
@RequestMapping(path = "downloadLog", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
@WeaPermission(publicPermission = true)
|
||||
public WeaResult<BatchDocumentMessage> downloadLog(@RequestBody(required = false) @ApiParam("数据") String data){
|
||||
|
||||
BatchDocumentMessage message = loggerTableService.downloadLog(data);
|
||||
return WeaResult.success(message);
|
||||
}
|
||||
// @ApiOperation("获取日志总数")
|
||||
// @RequestMapping(path = "counts", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
// @WeaPermission(publicPermission = true)
|
||||
// public WeaResult<Map<String, Object>> counts(@PathVariable("module") @ApiParam("服务(模块)名") String module,
|
||||
// @PathVariable("function") @ApiParam("方法名") String function) {
|
||||
// return WeaResult.success(getLoggerTableService(user).countLog(module, function), "success");
|
||||
// }
|
||||
//
|
||||
// @ApiOperation("获取明细日志列表")
|
||||
// @RequestMapping(path = "detaildatas", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
// @WeaPermission(publicPermission = true)
|
||||
// public WeaResult<List<Map<String, Object>>> detaildatas(@PathVariable("module") @ApiParam("服务(模块)名") String module,
|
||||
// @PathVariable("function") @ApiParam("方法名") String function,
|
||||
// @Param("pageSize") @ApiParam("每页多少数据") String pageSize,
|
||||
// @Param("current") @ApiParam("当前页") String current,
|
||||
// @Param("mainId") @ApiParam("主表id") String mainId,
|
||||
// @ApiParam("查询条件") String condition) {
|
||||
//
|
||||
// if ("datasecurity".equals(module) && "auditLog".equals(function)) {
|
||||
// try {
|
||||
// ILoggerTableService tableService = ApplicationContextProvider.getBean("auditLogService", ILoggerTableService.class);
|
||||
// if (tableService != null) {
|
||||
// List<Map<String, Object>> list = tableService.queryDetailLogList(module, function, current, pageSize, condition, mainId);
|
||||
// return WeaResult.success(list);
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// List<Map<String, Object>> list = getLoggerTableService(user).queryDetailLogList(module, function, current, pageSize, condition, mainId);
|
||||
// return WeaResult.success(list);
|
||||
// }
|
||||
//
|
||||
// @ApiOperation("获取日志总数")
|
||||
// @RequestMapping(path = "detailcounts", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
// @WeaPermission(publicPermission = true)
|
||||
// public WeaResult<Map<String, Object>> detailcounts(@PathVariable("module") @ApiParam("服务(模块)名") String module,
|
||||
// @PathVariable("function") @ApiParam("方法名") String function,
|
||||
// @Param("mainId") @ApiParam("主表id") String mainId) {
|
||||
// return WeaResult.success(getLoggerTableService(user).countDestailLog(module, function, mainId), "success");
|
||||
// }
|
||||
//
|
||||
// @ApiOperation("根据traceId获取链路列表")
|
||||
// @RequestMapping(path = "queryLogTraceInfo", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
// @WeaPermission(publicPermission = true)
|
||||
// public WeaResult<WeaTable> queryLogTraceInfo(@PathVariable("module") @ApiParam("服务(模块)名") String module,
|
||||
// @PathVariable("function") @ApiParam("方法名") String function,
|
||||
// @Param("traceId") @ApiParam("traceId") String traceId,
|
||||
// @Param("currentPage") @ApiParam("currentPage") Integer currentPage,
|
||||
// @Param("pageSize") @ApiParam("pageSize") Integer pageSize,
|
||||
// @Param("traceTransMethod") @ApiParam("traceTransMethod") String traceTransMethod
|
||||
// ) {
|
||||
//
|
||||
// if ("datasecurity".equals(module) && "auditLog".equals(function)) {
|
||||
// try {
|
||||
// ILoggerTableService tableService = ApplicationContextProvider.getBean("auditLogService", ILoggerTableService.class);
|
||||
// if (tableService != null) {
|
||||
// return WeaResult.success(tableService.queryElogTraceInfo(traceId, module, function, currentPage, pageSize, traceTransMethod), "success");
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
//
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return WeaResult.success(getLoggerTableService(user).queryElogTraceInfo(traceId, module, function, currentPage, pageSize, traceTransMethod), "success");
|
||||
// }
|
||||
//
|
||||
// @ApiOperation("日志下载")
|
||||
// @RequestMapping(path = "downloadLog", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
// @WeaPermission(publicPermission = true)
|
||||
// public WeaResult<BatchDocumentMessage> downloadLog(@RequestBody(required = false) @ApiParam("数据") String data) {
|
||||
//
|
||||
// BatchDocumentMessage message = getLoggerTableService(user).downloadLog(data);
|
||||
// return WeaResult.success(message);
|
||||
// }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.engine.salary.mapper.elog;
|
||||
|
||||
import com.engine.salary.elog.dto.TableColumnBean;
|
||||
import com.engine.salary.elog.entity.dto.TableColumnBean;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
|||
|
|
@ -297,7 +297,7 @@
|
|||
|
||||
|
||||
<!-- 获取表结构 -->
|
||||
<select id="getTableStructure" resultType="com.engine.salary.elog.dto.TableColumnBean" >
|
||||
<select id="getTableStructure" resultType="com.engine.salary.elog.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.dto.TableColumnBean" databaseId="postgresql">
|
||||
<select id="getTableStructure" resultType="com.engine.salary.elog.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.dto.TableColumnBean" databaseId="oracle">
|
||||
<select id="getTableStructure" resultType="com.engine.salary.elog.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.dto.TableColumnBean" databaseId="sqlserver">
|
||||
<select id="getTableStructure" resultType="com.engine.salary.elog.entity.dto.TableColumnBean" databaseId="sqlserver">
|
||||
SELECT
|
||||
COLUMN_NAME columnName
|
||||
FROM
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
package com.engine.salary.mapper.elog;
|
||||
|
||||
|
||||
import com.engine.salary.elog.dto.LoggerContext;
|
||||
import com.engine.salary.elog.dto.LoggerDetailContext;
|
||||
import com.engine.salary.elog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.elog.entity.dto.LoggerDetailContext;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
package com.engine.salary.mapper.elog;
|
||||
|
||||
import com.engine.salary.elog.dto.LoggerContext;
|
||||
import com.engine.salary.elog.dto.LoggerDetailContext;
|
||||
import com.engine.salary.elog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.elog.entity.dto.ReadInfoEntity;
|
||||
import com.github.pagehelper.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -15,22 +16,204 @@ import java.util.Map;
|
|||
*/
|
||||
public interface LocalElogDaoMapper {
|
||||
|
||||
int insertElogContext(@Param(value = "logContent") LoggerContext loggerContext,
|
||||
@Param(value = "params") String params,
|
||||
@Param(value = "cusColumns") String cusColumns,
|
||||
@Param(value = "cusValus") String cusValus,
|
||||
@Param(value = "tableName") String tableName);
|
||||
|
||||
List<Map<String, Object>> queryElogList(@Param(value = "logContent") LoggerContext loggerContext,
|
||||
@Param("limit") String limit,
|
||||
@Param(value = "tableName") String tableName);
|
||||
List<Map<String, Object>> queryCardElogList(@Param(value = "logContent") 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("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("limit") String limit,
|
||||
@Param(value = "tableName") String tableName,
|
||||
@Param(value = "conditionSql") String conditionSql,
|
||||
@Param(value = "columns") String columns);
|
||||
|
||||
// @WeaDataPermission(mainDataTable = "#{mainDataTable}",
|
||||
// permissionId = "#{permissionId}",
|
||||
// permissionType = "#{permissionType}",
|
||||
// mainDataTableAlias = "#{mainDataTableAlias}",
|
||||
// primaryKey = "#{primaryKey}",
|
||||
// permissionTargetId = "#{permissionTargetId}",
|
||||
// permissionConfigSourceId = "#{permissionConfigSourceId}",
|
||||
// permissionExcept = "true")
|
||||
List<Map> queryElogList(@Param(value = "page") Page page, @Param(value = "logContent") LoggerContext loggerContext,
|
||||
@Param("limit") String limit,
|
||||
@Param(value = "tableName") String tableName,
|
||||
@Param(value = "conditionSql") String conditionSql,
|
||||
@Param(value = "mainDataTable") String mainDataTable,
|
||||
@Param(value = "permissionId") String permissionId,
|
||||
@Param(value = "permissionType") String permissionType,
|
||||
@Param(value = "mainDataTableAlias") String mainDataTableAlias,
|
||||
@Param(value = "primaryKey") String primaryKey,
|
||||
@Param(value = "permissionTargetId") String permissionTargetId,
|
||||
@Param(value = "permissionConfigSourceId") String permissionConfigSourceId,
|
||||
@Param(value = "columns") String columns
|
||||
);
|
||||
|
||||
// @WeaDataPermission(mainDataTable = "#{mainDataTable}",
|
||||
// permissionId = "#{permissionId}",
|
||||
// permissionType = "#{permissionType}",
|
||||
// mainDataTableAlias = "#{mainDataTableAlias}",
|
||||
// primaryKey = "#{primaryKey}",
|
||||
// permissionExcept = "true")
|
||||
List<Map> queryElogListPapi(@Param(value = "page") Page page, @Param(value = "logContent") LoggerContext loggerContext,
|
||||
@Param("limit") String limit,
|
||||
@Param(value = "tableName") String tableName,
|
||||
@Param(value = "conditionSql") String conditionSql,
|
||||
@Param(value = "mainDataTable") String mainDataTable,
|
||||
@Param(value = "permissionId") String permissionId,
|
||||
@Param(value = "permissionType") String permissionType,
|
||||
@Param(value = "mainDataTableAlias") String mainDataTableAlias,
|
||||
@Param(value = "primaryKey") String primaryKey,
|
||||
@Param(value = "columns") String columns
|
||||
);
|
||||
|
||||
List<Map> queryAllChanges(@Param(value = "tableName") String tableName, @Param("mainid") String mainid);
|
||||
|
||||
Map<String, Object> elogCount(@Param(value = "logContent") LoggerContext loggerContext,
|
||||
@Param(value = "tableName") String tableName);
|
||||
@Param(value = "tableName") String tableName,
|
||||
@Param(value = "conditionSql") String conditionSql);
|
||||
|
||||
int insertElogDetail(@Param(value = "detailContext") LoggerDetailContext loggerDetailContext,
|
||||
@Param(value = "mainid") String mainid,
|
||||
@Param(value = "cusColumns") String cusColumns,
|
||||
@Param(value = "cusValus") String cusValus,
|
||||
@Param(value = "detailTableName") String tableName);
|
||||
Map<String, Object> elogCountPapi(@Param(value = "logContent") LoggerContext loggerContext,
|
||||
@Param(value = "tableName") String tableName,
|
||||
@Param(value = "conditionSql") String conditionSql);
|
||||
|
||||
|
||||
// @WeaDataPermission(mainDataTable = "#{mainDataTable}",
|
||||
// permissionId = "#{permissionId}",
|
||||
// permissionType = "#{permissionType}",
|
||||
// mainDataTableAlias = "#{mainDataTableAlias}",
|
||||
// primaryKey = "#{primaryKey}",
|
||||
// permissionTargetId = "#{permissionTargetId}",
|
||||
// permissionConfigSourceId = "#{permissionConfigSourceId}",
|
||||
// permissionExcept = "true")
|
||||
Map<String, Object> elogCountByMorePermission(@Param(value = "logContent") LoggerContext loggerContext,
|
||||
@Param(value = "tableName") String tableName,
|
||||
@Param(value = "conditionSql") String conditionSql,
|
||||
@Param(value = "mainDataTable") String mainDataTable,
|
||||
@Param(value = "permissionId") String permissionId,
|
||||
@Param(value = "permissionType") String permissionType,
|
||||
@Param(value = "mainDataTableAlias") String mainDataTableAlias,
|
||||
@Param(value = "primaryKey") String primaryKey,
|
||||
@Param(value = "permissionTargetId") String permissionTargetId,
|
||||
@Param(value = "permissionConfigSourceId") String permissionConfigSourceId);
|
||||
|
||||
// @WeaDataPermission(mainDataTable = "#{mainDataTable}",
|
||||
// permissionId = "#{permissionId}",
|
||||
// permissionType = "#{permissionType}",
|
||||
// mainDataTableAlias = "#{mainDataTableAlias}",
|
||||
// primaryKey = "#{primaryKey}",
|
||||
// permissionTargetId = "#{permissionTargetId}",
|
||||
// permissionConfigSourceId = "#{permissionConfigSourceId}",
|
||||
// permissionCount = "count(*)",
|
||||
// permissionExcept = "true")
|
||||
Long elogCountOnlyNum(@Param(value = "logContent") LoggerContext loggerContext,
|
||||
@Param(value = "tableName") String tableName,
|
||||
@Param(value = "conditionSql") String conditionSql,
|
||||
@Param(value = "mainDataTable") String mainDataTable,
|
||||
@Param(value = "permissionId") String permissionId,
|
||||
@Param(value = "permissionType") String permissionType,
|
||||
@Param(value = "mainDataTableAlias") String mainDataTableAlias,
|
||||
@Param(value = "primaryKey") String primaryKey,
|
||||
@Param(value = "permissionTargetId") String permissionTargetId,
|
||||
@Param(value = "permissionConfigSourceId") String permissionConfigSourceId);
|
||||
|
||||
|
||||
// @WeaDataPermission(mainDataTable = "#{mainDataTable}",
|
||||
// permissionId = "#{permissionId}",
|
||||
// permissionType = "#{permissionType}",
|
||||
// mainDataTableAlias = "#{mainDataTableAlias}",
|
||||
// primaryKey = "#{primaryKey}",
|
||||
// permissionExcept = "true")
|
||||
Map<String, Object> elogCount(@Param(value = "logContent") LoggerContext loggerContext,
|
||||
@Param(value = "tableName") String tableName,
|
||||
@Param(value = "conditionSql") String conditionSql,
|
||||
@Param(value = "mainDataTable") String mainDataTable,
|
||||
@Param(value = "permissionId") String permissionId,
|
||||
@Param(value = "permissionType") String permissionType,
|
||||
@Param(value = "mainDataTableAlias") String mainDataTableAlias,
|
||||
@Param(value = "primaryKey") String primaryKey);
|
||||
|
||||
// @WeaDataPermission(mainDataTable = "#{mainDataTable}",
|
||||
// permissionId = "#{permissionId}",
|
||||
// permissionType = "#{permissionType}",
|
||||
// mainDataTableAlias = "#{mainDataTableAlias}",
|
||||
// primaryKey = "#{primaryKey}",
|
||||
// permissionExcept = "true")
|
||||
Map<String, Object> elogCountPapi(@Param(value = "logContent") LoggerContext loggerContext,
|
||||
@Param(value = "tableName") String tableName,
|
||||
@Param(value = "conditionSql") String conditionSql,
|
||||
@Param(value = "mainDataTable") String mainDataTable,
|
||||
@Param(value = "permissionId") String permissionId,
|
||||
@Param(value = "permissionType") String permissionType,
|
||||
@Param(value = "mainDataTableAlias") String mainDataTableAlias,
|
||||
@Param(value = "primaryKey") String primaryKey);
|
||||
|
||||
|
||||
List<Map> queryDetailElogList(@Param(value = "logContent") LoggerContext loggerContext,
|
||||
@Param("limit") String limit,
|
||||
@Param(value = "tableName") String tableName,
|
||||
@Param(value = "conditionSql") String conditionSql);
|
||||
|
||||
Map<String, Object> elogDetailCount(@Param(value = "logContent") LoggerContext loggerContext,
|
||||
@Param(value = "tableName") String tableName,
|
||||
@Param(value = "conditionSql") String conditionSql);
|
||||
|
||||
// List<SimpleEmployee> queryOperators(@Param(value = "tableName") String tableName,
|
||||
// @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<Map> queryAllMainData(@Param(value = "tableName") String tableName, @Param("uuid") String uuid);
|
||||
|
||||
List<Map> queryAllMainChanges(@Param(value = "tableName") String tableName, @Param("mainid") String mainid);
|
||||
|
||||
List<Map> queryAllDetailChanges(@Param(value = "tableName") String tableName, @Param("mainid") String mainid);
|
||||
|
||||
Integer queryElogContextById(@Param(value = "id") Long id,
|
||||
@Param(value = "tableName") String tableName);
|
||||
|
||||
List<Map> queryElogTraceInfo(@Param(value = "traceId") String traceId,
|
||||
@Param(value = "tableName") String tableName,
|
||||
@Param(value = "offset") Integer offset,
|
||||
@Param(value = "pageSize") Integer pageSize);
|
||||
|
||||
int queryElogTraceInfoCount(@Param(value = "traceId") String traceId,
|
||||
@Param(value = "tableName") String tableName);
|
||||
|
||||
List queryLogInfoByCustom(@Param(value = "tableName") String tableName,
|
||||
@Param(value = "sql") String sql);
|
||||
|
||||
List queryAllChangesData(@Param("tableName") String tableName, @Param("mainid") String mainid);
|
||||
|
||||
List<ReadInfoEntity> queryTenantKeyOperators(@Param(value = "tableName") String tableName,
|
||||
@Param(value = "tenantKey") String tenantKey,
|
||||
@Param(value = "targetId") String targetId,
|
||||
@Param(value = "operateType") String operateType,
|
||||
@Param(value = "flag") Boolean flag);
|
||||
|
||||
List<Map> queryAllChangesDataPages(@Param("tableName") String tableName,
|
||||
@Param("mainid") String mainid,
|
||||
@Param(value = "page") Page page);
|
||||
|
||||
Integer queryAllChangesPageCounts(@Param("tableName") String tableName, @Param("mainid") String mainid);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,40 +2,411 @@
|
|||
<!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">
|
||||
|
||||
<insert id="insertElogContext">
|
||||
insert into ${tableName} (uuid, date, tenant_key, modulename, functionName,
|
||||
operator, operatorname, targetid, targetname, interfacename, operatetype, operatedesc,
|
||||
params, clientIp, groupnamelabel, redoservice, redocontext, cancelservice, cancelcontext, device, groupid
|
||||
${cusColumns})
|
||||
values
|
||||
(#{logContent.uuid}, #{logContent.date},
|
||||
#{logContent.tenant_key}, #{logContent.moduleName}, #{logContent.functionName}, #{logContent.operator}, #{logContent.operatorName}, #{logContent.targetId}
|
||||
, #{logContent.targetName}, #{logContent.interfaceName}, #{logContent.operateType}, #{logContent.operatedesc},
|
||||
#{params}, #{logContent.clientIp}, #{logContent.groupNameLabel}, #{logContent.redoService},
|
||||
#{logContent.redoContext}, #{logContent.cancelService}, #{logContent.cancelContext}, #{logContent.device}, #{logContent.groupId}
|
||||
${cusValus})
|
||||
</insert>
|
||||
|
||||
<select id="queryElogList" resultType="java.util.Map">
|
||||
select *,DATE_FORMAT(date,"%Y-%m-%d %H:%i:%S") createDate from ${tableName}
|
||||
where module = #{logContent.modulename} and function = #{logContent.functionName}
|
||||
order by date desc ${limit}
|
||||
select ${columns},DATE_FORMAT(log_date,"%Y-%m-%d %H:%i:%S") createdate from ${tableName}
|
||||
where modulename = #{logContent.moduleName} and functionname = #{logContent.functionName}
|
||||
and delete_type = 0
|
||||
<if test="conditionSql != null">${conditionSql}</if>
|
||||
order by log_date desc ,id desc
|
||||
</select>
|
||||
<select id="queryElogList" resultType="java.util.Map" databaseId="postgresql">
|
||||
select ${columns},to_char(log_date::timestamp,'YYYY-MM-DD HH24:MI:SS') createdate from ${tableName}
|
||||
where modulename = #{logContent.moduleName} and functionname = #{logContent.functionName}
|
||||
|
||||
<if test="conditionSql != null">${conditionSql}</if>
|
||||
order by log_date desc ,id desc
|
||||
</select>
|
||||
<select id="queryElogList" resultType="java.util.Map" databaseId="oracle">
|
||||
select d.*,to_char(d.log_date,'yyyy-mm-dd HH24:mi:ss') createdate from ${tableName} d
|
||||
where modulename = #{logContent.moduleName} and functionname = #{logContent.functionName}
|
||||
|
||||
<if test="conditionSql != null">${conditionSql}</if>
|
||||
order by d.log_date desc ,id desc
|
||||
</select>
|
||||
<select id="queryElogList" resultType="java.util.Map" databaseId="sqlserver">
|
||||
select ${columns},convert(nvarchar(19),log_date,120) createdate from ${tableName}
|
||||
where modulename = #{logContent.moduleName} and functionname = #{logContent.functionName}
|
||||
|
||||
<if test="conditionSql != null">${conditionSql}</if>
|
||||
order by log_date desc ,id desc
|
||||
</select>
|
||||
|
||||
<select id="queryElogListPapi" 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}
|
||||
and delete_type = 0
|
||||
<if test="conditionSql != null">${conditionSql}</if>
|
||||
order by log_date desc ,id desc
|
||||
</select>
|
||||
<select id="queryElogListPapi" resultType="java.util.Map" databaseId="postgresql">
|
||||
select ${columns},to_char(log_date::timestamp,'YYYY-MM-DD HH24:MI:SS') createdate from ${tableName}
|
||||
where modulename = #{logContent.moduleName} and functionname = #{logContent.functionName}
|
||||
<if test="conditionSql != null">${conditionSql}</if>
|
||||
order by log_date desc ,id desc
|
||||
</select>
|
||||
<select id="queryElogListPapi" resultType="java.util.Map" databaseId="oracle">
|
||||
select d.*,to_char(d.log_date,'yyyy-mm-dd HH24:mi:ss') createdate from ${tableName} d
|
||||
where modulename = #{logContent.moduleName} and functionname = #{logContent.functionName}
|
||||
<if test="conditionSql != null">${conditionSql}</if>
|
||||
order by d.log_date desc ,id desc
|
||||
</select>
|
||||
<select id="queryElogListPapi" resultType="java.util.Map" databaseId="sqlserver">
|
||||
select ${columns},convert(nvarchar(19),log_date,120) createdate from ${tableName}
|
||||
where modulename = #{logContent.moduleName} and functionname = #{logContent.functionName}
|
||||
<if test="conditionSql != null">${conditionSql}</if>
|
||||
order by log_date desc ,id desc
|
||||
</select>
|
||||
|
||||
<select id="queryCardElogList" resultType="java.util.Map">
|
||||
select ${columns}, DATE_FORMAT(log_date,"%Y-%m-%d %H:%i:%S") createdate,
|
||||
uuid from ${tableName}
|
||||
where modulename = #{logContent.moduleName} and functionname = #{logContent.functionName}
|
||||
|
||||
<if test="conditionSql != null">#{conditionSql}</if>
|
||||
order by log_date desc ,id desc
|
||||
</select>
|
||||
<select id="queryCardElogList" resultType="java.util.Map" databaseId="postgresql">
|
||||
select ${columns}, to_char(log_date::timestamp,'YYYY-MM-DD HH24:MI:SS') createdate,
|
||||
uuid from ${tableName}
|
||||
where modulename = #{logContent.moduleName} and functionname = #{logContent.functionName}
|
||||
|
||||
<if test="conditionSql != null">#{conditionSql}</if>
|
||||
order by log_date desc ,id desc
|
||||
</select>
|
||||
<select id="queryCardElogList" resultType="java.util.Map" databaseId="oracle">
|
||||
select ${columns}, to_char(log_date,'yyyy-mm-dd HH24:mi:ss') createdate,
|
||||
uuid from ${tableName}
|
||||
where modulename = #{logContent.moduleName} and functionname = #{logContent.functionName}
|
||||
|
||||
<if test="conditionSql != null">#{conditionSql}</if>
|
||||
order by log_date desc ,id desc
|
||||
</select>
|
||||
<select id="queryCardElogList" resultType="java.util.Map" databaseId="sqlserver">
|
||||
select ${columns}, convert(nvarchar(19),log_date,120) createdate,
|
||||
uuid from ${tableName}
|
||||
where modulename = #{logContent.moduleName} and functionname = #{logContent.functionName}
|
||||
|
||||
<if test="conditionSql != null">#{conditionSql}</if>
|
||||
order by log_date desc ,id desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="elogCountByMorePermission" resultType="java.util.Map">
|
||||
select count(1) counts from ${tableName}
|
||||
where modulename = #{logContent.moduleName} and functionname = #{logContent.functionName}
|
||||
|
||||
<if test="conditionSql != null">${conditionSql}</if>
|
||||
</select>
|
||||
|
||||
<select id="elogCount" resultType="java.util.Map">
|
||||
select count(1) counts from ${tableName}
|
||||
where module = #{logContent.modulename} and function = #{logContent.functionName}
|
||||
where modulename = #{logContent.moduleName} and functionname = #{logContent.functionName}
|
||||
|
||||
<if test="logContent.operator != null and logContent.operator !=''">
|
||||
and log_operator = #{logContent.operator}
|
||||
</if>
|
||||
<if test="conditionSql != null">${conditionSql}</if>
|
||||
</select>
|
||||
|
||||
<insert id="insertElogDetail">
|
||||
insert into ${detailTableName} (mainid, uuid, tablename, fieldname, newvalue, oldvalue,
|
||||
fielddesc, showorder
|
||||
${cusColumns})
|
||||
values(
|
||||
#{mainid}, #{detailContext.uuid}, #{detailContext.tableName}, #{detailContext.fieldName}, #{detailContext.newValue},
|
||||
#{detailContext.oldValue}, #{detailContext.fieldDesc}, #{detailContext.showorder}
|
||||
${cusValus}
|
||||
)
|
||||
</insert>
|
||||
<select id="elogCountPapi" resultType="java.util.Map">
|
||||
select count(1) counts from ${tableName}
|
||||
where modulename = #{logContent.moduleName} and functionname = #{logContent.functionName}
|
||||
and delete_type = 0
|
||||
<if test="logContent.operator != null and logContent.operator !=''">
|
||||
and log_operator = #{logContent.operator}
|
||||
</if>
|
||||
<if test="conditionSql != null">${conditionSql}</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="queryDetailElogList" resultType="java.util.Map">
|
||||
select *,DATE_FORMAT(create_time,"%Y-%m-%d %H:%i:%S") createdate from ${tableName}
|
||||
where mainid = #{logContent.uuid}
|
||||
|
||||
<if test="conditionSql != null">#{conditionSql}</if>
|
||||
order by log_date desc ,id desc
|
||||
</select>
|
||||
<select id="queryDetailElogList" resultType="java.util.Map" databaseId="postgresql">
|
||||
select *,to_char(create_time::timestamp,'YYYY-MM-DD HH24:MI:SS') createdate from ${tableName}
|
||||
where mainid = #{logContent.uuid}
|
||||
|
||||
<if test="conditionSql != null">#{conditionSql}</if>
|
||||
order by log_date desc ,id desc
|
||||
</select>
|
||||
<select id="queryDetailElogList" resultType="java.util.Map" databaseId="oracle">
|
||||
select *,to_char(create_time,'yyyy-mm-dd HH24:mi:ss') createdate from ${tableName}
|
||||
where mainid = #{logContent.uuid}
|
||||
|
||||
<if test="conditionSql != null">#{conditionSql}</if>
|
||||
order by log_date desc ,id desc
|
||||
</select>
|
||||
<select id="queryDetailElogList" resultType="java.util.Map" databaseId="sqlserver">
|
||||
select *,convert(nvarchar(19),create_time,120) createdate from ${tableName}
|
||||
where mainid = #{logContent.uuid}
|
||||
|
||||
<if test="conditionSql != null">#{conditionSql}</if>
|
||||
order by log_date desc ,id desc
|
||||
</select>
|
||||
|
||||
<select id="queryAllChanges" resultType="java.util.Map">
|
||||
select *
|
||||
from ${tableName}
|
||||
where mainid = #{mainid}
|
||||
</select>
|
||||
|
||||
<select id="queryAllMainData" resultType="java.util.Map">
|
||||
select *
|
||||
from ${tableName}
|
||||
where uuid = #{uuid}
|
||||
</select>
|
||||
|
||||
<select id="queryAllMainChanges" resultType="java.util.Map">
|
||||
select *
|
||||
from ${tableName}
|
||||
where mainid = #{mainid}
|
||||
and isdetail = '0'
|
||||
</select>
|
||||
|
||||
<select id="queryAllDetailChanges" resultType="java.util.Map">
|
||||
select *
|
||||
from ${tableName}
|
||||
where mainid = #{mainid}
|
||||
and isdetail = '1'
|
||||
</select>
|
||||
|
||||
<select id="elogDetailCount" resultType="java.util.Map">
|
||||
select count(1) counts from ${tableName}
|
||||
where mainid = #{logContent.uuid}
|
||||
|
||||
<if test="conditionSql != null">#{conditionSql}</if>
|
||||
</select>
|
||||
|
||||
<!-- <select id="queryOperators" resultType="com.weaver.teams.domain.user.SimpleEmployee">-->
|
||||
<!-- select log_operator id, max(log_date) updateTime-->
|
||||
<!-- from ${tableName}-->
|
||||
<!-- where targetid = #{targetId}-->
|
||||
<!-- and operatetype = #{operateType}-->
|
||||
<!-- group by log_operator-->
|
||||
<!-- order by updateTime desc-->
|
||||
<!-- </select>-->
|
||||
<select id="queryReadInfoOperators" resultType="com.engine.salary.elog.entity.dto.ReadInfoEntity">
|
||||
select log_operator employeeId, max(log_date) date
|
||||
from ${tableName}
|
||||
where targetid = #{targetId}
|
||||
and operatetype = #{operateType}
|
||||
group by log_operator
|
||||
order by log_date desc
|
||||
</select>
|
||||
|
||||
<select id="queryReadInfoOperators" resultType="com.engine.salary.elog.entity.dto.ReadInfoEntity" databaseId="postgresql">
|
||||
select log_operator employeeId, max(log_date) date
|
||||
from ${tableName}
|
||||
where targetid = #{targetId}
|
||||
and operatetype = #{operateType}
|
||||
group by log_operator
|
||||
order by date desc
|
||||
</select>
|
||||
|
||||
<select id="queryReadInfoOperators" resultType="com.engine.salary.elog.entity.dto.ReadInfoEntity" databaseId="oracle">
|
||||
select log_operator employeeId, max(log_date) "date"
|
||||
from ${tableName}
|
||||
where targetid = #{targetId}
|
||||
and operatetype = #{operateType}
|
||||
group by log_operator
|
||||
order by "date" desc
|
||||
</select>
|
||||
<select id="queryReadInfoOperators" resultType="com.engine.salary.elog.entity.dto.ReadInfoEntity" databaseId="sqlserver">
|
||||
select log_operator employeeId, max(log_date) "date"
|
||||
from ${tableName}
|
||||
where targetid = #{targetId}
|
||||
and operatetype = #{operateType}
|
||||
group by log_operator
|
||||
order by "date" desc
|
||||
</select>
|
||||
|
||||
<select id="queryReadInfoDateOperators" resultType="com.engine.salary.elog.entity.dto.ReadInfoEntity">
|
||||
select log_operator employeeId, max(log_date) date from ${tableName} where targetid = #{targetId} and
|
||||
operatetype = #{operateType}
|
||||
<if test="startDate != null">
|
||||
AND log_date <![CDATA[ >= ]]> #{startDate}
|
||||
</if>
|
||||
<if test="endDate != null">
|
||||
AND log_date <![CDATA[ <= ]]> #{endDate}
|
||||
</if>
|
||||
group by log_operator order by log_date desc
|
||||
</select>
|
||||
|
||||
<select id="queryReadInfoDateOperators" resultType="com.engine.salary.elog.entity.dto.ReadInfoEntity"
|
||||
databaseId="postgresql">
|
||||
select log_operator employeeId, max(log_date) date from ${tableName} where targetid = #{targetId} and
|
||||
operatetype = #{operateType}
|
||||
<if test="startDate != null">
|
||||
AND log_date <![CDATA[ >= ]]> #{startDate}
|
||||
</if>
|
||||
<if test="endDate != null">
|
||||
AND log_date <![CDATA[ <= ]]> #{endDate}
|
||||
</if>
|
||||
group by log_operator order by date desc
|
||||
</select>
|
||||
|
||||
<select id="queryReadInfoDateOperators" resultType="com.engine.salary.elog.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">
|
||||
AND log_date <![CDATA[ >= ]]> TO_DATE(#{startDate}, 'SYYYY-MM-DD HH24:MI:SS')
|
||||
</if>
|
||||
<if test="endDate != null">
|
||||
AND log_date <![CDATA[ <= ]]> TO_DATE(#{endDate}, 'SYYYY-MM-DD HH24:MI:SS')
|
||||
</if>
|
||||
group by log_operator order by "date" desc
|
||||
</select>
|
||||
|
||||
<select id="queryReadInfoDateOperators" resultType="com.engine.salary.elog.entity.dto.ReadInfoEntity"
|
||||
databaseId="sqlserver">
|
||||
select log_operator employeeId, max(log_date) "date" from ${tableName} where targetid = #{targetId} and
|
||||
operatetype = #{operateType}
|
||||
<if test="startDate != null">
|
||||
AND log_date <![CDATA[ >= ]]> #{startDate}
|
||||
</if>
|
||||
<if test="endDate != null">
|
||||
AND log_date <![CDATA[ <= ]]> #{endDate}
|
||||
</if>
|
||||
group by log_operator order by "date" desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="queryElogContextById" resultType="java.lang.Integer">
|
||||
select 1
|
||||
from ${tableName}
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="queryElogTraceInfo" resultType="java.util.Map">
|
||||
select operatorname,
|
||||
targetname,
|
||||
modulename,
|
||||
operatetypename,
|
||||
DATE_FORMAT(log_date, "%Y-%m-%d %H:%i:%S") createdate
|
||||
from ${tableName}
|
||||
where belongmainid = #{traceId}
|
||||
order by log_date desc, id desc LIMIT #{offset}, #{pageSize}
|
||||
</select>
|
||||
<select id="queryElogTraceInfo" resultType="java.util.Map" databaseId="postgresql">
|
||||
select operatorname,
|
||||
targetname,
|
||||
modulename,
|
||||
operatetypename,
|
||||
to_char(log_date::timestamp, 'YYYY-MM-DD HH24:MI:SS') createdate
|
||||
from ${tableName}
|
||||
where belongmainid = #{traceId}
|
||||
order by log_date desc, id desc limit #{pageSize}
|
||||
offset #{offset}
|
||||
|
||||
</select>
|
||||
<select id="queryElogTraceInfo" resultType="java.util.Map" databaseId="oracle">
|
||||
SELECT operatorname, targetname, modulename, operatetypename
|
||||
FROM (SELECT TMP.*, ROWNUM ROW_ID
|
||||
FROM (select t.*, to_char(log_date, 'yyyy-mm-dd HH24:mi:ss') createdate
|
||||
from ${tableName} t
|
||||
where belongmainid = #{traceId}
|
||||
order by log_date desc, id desc) TMP
|
||||
WHERE ROWNUM <= (#{pageSize} + #{offset}))
|
||||
WHERE ROW_ID > #{offset}
|
||||
|
||||
|
||||
</select>
|
||||
<select id="queryElogTraceInfo" resultType="java.util.Map" databaseId="sqlserver">
|
||||
select atmp.operatorname, atmp.targetname, atmp.modulename, atmp.operatetypename
|
||||
from (select atmp.*, row_number() over(order by log_date desc ,id desc ) as rownumber
|
||||
from (select top(#{pageSize}) atmp.*
|
||||
from (select *, convert(nvarchar(19), log_date, 120) createdate
|
||||
from ${tableName}
|
||||
where belongmainid = #{traceId}) atmp
|
||||
order by log_date desc, id desc) atmp) atmp
|
||||
where rownumber > #{offset}
|
||||
order by log_date desc, id desc
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
<select id="queryElogTraceInfoCount" resultType="java.lang.Integer">
|
||||
select count(id) id
|
||||
from ${tableName}
|
||||
where belongmainid = #{traceId}
|
||||
</select>
|
||||
|
||||
<select id="queryLogInfoByCustom" resultType="java.util.Map">
|
||||
select * from ${tableName}
|
||||
<where>${sql}</where>
|
||||
</select>
|
||||
|
||||
<select id="queryAllChangesData" resultType="java.util.Map">
|
||||
select *
|
||||
from ${tableName}
|
||||
where mainid = #{mainid}
|
||||
order by showorder asc, id asc
|
||||
</select>
|
||||
|
||||
<select id="queryTenantKeyOperators" resultType="com.engine.salary.elog.entity.dto.ReadInfoEntity">
|
||||
select log_operator employeeId, max(log_date) date
|
||||
from ${tableName}
|
||||
where tenant_key = #{tenantKey}
|
||||
and targetid = #{targetId}
|
||||
and operatetype = #{operateType}
|
||||
group by log_operator
|
||||
order by date desc
|
||||
</select>
|
||||
|
||||
<select id="queryTenantKeyOperators" resultType="com.engine.salary.elog.entity.dto.ReadInfoEntity" databaseId="postgresql">
|
||||
select log_operator employeeId, max(log_date) date
|
||||
from ${tableName}
|
||||
where tenant_key = #{tenantKey}
|
||||
and targetid = #{targetId}
|
||||
and operatetype = #{operateType}
|
||||
group by log_operator
|
||||
order by date desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="queryTenantKeyOperators" resultType="com.engine.salary.elog.entity.dto.ReadInfoEntity" databaseId="oracle">
|
||||
select log_operator employeeId, max(log_date) "date"
|
||||
from ${tableName}
|
||||
where tenant_key = #{tenantKey}
|
||||
and targetid = #{targetId}
|
||||
and operatetype = #{operateType}
|
||||
group by log_operator
|
||||
order by "date" desc
|
||||
</select>
|
||||
<select id="queryTenantKeyOperators" resultType="com.engine.salary.elog.entity.dto.ReadInfoEntity" databaseId="sqlserver">
|
||||
select log_operator employeeId, max(log_date) "date"
|
||||
from ${tableName}
|
||||
where tenant_key = #{tenantKey}
|
||||
and targetid = #{targetId}
|
||||
and operatetype = #{operateType}
|
||||
group by log_operator
|
||||
order by "date" desc
|
||||
</select>
|
||||
|
||||
<select id="queryAllChangesDataPages" resultType="java.util.Map">
|
||||
select *
|
||||
from ${tableName}
|
||||
where mainid = #{mainid}
|
||||
order by showorder asc, id asc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="queryAllChangesPageCounts" resultType="java.lang.Integer">
|
||||
select count(*)
|
||||
from ${tableName}
|
||||
where mainid = #{mainid}
|
||||
</select>
|
||||
<select id="elogCountOnlyNum" resultType="java.lang.Long">
|
||||
select count(*) from ${tableName}
|
||||
where modulename = #{logContent.moduleName} and functionname = #{logContent.functionName}
|
||||
and delete_type = 0
|
||||
<if test="logContent.operator != null and logContent.operator !=''">
|
||||
and log_operator = #{logContent.operator}
|
||||
</if>
|
||||
<if test="conditionSql != null">${conditionSql}</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -14,7 +14,6 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
|||
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveDataDTO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.salaryacct.SalaryAcctEmployeeMapper;
|
||||
|
|
@ -288,7 +287,7 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = listByParam(queryParam);
|
||||
Set<String> keySet = SalaryEntityUtil.properties(salaryAcctEmployeePOS, salaryAcctEmployeePO -> salaryAcctEmployeePO.getEmployeeId() + "-" + salaryAcctEmployeePO.getTaxAgentId());
|
||||
List<SalaryAcctEmployeePO> resultList = Lists.newArrayList();
|
||||
if(CollectionUtils.isNotEmpty(keySet)){
|
||||
if (CollectionUtils.isNotEmpty(keySet)) {
|
||||
lastMonthSalaryAcctEmployeePOMap.forEach((k, v) -> {
|
||||
if (!keySet.contains(k)) {
|
||||
resultList.add(v);
|
||||
|
|
@ -556,19 +555,22 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
SalaryAcctEmployeePO lambdaQueryChainWrapper = SalaryAcctEmployeePO.builder().build();
|
||||
|
||||
// 个税扣缴义务人
|
||||
Collection<TaxAgentPO> taxAgentList = getTaxAgentService(user).listAllTaxAgents((long) user.getUID());
|
||||
if (CollectionUtils.isNotEmpty(taxAgentList)) {
|
||||
List<Long> taxAgentIds = taxAgentList.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
// 有查询参数就取交集
|
||||
if (CollectionUtils.isNotEmpty(param.getTaxAgent())) {
|
||||
List<Long> finalTaxAgentIds = taxAgentIds;
|
||||
taxAgentIds = param.getTaxAgent().stream().filter(finalTaxAgentIds::contains).collect(Collectors.toList());
|
||||
lambdaQueryChainWrapper.setTaxAgentIds(CollectionUtils.isEmpty(taxAgentIds) ? Collections.singletonList(0L) : taxAgentIds);
|
||||
} else {
|
||||
lambdaQueryChainWrapper.setTaxAgentIds(taxAgentIds);
|
||||
}
|
||||
} else {
|
||||
lambdaQueryChainWrapper.setTaxAgentIds(Collections.singletonList(0L));
|
||||
// Collection<TaxAgentPO> taxAgentList = getTaxAgentService(user).listAllTaxAgents((long) user.getUID());
|
||||
// if (CollectionUtils.isNotEmpty(taxAgentList)) {
|
||||
// List<Long> taxAgentIds = taxAgentList.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
// // 有查询参数就取交集
|
||||
// if (CollectionUtils.isNotEmpty(param.getTaxAgent())) {
|
||||
// List<Long> finalTaxAgentIds = taxAgentIds;
|
||||
// taxAgentIds = param.getTaxAgent().stream().filter(finalTaxAgentIds::contains).collect(Collectors.toList());
|
||||
// lambdaQueryChainWrapper.setTaxAgentIds(CollectionUtils.isEmpty(taxAgentIds) ? Collections.singletonList(0L) : taxAgentIds);
|
||||
// } else {
|
||||
// lambdaQueryChainWrapper.setTaxAgentIds(taxAgentIds);
|
||||
// }
|
||||
// } else {
|
||||
// lambdaQueryChainWrapper.setTaxAgentIds(Collections.singletonList(0L));
|
||||
// }
|
||||
if (CollectionUtils.isNotEmpty(param.getTaxAgent())) {
|
||||
lambdaQueryChainWrapper.setTaxAgentIds(param.getTaxAgent());
|
||||
}
|
||||
|
||||
// 薪资所属月
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import com.engine.core.impl.Service;
|
|||
import com.engine.salary.biz.SalaryItemBiz;
|
||||
import com.engine.salary.biz.SysSalaryItemBiz;
|
||||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.salary.elog.dto.LoggerContext;
|
||||
import com.engine.salary.elog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.elog.util.LoggerTemplate;
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaPO;
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaVar;
|
||||
|
|
|
|||
Loading…
Reference in New Issue