diff --git a/src/com/api/salary/web/LoggerTableController.java b/src/com/api/salary/web/LoggerTableController.java index eb33772ce..ddf2b4f41 100644 --- a/src/com/api/salary/web/LoggerTableController.java +++ b/src/com/api/salary/web/LoggerTableController.java @@ -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{ } diff --git a/src/com/engine/salary/elog/annotation/ElogField.java b/src/com/engine/salary/elog/annotation/ElogField.java index 557a14f3c..a60c1f6a7 100644 --- a/src/com/engine/salary/elog/annotation/ElogField.java +++ b/src/com/engine/salary/elog/annotation/ElogField.java @@ -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.*; diff --git a/src/com/engine/salary/elog/annotation/OperateType.java b/src/com/engine/salary/elog/annotation/OperateType.java new file mode 100644 index 000000000..7dbb84303 --- /dev/null +++ b/src/com/engine/salary/elog/annotation/OperateType.java @@ -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 = "删除"; +} diff --git a/src/com/engine/salary/elog/annotation/handle/ElogTableScanner.java b/src/com/engine/salary/elog/annotation/handle/ElogTableScanner.java index 4e75cf8bb..a024d3478 100644 --- a/src/com/engine/salary/elog/annotation/handle/ElogTableScanner.java +++ b/src/com/engine/salary/elog/annotation/handle/ElogTableScanner.java @@ -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; diff --git a/src/com/engine/salary/elog/async/LoggerMessageListener.java b/src/com/engine/salary/elog/async/LoggerMessageListener.java index 6687a0603..2bf5dc957 100644 --- a/src/com/engine/salary/elog/async/LoggerMessageListener.java +++ b/src/com/engine/salary/elog/async/LoggerMessageListener.java @@ -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; diff --git a/src/com/engine/salary/elog/config/ELogTableChecker.java b/src/com/engine/salary/elog/config/ELogTableChecker.java index acbb1dc89..272da15a7 100644 --- a/src/com/engine/salary/elog/config/ELogTableChecker.java +++ b/src/com/engine/salary/elog/config/ELogTableChecker.java @@ -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; diff --git a/src/com/engine/salary/elog/dto/CancelContext.java b/src/com/engine/salary/elog/entity/dto/CancelContext.java similarity index 92% rename from src/com/engine/salary/elog/dto/CancelContext.java rename to src/com/engine/salary/elog/entity/dto/CancelContext.java index 1c9771b69..d7ecccb7b 100644 --- a/src/com/engine/salary/elog/dto/CancelContext.java +++ b/src/com/engine/salary/elog/entity/dto/CancelContext.java @@ -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; diff --git a/src/com/engine/salary/elog/dto/DataTypeEnum.java b/src/com/engine/salary/elog/entity/dto/DataTypeEnum.java similarity index 78% rename from src/com/engine/salary/elog/dto/DataTypeEnum.java rename to src/com/engine/salary/elog/entity/dto/DataTypeEnum.java index 4b46cdd33..b31b8e490 100644 --- a/src/com/engine/salary/elog/dto/DataTypeEnum.java +++ b/src/com/engine/salary/elog/entity/dto/DataTypeEnum.java @@ -1,4 +1,4 @@ -package com.engine.salary.elog.dto; +package com.engine.salary.elog.entity.dto; public enum DataTypeEnum { VARCHAR, diff --git a/src/com/engine/salary/elog/dto/ElogBean.java b/src/com/engine/salary/elog/entity/dto/ElogBean.java similarity index 98% rename from src/com/engine/salary/elog/dto/ElogBean.java rename to src/com/engine/salary/elog/entity/dto/ElogBean.java index d4239b9a7..b79b0f66e 100644 --- a/src/com/engine/salary/elog/dto/ElogBean.java +++ b/src/com/engine/salary/elog/entity/dto/ElogBean.java @@ -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; diff --git a/src/com/engine/salary/elog/dto/FilterConditionDto.java b/src/com/engine/salary/elog/entity/dto/FilterConditionDto.java similarity index 97% rename from src/com/engine/salary/elog/dto/FilterConditionDto.java rename to src/com/engine/salary/elog/entity/dto/FilterConditionDto.java index d276b1b27..28cb451e5 100644 --- a/src/com/engine/salary/elog/dto/FilterConditionDto.java +++ b/src/com/engine/salary/elog/entity/dto/FilterConditionDto.java @@ -1,4 +1,4 @@ -package com.engine.salary.elog.dto; +package com.engine.salary.elog.entity.dto; import java.io.Serializable; diff --git a/src/com/engine/salary/elog/entity/dto/Like.java b/src/com/engine/salary/elog/entity/dto/Like.java new file mode 100644 index 000000000..2caead76c --- /dev/null +++ b/src/com/engine/salary/elog/entity/dto/Like.java @@ -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; + } +} diff --git a/src/com/engine/salary/elog/dto/LoggerContext.java b/src/com/engine/salary/elog/entity/dto/LoggerContext.java similarity index 99% rename from src/com/engine/salary/elog/dto/LoggerContext.java rename to src/com/engine/salary/elog/entity/dto/LoggerContext.java index 5b00005f0..f9be10c8f 100644 --- a/src/com/engine/salary/elog/dto/LoggerContext.java +++ b/src/com/engine/salary/elog/entity/dto/LoggerContext.java @@ -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; diff --git a/src/com/engine/salary/elog/dto/LoggerDetailContext.java b/src/com/engine/salary/elog/entity/dto/LoggerDetailContext.java similarity index 99% rename from src/com/engine/salary/elog/dto/LoggerDetailContext.java rename to src/com/engine/salary/elog/entity/dto/LoggerDetailContext.java index 7bb64e1ff..ef4a66503 100644 --- a/src/com/engine/salary/elog/dto/LoggerDetailContext.java +++ b/src/com/engine/salary/elog/entity/dto/LoggerDetailContext.java @@ -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; diff --git a/src/com/engine/salary/elog/entity/dto/ReadInfoEntity.java b/src/com/engine/salary/elog/entity/dto/ReadInfoEntity.java new file mode 100644 index 000000000..3f7a364e4 --- /dev/null +++ b/src/com/engine/salary/elog/entity/dto/ReadInfoEntity.java @@ -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; + } +} \ No newline at end of file diff --git a/src/com/engine/salary/elog/dto/RedoContext.java b/src/com/engine/salary/elog/entity/dto/RedoContext.java similarity index 91% rename from src/com/engine/salary/elog/dto/RedoContext.java rename to src/com/engine/salary/elog/entity/dto/RedoContext.java index 749643aed..3ec87adb3 100644 --- a/src/com/engine/salary/elog/dto/RedoContext.java +++ b/src/com/engine/salary/elog/entity/dto/RedoContext.java @@ -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; diff --git a/src/com/engine/salary/elog/dto/ShowColumsDto.java b/src/com/engine/salary/elog/entity/dto/ShowColumsDto.java similarity index 97% rename from src/com/engine/salary/elog/dto/ShowColumsDto.java rename to src/com/engine/salary/elog/entity/dto/ShowColumsDto.java index 828474be5..b5f47e084 100644 --- a/src/com/engine/salary/elog/dto/ShowColumsDto.java +++ b/src/com/engine/salary/elog/entity/dto/ShowColumsDto.java @@ -1,4 +1,4 @@ -package com.engine.salary.elog.dto; +package com.engine.salary.elog.entity.dto; import java.io.Serializable; diff --git a/src/com/engine/salary/elog/dto/TableChangeBean.java b/src/com/engine/salary/elog/entity/dto/TableChangeBean.java similarity index 98% rename from src/com/engine/salary/elog/dto/TableChangeBean.java rename to src/com/engine/salary/elog/entity/dto/TableChangeBean.java index 463d9dd73..445bd8510 100644 --- a/src/com/engine/salary/elog/dto/TableChangeBean.java +++ b/src/com/engine/salary/elog/entity/dto/TableChangeBean.java @@ -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; diff --git a/src/com/engine/salary/elog/dto/TableColumnBean.java b/src/com/engine/salary/elog/entity/dto/TableColumnBean.java similarity index 98% rename from src/com/engine/salary/elog/dto/TableColumnBean.java rename to src/com/engine/salary/elog/entity/dto/TableColumnBean.java index cf8609c61..a6fdf6148 100644 --- a/src/com/engine/salary/elog/dto/TableColumnBean.java +++ b/src/com/engine/salary/elog/entity/dto/TableColumnBean.java @@ -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; diff --git a/src/com/engine/salary/elog/entity/param/ELogGetLogParam.java b/src/com/engine/salary/elog/entity/param/ELogGetLogParam.java new file mode 100644 index 000000000..77132c908 --- /dev/null +++ b/src/com/engine/salary/elog/entity/param/ELogGetLogParam.java @@ -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; + +} diff --git a/src/com/engine/salary/elog/service/ILocalElogService.java b/src/com/engine/salary/elog/service/ILocalElogService.java index 9d721b69c..af12b54c8 100644 --- a/src/com/engine/salary/elog/service/ILocalElogService.java +++ b/src/com/engine/salary/elog/service/ILocalElogService.java @@ -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 { diff --git a/src/com/engine/salary/elog/service/ILoggerTableService.java b/src/com/engine/salary/elog/service/ILoggerTableService.java index 00c5b6327..e59fde3fb 100644 --- a/src/com/engine/salary/elog/service/ILoggerTableService.java +++ b/src/com/engine/salary/elog/service/ILoggerTableService.java @@ -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); diff --git a/src/com/engine/salary/elog/service/impl/LocalElogService.java b/src/com/engine/salary/elog/service/impl/LocalElogService.java index d12163a29..3900f4727 100644 --- a/src/com/engine/salary/elog/service/impl/LocalElogService.java +++ b/src/com/engine/salary/elog/service/impl/LocalElogService.java @@ -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; diff --git a/src/com/engine/salary/elog/service/impl/LoggerTableService.java b/src/com/engine/salary/elog/service/impl/LoggerTableService.java index bb5dfc812..f81a8c0ab 100644 --- a/src/com/engine/salary/elog/service/impl/LoggerTableService.java +++ b/src/com/engine/salary/elog/service/impl/LoggerTableService.java @@ -4,113 +4,75 @@ import cn.hutool.core.date.DateUtil; import com.alibaba.fastjson.JSON; 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.LoggerContext; -import com.engine.salary.elog.dto.ShowColumsDto; +import com.cloudstore.eccom.pc.table.WeaTable; +import com.cloudstore.eccom.pc.table.WeaTableColumn; +import com.engine.core.impl.Service; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +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.enums.ElogConsts; import com.engine.salary.elog.service.ILoggerTableService; import com.engine.salary.elog.util.ElogServiceUtils; +import com.engine.salary.elog.util.ElogSeviceSwitchUtils; import com.engine.salary.elog.util.ElogSeviceUtils; +import com.engine.salary.elog.util.FieldNameMap; import com.engine.salary.mapper.elog.LocalElogDaoMapper; -import com.weaver.common.batch.consts.FileType; -import com.weaver.common.batch.consts.HandlerFileMethod; -import com.weaver.common.batch.entity.BatchDocumentMessage; -import com.weaver.common.batch.entity.BatchFile; -import com.weaver.common.batch.entity.ExcelSheet; -import com.weaver.common.batch.sender.BatchExportSender; -import com.weaver.common.cache.tablecache.impl.ComInfoCache; -import com.weaver.common.component.table.WeaTable; -import com.weaver.common.component.table.column.WeaTableColumn; -import com.weaver.common.component.table.page.Page; -import com.weaver.common.distribution.genid.IdGenerator; -import com.weaver.common.elog.annotation.HandleElog; -import com.weaver.common.elog.annotation.OperateType; -import com.weaver.common.elog.annotation.handle.ElogMethodHandler; -import com.weaver.common.elog.annotation.handle.MethodHandler; -import com.weaver.common.elog.consts.ElogEsTableConsts; -import com.weaver.common.elog.dao.QueryCommonTabeMapper; -import com.weaver.common.elog.dto.*; -import com.weaver.common.elog.enums.ElogConsts; -import com.weaver.common.elog.service.ApplicationContextProvider; -import com.weaver.common.elog.service.ElogHandleService; -import com.weaver.common.elog.util.*; -import com.weaver.common.hrm.cache.HrmAvatarComInfo; -import com.weaver.common.hrm.cache.HrmEmployeeComInfo; -import com.weaver.common.hrm.domain.organization.HrmConditionResultType; -import com.weaver.common.hrm.domain.organization.HrmOrgEmpCondition; -import com.weaver.common.hrm.entity.employee.HrmEmployee; -import com.weaver.common.hrm.service.HrmCommonEmployeeService; -import com.weaver.common.hrm.util.HrmCommonUtil; -import com.weaver.common.hrm.util.HrmI18nUtil; -import com.weaver.common.i18n.label.SystemEnv; -import com.weaver.common.i18n.tool.config.date.format.DateRangeTransformer; -import com.weaver.common.i18n.tool.util.I18nUtil; -import com.weaver.common.mybatis.baseConfig.WeaDatabaseIdProvider; -import com.weaver.common.mybatis.util.DatabaseUtil; -import com.weaver.common.security.util.SecurityUtil; -import com.weaver.framework.rpc.context.impl.TenantRpcContext; -import com.weaver.teams.security.context.UserContext; -import com.weaver.teams.security.user.User; -import org.apache.commons.collections.CollectionUtils; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.MapperProxyFactory; +import com.engine.salary.util.page.Column; +import com.engine.salary.util.page.PageInfo; +import com.engine.salary.util.page.SalaryPageUtil; +import com.github.pagehelper.Page; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; -import org.elasticsearch.action.admin.indices.get.GetIndexRequest; -import org.elasticsearch.action.search.SearchRequest; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.RequestOptions; -import org.elasticsearch.client.RestHighLevelClient; -import org.elasticsearch.client.indices.CreateIndexRequest; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.SearchHits; -import org.elasticsearch.search.builder.SearchSourceBuilder; -import org.elasticsearch.xcontent.XContentType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.annotation.AnnotationUtils; +import weaver.conn.RecordSet; +import weaver.general.Util; -import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; -import java.io.IOException; import java.util.*; import java.util.stream.Collectors; -import static com.weaver.common.elog.consts.LogConstants.MAPPING_TEMPLATE; - -public class LoggerTableService implements ILoggerTableService { +public class LoggerTableService extends Service implements ILoggerTableService { private static final Logger logger = LoggerFactory.getLogger(LoggerTableService.class); - @Autowired - private LocalElogDaoMapper localElogDaoMapper; + private LocalElogDaoMapper getLocalElogDaoMapper() { + return MapperProxyFactory.getProxy(LocalElogDaoMapper.class); + } - @Autowired - private ComInfoCache comInfoCache; - - @Autowired - private HrmCommonUtil hrmCommonUtil; - - @Autowired - private QueryCommonTabeMapper queryCommonTabeMapper; - - @Autowired - private RestHighLevelClient restHighLevelClient; - - @Resource - private BatchExportSender batchExportSender; - - - @Resource - private DateRangeTransformer dateRangeTransformer; - - @Autowired - private HrmCommonEmployeeService hrmCommonEmployeeService; - - - private static final String databaseId = DatabaseUtil.getDatabaseId(); + // +// private ComInfoCache comInfoCache; +// +// +// private HrmCommonUtil hrmCommonUtil; +// +// +// private QueryCommonTabeMapper queryCommonTabeMapper; +// +// +// private RestHighLevelClient restHighLevelClient; +// +// @Resource +// private BatchExportSender batchExportSender; +// +// +// @Resource +// private DateRangeTransformer dateRangeTransformer; +// +// +// private HrmCommonEmployeeService hrmCommonEmployeeService; +// +// + private final String databaseId = new RecordSet().getDBType(); @Override - public WeaTable queryLogs(String data) { + public PageInfo queryLogs(String data) { //解析数据 ElogBean elogBean = ElogServiceUtils.getElogBean(data); // columIndex统一转为小写 @@ -143,44 +105,14 @@ public class LoggerTableService implements ILoggerTableService { //获取主表 String tableName = ElogSeviceUtils.getTableName(module, function); //获取weaTable - WeaTable weaTable = new WeaTable(); - List recordColumns = getWeaColumns(data, showColums, module, function, weaTable); + List columns = getWeaColumns(data, showColums, module, function); //获取条件sql - String searchMapsql = getSearchMapSql(searchMap, module, function,elogBean.getShowColumns()); + String searchMapsql = getSearchMapSql(searchMap, module, function, elogBean.getShowColumns()); String sb = getQueryCondition(filterConditionDtos); sb = searchMapsql.concat(sb); - //处理数据权限 - Map res = getCustomAuthSql(transMethod, authParamsJson, "auth"); - if (!res.isEmpty()) { - Object flag = res.get("flag"); - if (flag != null && flag instanceof Boolean) { - boolean f = (boolean) flag; - if (!f) { - weaTable.setCustomParameters(res); - return weaTable; - } - } - } String customSql = getCustomSql(transMethod, sb, "before"); - //处理数据权限(前缀) - Map hashMap = addPermissionHandler(transMethod); - logger.info("查询条件sql:{}", customSql); - //处理数据权限(对接权限sql) - PermissionParams permissionParams = getPermissionParams(hashMap); - String permissionId = permissionParams.getPermissionId(); - String permissionType = permissionParams.getPermissionType(); - String mainDataTable = permissionParams.getMainDataTable(); - String mainDataTableAlias = permissionParams.getMainDataTableAlias(); - String primaryKey = permissionParams.getPrimaryKey(); - String permissionTargetId = permissionParams.getPermissionTargetId(); - String permissionConfigSourceId = permissionParams.getPermissionConfigSourceId(); - - - // 设置操作菜单 - //weaTable.getOperates().add(new WeaTableOperate("查看", 1)); // 分页 - //Page page = ElogSeviceUtils.getPage(); Page page = null; if (StringUtils.isEmpty(downloadSize)) { page = new Page(ElogSeviceUtils.getIntValue(pageNum, 1), ElogSeviceUtils.getIntValue(pageSize, 10)); @@ -189,49 +121,9 @@ public class LoggerTableService implements ILoggerTableService { page = new Page(1, pagesize); } - String columns = getshowColumsStr(showColums); + List list = getLocalElogDaoMapper().queryElogList(page, context, null, tableName, customSql, "*"); + Map countMap = getLocalElogDaoMapper().elogCount(context, tableName, customSql); - Map countMap = new HashMap<>(); - Long countNum = 0l; - - //最终查询前 - List interceptChain = ApplicationContextProvider.getServiceBean(ElogHandleService.class) - .stream().filter(Objects::nonNull) - .filter(x -> x instanceof ElogHandleService) - .map(x -> (ElogHandleService) x) - .collect(Collectors.toList()); - - if (CollectionUtils.isNotEmpty(interceptChain)) { - for (ElogHandleService handleService : interceptChain) { - Class itemClass = handleService.getClass(); - HandleElog annotation = itemClass.getAnnotation(HandleElog.class); - if(Objects.isNull(annotation)){ - annotation = AnnotationUtils.findAnnotation(itemClass, HandleElog.class); - } - if(Objects.nonNull(annotation)){ - if(module.equalsIgnoreCase(annotation.modulename())){ - String employeeId = getUserId(); - long id = StringUtils.isEmpty(employeeId) ? -1 : Long.parseLong(employeeId); - ElogHandleDto elogHandleDto = new ElogHandleDto(module,function,context.getTenant_key(),id,customSql,filterConditionDtos); - boolean preQuery = handleService.preQuery(elogHandleDto); - customSql = elogHandleDto.getSql(); - } - } - } - } - - // 查询 - List list = new ArrayList<>(); - if (StringUtils.isNotEmpty(permissionId) || StringUtils.isNotEmpty(permissionType) || StringUtils.isNotEmpty(mainDataTableAlias) || StringUtils.isNotEmpty(mainDataTable) || StringUtils.isNotEmpty(permissionTargetId) || StringUtils.isNotEmpty(permissionConfigSourceId)) { - list = localElogDaoMapper.queryElogList(page, context, null, tableName, customSql, mainDataTable, permissionId, permissionType, mainDataTableAlias, primaryKey,permissionTargetId,permissionConfigSourceId,"*"); - countNum = localElogDaoMapper.elogCountOnlyNum(context, tableName, customSql, mainDataTable, permissionId, permissionType, mainDataTableAlias, primaryKey,permissionTargetId,permissionConfigSourceId); - } else { - list = localElogDaoMapper.queryElogList(page, context, null, tableName, customSql,"*"); - countMap = localElogDaoMapper.elogCount(context, tableName, customSql); - - } - - String databaseId = WeaDatabaseIdProvider.databaseId; if ("st".equals(databaseId)) { //st数据库 date类型特殊处理 list.forEach(map -> { @@ -243,49 +135,6 @@ public class LoggerTableService implements ILoggerTableService { }); } - - String propertiesValue = module + "." + function + ".es"; - String value = ApplicationContextProvider.getPropertiesValue(propertiesValue); - logger.info("propertiesValue:{},value:{}", propertiesValue,value); - if (StringUtils.isNotEmpty(value) && !value.equalsIgnoreCase("${" + propertiesValue + "}")) { - //if判断通过说明走了自定义ES存储es - String[] fields = getESfields(value); - if (fields != null && fields.length > 0) { - for (Map map : list) { - String logDate = map.get("log_date").toString(); - logger.info("logDate:{}" ,logDate); - String esDate = logDate.substring(0, 10); - //先判断表存不存在,不存在创建 - if (checkEsTableIsExist(esDate)) { - // 根据id通过es查询大字段(params)然后赋值 - SearchRequest searchRequest = new SearchRequest(getElogESTableName(true,esDate)); - SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); - // 只获取指定字段 - searchSourceBuilder.fetchSource(fields, null); - // 根据id匹配 - searchSourceBuilder.query(QueryBuilders.termQuery("id",map.get("id").toString())); - searchRequest.source(searchSourceBuilder); - - SearchResponse searchResponse = null; - try { - searchResponse = restHighLevelClient.search(searchRequest, RequestOptions.DEFAULT); - } catch (IOException e) { - logger.info("查询ES出现异常:{}",e.getMessage()); - } - SearchHits hits = searchResponse.getHits(); - SearchHit[] searchHits = hits.getHits(); - if (searchHits != null && searchHits.length > 0) { - // 根据id匹配唯一,所以直接取第一个 - Map sourceAsMap = searchHits[0].getSourceAsMap(); - if (Objects.nonNull(sourceAsMap) && sourceAsMap.size() > 0) { - logger.info("ES查出来的sourceAsMap:{}",JSON.toJSONString(sourceAsMap)); - map.putAll(sourceAsMap); - } - } - } - } - } - } //处理转换其他数据库类型值 list = ElogSeviceSwitchUtils.getSwitchDatabaseData(list); //处理用户信息Data @@ -293,45 +142,11 @@ public class LoggerTableService implements ILoggerTableService { // 大小写转换 ElogSeviceSwitchUtils.changKey2Lower(list); - transSwitchDataInfo(list,recordColumns); - //转换多语言 - //ElogSeviceSwitchUtils.switchValues(list, recordColumns, true); - //ElogSeviceSwitchUtils.switchChangeValues(list); - logger.info("开始执行转换方法"); - if (Util.isNotEmpty(transMethod)) { - logger.info("转换方法:{}", transMethod); - // 消费到消息,通过MethodHandler调用对应的方法 - MethodHandler methodHandler = ElogMethodHandler.loadMethodHandler(transMethod); - if (methodHandler != null) { - try { - logger.info("执行方法前的数据:{}", JSON.toJSONString(list)); - methodHandler.execute(list); - logger.info("执行方法后的数据:{}", JSON.toJSONString(list)); - } catch (Exception e) { - logger.error("转换出错:" + e); - } - } - - } - page.setTotal(ElogSeviceUtils.getLongValue(countMap.get("counts") + "", 0)); - page.setRecords(switchString(list)); - if (!countNum.equals(0l)) { - //countNum不为0 则覆盖 - page.setTotal(countNum); - - } - // 处理后的数据 - // weaTable.setDisplayData(DataTransform.userProcessData(page.getRecords())); - - // 处理操作菜单权限 - //weaTable.setOperatesPermission(DataTransform.userOperatesPermission(page.getRecords())); - - // 处理选择框权限 - //weaTable.setCheckBoxPermission(DataTransform.userCheckBoxPermission(page.getRecords())); - // 存放结果集 - weaTable.setPage(page); - return weaTable; + PageInfo pageInfo = SalaryPageUtil.buildPage(page.getPageNum(), page.getPageSize(), switchString(list)); + pageInfo.setTotal(ElogSeviceUtils.getLongValue(countMap.get("counts") + "", 0)); + pageInfo.setColumns(columns); + return pageInfo; } @Override @@ -350,13 +165,13 @@ public class LoggerTableService implements ILoggerTableService { sb.append("id,uuid,targetid,params,operatetype,link_id,link_type,"); for (ShowColumsDto showColum : showColums) { String columIndex = showColum.getColumIndex(); - if ("date".equalsIgnoreCase(columIndex) || "createdate".equalsIgnoreCase(columIndex)){ + if ("date".equalsIgnoreCase(columIndex) || "createdate".equalsIgnoreCase(columIndex)) { columIndex = "log_date"; - }else if ("operator".equalsIgnoreCase(columIndex)){ + } else if ("operator".equalsIgnoreCase(columIndex)) { columIndex = "log_operator"; - }else if ("modulenamespan".equalsIgnoreCase(columIndex)){ + } else if ("modulenamespan".equalsIgnoreCase(columIndex)) { columIndex = "modulename"; - } else if ("functionnameespan".equalsIgnoreCase(columIndex)){ + } else if ("functionnameespan".equalsIgnoreCase(columIndex)) { columIndex = "functionname"; } else if ("avatar".equals(columIndex)) { continue; @@ -367,63 +182,48 @@ public class LoggerTableService implements ILoggerTableService { return substring; } - private PermissionParams getPermissionParams(Map hashMap) { - PermissionParams permissionParams = new PermissionParams(); - String permissionId = getPermissionStr(hashMap, "permissionId"); - String permissionType = getPermissionStr(hashMap, "permissionType"); - String mainDataTableAlias = getPermissionStr(hashMap, "mainDataTableAlias"); - String mainDataTable = getPermissionStr(hashMap, "mainDataTable"); - String primaryKey = getPermissionStr(hashMap, "primaryKey"); - String permissionTargetId = getPermissionStr(hashMap, "permissionTargetId"); - String permissionConfigSourceId = getPermissionStr(hashMap, "permissionConfigSourceId"); +// private PermissionParams getPermissionParams(Map hashMap) { +// PermissionParams permissionParams = new PermissionParams(); +// String permissionId = getPermissionStr(hashMap, "permissionId"); +// String permissionType = getPermissionStr(hashMap, "permissionType"); +// String mainDataTableAlias = getPermissionStr(hashMap, "mainDataTableAlias"); +// String mainDataTable = getPermissionStr(hashMap, "mainDataTable"); +// String primaryKey = getPermissionStr(hashMap, "primaryKey"); +// String permissionTargetId = getPermissionStr(hashMap, "permissionTargetId"); +// String permissionConfigSourceId = getPermissionStr(hashMap, "permissionConfigSourceId"); +// +// permissionParams.setPermissionId(permissionId); +// permissionParams.setPermissionType(permissionType); +// permissionParams.setMainDataTableAlias(mainDataTableAlias); +// permissionParams.setMainDataTable(mainDataTable); +// permissionParams.setPrimaryKey(primaryKey); +// permissionParams.setPermissionTargetId(permissionTargetId); +// permissionParams.setPermissionConfigSourceId(permissionConfigSourceId); +// +// return permissionParams; +// +// } - permissionParams.setPermissionId(permissionId); - permissionParams.setPermissionType(permissionType); - permissionParams.setMainDataTableAlias(mainDataTableAlias); - permissionParams.setMainDataTable(mainDataTable); - permissionParams.setPrimaryKey(primaryKey); - permissionParams.setPermissionTargetId(permissionTargetId); - permissionParams.setPermissionConfigSourceId(permissionConfigSourceId); - - return permissionParams; - - } - - private List getWeaColumns(String data, List showColums, String module, String function, WeaTable weaTable) { - // 每一个Table的唯一标识 - weaTable.setPageUid(IdGenerator.generate() + ""); - // 表头 - //weaTable.getColumns().add(new WeaTableColumn("id","id", true)); - List recordColumns = new ArrayList<>(); + private List getWeaColumns(String data, List showColums, String module, String function) { + List columns = new ArrayList<>(); if (showColums != null && showColums.size() > 0) { for (ShowColumsDto showColum : showColums) { - if (showColum.isTransfLanguage()) { - recordColumns.add(showColum.getColumIndex()); - } if (StringUtils.isNotBlank(showColum.getAliasColumName())) { - WeaTableColumn weaTableColumn = new WeaTableColumn(showColum.getAliasColumName(), showColum.getColumIndex(), getColumnsWidth(showColum), "", showColum.isHide()); - if (showColum.isNewLine()) { - weaTableColumn.setNewLine(showColum.isNewLine()); - } - weaTable.getColumns().add(weaTableColumn); + columns.add(new Column(showColum.getAliasColumName(), showColum.getColumIndex(), showColum.getColumIndex())); } else if (StringUtils.isNotBlank(showColum.getColumName())) { - WeaTableColumn weaTableColumn = new WeaTableColumn(FieldNameMap.getMainFieldNameMap(data, function, showColum.getColumName()), showColum.getColumIndex(), getColumnsWidth(showColum), "", showColum.isHide()); - if (showColum.isNewLine()) { - weaTableColumn.setNewLine(showColum.isNewLine()); - } - weaTable.getColumns().add(weaTableColumn); + columns.add(new Column(FieldNameMap.getMainFieldNameMap(data, function, showColum.getColumName()), showColum.getColumIndex(), showColum.getColumIndex())); } } } else { - weaTable.getColumns().add(new WeaTableColumn(FieldNameMap.getMainFieldNameMap(module, function, "moduleName"), "modulenamespan", "5%")); - weaTable.getColumns().add(new WeaTableColumn(FieldNameMap.getMainFieldNameMap(module, function, "functionName"), "functionnamespan", "5%")); - weaTable.getColumns().add(new WeaTableColumn(FieldNameMap.getMainFieldNameMap(module, function, "clientIp"), "clientip", "5%")); - weaTable.getColumns().add(new WeaTableColumn(FieldNameMap.getMainFieldNameMap(module, function, "operateTypeName"), "operatetypename", "5%")); - weaTable.getColumns().add(new WeaTableColumn(FieldNameMap.getMainFieldNameMap(module, function, "targetName"), "targetname", "5%")); - weaTable.getColumns().add(new WeaTableColumn(FieldNameMap.getMainFieldNameMap(module, function, "date"), "createdate", "5%")); - weaTable.getColumns().add(new WeaTableColumn(FieldNameMap.getMainFieldNameMap(module, function, "operatorName"), "operatorname", "5%")); + 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")); } - return recordColumns; + return columns; } private String getTargetid(List filterConditionDtos) { @@ -447,229 +247,116 @@ public class LoggerTableService implements ILoggerTableService { return ""; } - /** - * 处理数据权限 - * - * @param transMethod - * @return - */ - private Map addPermissionHandler(String transMethod) { - Map hashMap = new HashMap(); - hashMap.put("permissionId", ""); - hashMap.put("permissionType", ""); - hashMap.put("mainDataTableAlias", ""); - hashMap.put("mainDataTable", ""); - hashMap.put("primaryKey", ""); - hashMap.put("permissionTargetId", ""); - hashMap.put("permissionConfigSourceId", ""); - - MethodHandler beforeMethodHandler = ElogMethodHandler.loadMethodHandler("permission" + transMethod); - if (beforeMethodHandler != null) { - try { - Object execute = beforeMethodHandler.execute(hashMap); - if (execute != null) { - if (execute instanceof Map) { - return (Map) execute; - } - } - } catch (Exception e) { - logger.error("转换出错:" + e); - throw new RuntimeException(e.getMessage()); - } - } - return hashMap; - } - - private Map getCustomAuthSql(String transMethod, Map params, String prefix) { - MethodHandler beforeMethodHandler = ElogMethodHandler.loadMethodHandler(prefix + transMethod); - Map hashMap = new HashMap<>(); - if (beforeMethodHandler != null) { - try { - hashMap.put("flag", true); - hashMap.put("msg", ""); - hashMap.putAll(params); - Object execute = beforeMethodHandler.execute(hashMap); - if (execute != null && execute instanceof Map) { - Map map = (Map) execute; - return map; - } - } catch (Exception e) { - logger.error("转换出错:" + e); - throw new RuntimeException(e.getMessage()); - } - } - return hashMap; - } +// private Map getCustomAuthSql(String transMethod, Map params, String prefix) { +// MethodHandler beforeMethodHandler = ElogMethodHandler.loadMethodHandler(prefix + transMethod); +// Map hashMap = new HashMap<>(); +// if (beforeMethodHandler != null) { +// try { +// hashMap.put("flag", true); +// hashMap.put("msg", ""); +// hashMap.putAll(params); +// Object execute = beforeMethodHandler.execute(hashMap); +// if (execute != null && execute instanceof Map) { +// Map map = (Map) execute; +// return map; +// } +// } catch (Exception e) { +// logger.error("转换出错:" + e); +// throw new RuntimeException(e.getMessage()); +// } +// } +// return hashMap; +// } private String getCustomSql(String transMethod, String sql, String prefix) { - MethodHandler beforeMethodHandler = ElogMethodHandler.loadMethodHandler(prefix + transMethod); - boolean flag = false; - if (beforeMethodHandler != null) { - try { - String subSql = ""; - if (sql.length() > 5) { - flag = true; - subSql = sql.substring(5, sql.length()); - } - Object execute = beforeMethodHandler.execute(subSql); - if (execute != null) { - if (execute instanceof String) { - StringBuffer sb = null; - if(execute.toString().length()==0){ - sb = new StringBuffer(); - } else if (flag || execute.toString().length() > 0) { - sb = new StringBuffer(" and "); - } else { - sb = new StringBuffer(); - } - - sb.append(execute.toString()); - return sb.toString(); - } - } - } catch (Exception e) { - logger.error("转换出错:" + e); - throw new RuntimeException(e.getMessage()); - } - } +// MethodHandler beforeMethodHandler = ElogMethodHandler.loadMethodHandler(prefix + transMethod); +// boolean flag = false; +// if (beforeMethodHandler != null) { +// try { +// String subSql = ""; +// if (sql.length() > 5) { +// flag = true; +// subSql = sql.substring(5, sql.length()); +// } +// Object execute = beforeMethodHandler.execute(subSql); +// if (execute != null) { +// if (execute instanceof String) { +// StringBuffer sb = null; +// if(execute.toString().length()==0){ +// sb = new StringBuffer(); +// } else if (flag || execute.toString().length() > 0) { +// sb = new StringBuffer(" and "); +// } else { +// sb = new StringBuffer(); +// } +// +// sb.append(execute.toString()); +// return sb.toString(); +// } +// } +// } catch (Exception e) { +// logger.error("转换出错:" + e); +// throw new RuntimeException(e.getMessage()); +// } +// } return sql; } private void transUserInfo(List list) { - List operators = new ArrayList<>(); - if (list != null && list.size() > 0) { - for (Map map : list) { - //避免暴露内网地址 - map.remove("requesturl"); - - Object operator = map.get("operator"); - if (operator != null && StringUtils.isNotBlank(operator.toString())) { - operators.add(ElogSeviceUtils.getLongValue(operator.toString())); - } - } - } - List cacheList = comInfoCache.getCacheList(HrmEmployeeComInfo.class, operators); - Map infoHashMap = new HashMap<>(); - if (cacheList != null && cacheList.size() > 0) { - for (HrmEmployeeComInfo hrmEmployeeComInfo : cacheList) { - HrmAvatarComInfo hrmAvatarComInfo = (HrmAvatarComInfo) comInfoCache.getCacheById(HrmAvatarComInfo.class, hrmEmployeeComInfo.getAvatar()); - ElogHrmSimpleEmployeeInfo info = new ElogHrmSimpleEmployeeInfo(); - if (hrmAvatarComInfo != null) { - info.setAvatarP3Id(hrmAvatarComInfo.getP3()); - } - info.setId(hrmEmployeeComInfo.getId()); - info.setUserName(hrmEmployeeComInfo.getUsername()); - infoHashMap.put(hrmEmployeeComInfo.getId(), info); - } - } - if (list != null && list.size() > 0) { - for (Map map : list) { - Object operator = map.get("operator"); - if (map.get("params") != null && map.get("params").toString().startsWith("H4s")) { - map.put("params", ElogSeviceUtils.uncompress(map.get("params").toString())); - } - map.put("dboperatorname", Util.null2String(map.get("operatorname"))); - if (operator != null && StringUtils.isNotBlank(operator.toString())) { - Map i18nOperatorMap = new HashMap<>(); - ElogHrmSimpleEmployeeInfo hrmEmployeeComInfo = infoHashMap.get(Long.parseLong(operator.toString())); - if (hrmEmployeeComInfo != null) { - //获取最新的人员名称并进行多语言转换 - i18nOperatorMap.put(Long.parseLong(operator.toString()),hrmEmployeeComInfo.getUserName()); - Map parseI18nOperator = HrmI18nUtil.batchCovertEmployee(i18nOperatorMap, map.get("tenant_key").toString()); - map.put("operatorname", parseI18nOperator.get(Long.parseLong(operator.toString()))); - -// if (StringUtils.isNotEmpty(hrmEmployeeComInfo.getUserName())) { -// map.put("operatorname", hrmEmployeeComInfo.getUserName()); -// } - if (hrmEmployeeComInfo.getAvatarP3Id() != null) { - map.put("avatar", hrmEmployeeComInfo.getAvatarP3Id()); - } - } - } - } - } - } - - private void transSwitchDataInfo(List list, List recordColumns) { - List operators = new ArrayList<>(); - if (list != null && list.size() > 0) { - for (Map map : list) { - //避免暴露内网地址 - map.remove("requesturl"); - - map.put("dboperatorname", Util.null2String(map.get("operatorname"))); - ElogSeviceSwitchUtils.switchDatabaseField(map); - Object operator = map.get("operator"); - if (operator != null && StringUtils.isNotBlank(operator.toString())) { - operators.add(ElogSeviceUtils.getLongValue(operator.toString())); - } - if (map.get("PARAMS") != null) { - map.put("params", JSONObject.toJSON(map.get("PARAMS"))); - } else if (map.get("params") != null) { - map.put("params", JSONObject.toJSON(map.get("params"))); - } - for (String recordColumn : recordColumns) { - Object val = map.get(recordColumn); - if (val != null) { - map.put(recordColumn, ElogSeviceSwitchUtils.transfi18Method(val.toString())); - } - } - Object modulename = map.get("modulename"); - if (modulename != null) { - map.put("modulenamespan", ElogSeviceSwitchUtils.getModuleName(modulename.toString())); - } - - } - } - List cacheList = comInfoCache.getCacheList(HrmEmployeeComInfo.class, operators); - Map infoHashMap = new HashMap<>(); - if (cacheList != null && cacheList.size() > 0) { - for (HrmEmployeeComInfo hrmEmployeeComInfo : cacheList) { - ElogHrmSimpleEmployeeInfo info = new ElogHrmSimpleEmployeeInfo(); - info.setId(hrmEmployeeComInfo.getId()); - info.setUserName(hrmEmployeeComInfo.getUsername()); - infoHashMap.put(hrmEmployeeComInfo.getId(), info); - } - } - if (list != null && list.size() > 0) { - for (Map map : list) { - Object operator = map.get("operator"); - if (map.get("params") != null && map.get("params").toString().startsWith("H4s")) { - map.put("params", ElogSeviceUtils.uncompress(map.get("params").toString())); - map.put("params",SecurityUtil.encodeForHtml(map.get("params").toString(), true)); - - } - //获取最新的人员名称并进行多语言转换 - if (operator != null && StringUtils.isNotBlank(operator.toString())) { - Map i18nOperatorMap = new HashMap<>(); - ElogHrmSimpleEmployeeInfo hrmEmployeeComInfo = infoHashMap.get(Long.parseLong(operator.toString())); - if (hrmEmployeeComInfo != null && StringUtils.isNotEmpty(hrmEmployeeComInfo.getUserName())) { - i18nOperatorMap.put(Long.parseLong(operator.toString()),hrmEmployeeComInfo.getUserName()); - Map parseI18nOperator = HrmI18nUtil.batchCovertEmployee(i18nOperatorMap, map.get("tenant_key").toString()); - map.put("operatorname", parseI18nOperator.get(Long.parseLong(operator.toString()))); -// map.put("operatorname", hrmEmployeeComInfo.getUserName()); - } - } - } - } - } - - /** - * 查询头像相关信息 - * - * @param id - * @return - */ -// private String queryAvatarInfo(long id) { -// Map avatarInfoMap = queryAvatarInfoMapper.queryAvatarInfo(id); -// if (avatarInfoMap != null) { -// if (avatarInfoMap.get("p3") != null) { -// return avatarInfoMap.get("p3").toString(); +// List operators = new ArrayList<>(); +// if (list != null && list.size() > 0) { +// for (Map map : list) { +// //避免暴露内网地址 +// map.remove("requesturl"); +// +// Object operator = map.get("operator"); +// if (operator != null && StringUtils.isNotBlank(operator.toString())) { +// operators.add(ElogSeviceUtils.getLongValue(operator.toString())); +// } // } // } -// return ""; -// } +// List cacheList = comInfoCache.getCacheList(HrmEmployeeComInfo.class, operators); +// Map infoHashMap = new HashMap<>(); +// if (cacheList != null && cacheList.size() > 0) { +// for (HrmEmployeeComInfo hrmEmployeeComInfo : cacheList) { +// HrmAvatarComInfo hrmAvatarComInfo = (HrmAvatarComInfo) comInfoCache.getCacheById(HrmAvatarComInfo.class, hrmEmployeeComInfo.getAvatar()); +// ElogHrmSimpleEmployeeInfo info = new ElogHrmSimpleEmployeeInfo(); +// if (hrmAvatarComInfo != null) { +// info.setAvatarP3Id(hrmAvatarComInfo.getP3()); +// } +// info.setId(hrmEmployeeComInfo.getId()); +// info.setUserName(hrmEmployeeComInfo.getUsername()); +// infoHashMap.put(hrmEmployeeComInfo.getId(), info); +// } +// } +// if (list != null && list.size() > 0) { +// for (Map map : list) { +// Object operator = map.get("operator"); +// if (map.get("params") != null && map.get("params").toString().startsWith("H4s")) { +// map.put("params", ElogSeviceUtils.uncompress(map.get("params").toString())); +// } +// map.put("dboperatorname", Util.null2String(map.get("operatorname"))); +// if (operator != null && StringUtils.isNotBlank(operator.toString())) { +// Map i18nOperatorMap = new HashMap<>(); +// ElogHrmSimpleEmployeeInfo hrmEmployeeComInfo = infoHashMap.get(Long.parseLong(operator.toString())); +// if (hrmEmployeeComInfo != null) { +// //获取最新的人员名称并进行多语言转换 +// i18nOperatorMap.put(Long.parseLong(operator.toString()), hrmEmployeeComInfo.getUserName()); +// Map parseI18nOperator = HrmI18nUtil.batchCovertEmployee(i18nOperatorMap, map.get("tenant_key").toString()); +// map.put("operatorname", parseI18nOperator.get(Long.parseLong(operator.toString()))); +// +//// if (StringUtils.isNotEmpty(hrmEmployeeComInfo.getUserName())) { +//// map.put("operatorname", hrmEmployeeComInfo.getUserName()); +//// } +// if (hrmEmployeeComInfo.getAvatarP3Id() != null) { +// map.put("avatar", hrmEmployeeComInfo.getAvatarP3Id()); +// } +// } +// } +// } +// } + } /** * 获取宽度 @@ -686,36 +373,36 @@ public class LoggerTableService implements ILoggerTableService { } private String getTenantKey() { - User currentUser = UserContext.getCurrentUser(); - if (currentUser != null) { - return currentUser.getTenantKey(); - } else { - String tenantKey = TenantRpcContext.getTenantKey(); - if (StringUtils.isNotBlank(tenantKey)) { - return tenantKey; - } - } - return ""; +// User currentUser = UserContext.getCurrentUser(); +// if (currentUser != null) { +// return currentUser.getTenantKey(); +// } else { +// String tenantKey = TenantRpcContext.getTenantKey(); +// if (StringUtils.isNotBlank(tenantKey)) { +// return tenantKey; +// } +// } + return SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY; } - private String getEmployeeId() { - - User currentUser = UserContext.getCurrentUser(); - if (currentUser != null&&!currentUser.isAdmin()) { - String employeeId = TenantRpcContext.getEmployeeId(); - return StringUtils.isNotBlank(employeeId) ? employeeId : ""; - } - return ""; - } - - private String getUserId(){ - User currentUser = UserContext.getCurrentUser(); - if (currentUser != null) { - return currentUser.getEmployeeId().toString(); - } - String employeeId = TenantRpcContext.getEmployeeId(); - return StringUtils.isNotBlank(employeeId) ? employeeId : ""; - } +// private String getEmployeeId() { +// +// User currentUser = UserContext.getCurrentUser(); +// if (currentUser != null && !currentUser.isAdmin()) { +// String employeeId = TenantRpcContext.getEmployeeId(); +// return StringUtils.isNotBlank(employeeId) ? employeeId : ""; +// } +// return ""; +// } +// +// private String getUserId() { +// User currentUser = UserContext.getCurrentUser(); +// if (currentUser != null) { +// return currentUser.getEmployeeId().toString(); +// } +// String employeeId = TenantRpcContext.getEmployeeId(); +// return StringUtils.isNotBlank(employeeId) ? employeeId : ""; +// } /** * 拼接搜索条件 @@ -733,31 +420,31 @@ public class LoggerTableService implements ILoggerTableService { while (iterators.hasNext()) { Map.Entry next = iterators.next(); String key = next.getKey(); - SecurityUtil.sqlCheck(key); +// SecurityUtil.sqlCheck(key); if ("date".equals(key) || "createdate".equals(key)) { Object date = next.getValue(); if (date != null) { if (StringUtils.isNotBlank(date.toString())) { List dates = (List) date; - 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()); - if (StringUtils.isNotBlank(startDate.toString()) && StringUtils.isNotBlank(endDate.toString())) { - startDate = startDate.toString().replaceAll("'", "''"); - endDate = endDate.toString().replaceAll("'", "''"); - String dateRangeAfter = dateRangeTransformer.getDateRangeAfter(startDate.toString()); - String dateRangeBefore = dateRangeTransformer.getDateRangeBefore(endDate.toString()); - sb.append(" and log_date ").append(" between ").append(getSwithDatabaseDate(dateRangeAfter)).append(" and ").append(getSwithDatabaseDate(dateRangeBefore)).append(" "); - } else if (StringUtils.isNotBlank(startDate.toString())) { - String dateRangeAfter = dateRangeTransformer.getDateRangeAfter(startDate.toString()); - sb.append(" and log_date ").append(" >= ").append(getSwithDatabaseDate(dateRangeAfter)).append(" "); - } else if (StringUtils.isNotBlank(endDate.toString())) { - String dateRangeBefore = dateRangeTransformer.getDateRangeBefore(endDate.toString()); - sb.append(" and log_date ").append(" <= ").append(getSwithDatabaseDate(dateRangeBefore)).append(" "); - } - } +// 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()); +// if (StringUtils.isNotBlank(startDate.toString()) && StringUtils.isNotBlank(endDate.toString())) { +// startDate = startDate.toString().replaceAll("'", "''"); +// endDate = endDate.toString().replaceAll("'", "''"); +// String dateRangeAfter = dateRangeTransformer.getDateRangeAfter(startDate.toString()); +// String dateRangeBefore = dateRangeTransformer.getDateRangeBefore(endDate.toString()); +// sb.append(" and log_date ").append(" between ").append(getSwithDatabaseDate(dateRangeAfter)).append(" and ").append(getSwithDatabaseDate(dateRangeBefore)).append(" "); +// } else if (StringUtils.isNotBlank(startDate.toString())) { +// String dateRangeAfter = dateRangeTransformer.getDateRangeAfter(startDate.toString()); +// sb.append(" and log_date ").append(" >= ").append(getSwithDatabaseDate(dateRangeAfter)).append(" "); +// } else if (StringUtils.isNotBlank(endDate.toString())) { +// String dateRangeBefore = dateRangeTransformer.getDateRangeBefore(endDate.toString()); +// sb.append(" and log_date ").append(" <= ").append(getSwithDatabaseDate(dateRangeBefore)).append(" "); +// } +// } } } } else if ("operator".equals(next.getKey())) { @@ -766,22 +453,24 @@ public class LoggerTableService implements ILoggerTableService { if (StringUtils.isNotBlank(operator.toString())) { operator = ElogSeviceUtils.checkValSql(operator.toString()); operator = operator.toString().replaceAll("'", "''"); - if (StringUtils.isNumeric(operator.toString()) && operator.toString().length() > 15 ) { + if (StringUtils.isNumeric(operator.toString()) && operator.toString().length() > 15) { sb.append(" and log_operator = ").append(operator.toString()).append(" "); - } else { - List likeNameHrmEmployeeList = hrmCommonEmployeeService.queryEmpsByCondidtion( - new HrmOrgEmpCondition().setNameLikeList(Arrays.asList(operator.toString())).setTenantKey(getTenantKey()), - HrmConditionResultType.BEAN.name()); - if (likeNameHrmEmployeeList != null && likeNameHrmEmployeeList.size() > 0) { - List ids = likeNameHrmEmployeeList.stream().map(HrmEmployee::getId).collect(Collectors.toList()); - if (ids != null && ids.size() > 0) { - sb.append(" and ( operatorname like '%").append(operator.toString()).append("%' ") - .append(" or log_operator in (").append(StringUtils.join(ids, ",")).append(")) "); - } - } else { - sb.append(" and operatorname like '%").append(operator.toString()).append("%' "); - } } + +// else { +// List likeNameHrmEmployeeList = hrmCommonEmployeeService.queryEmpsByCondidtion( +// new HrmOrgEmpCondition().setNameLikeList(Arrays.asList(operator.toString())).setTenantKey(getTenantKey()), +// HrmConditionResultType.BEAN.name()); +// if (likeNameHrmEmployeeList != null && likeNameHrmEmployeeList.size() > 0) { +// List ids = likeNameHrmEmployeeList.stream().map(HrmEmployee::getId).collect(Collectors.toList()); +// if (ids != null && ids.size() > 0) { +// sb.append(" and ( operatorname like '%").append(operator.toString()).append("%' ") +// .append(" or log_operator in (").append(StringUtils.join(ids, ",")).append(")) "); +// } +// } else { +// sb.append(" and operatorname like '%").append(operator.toString()).append("%' "); +// } +// } } } } else if ("modulename".equals(next.getKey())) { @@ -823,7 +512,7 @@ public class LoggerTableService implements ILoggerTableService { } } } - } else if (databaseId.equalsIgnoreCase(ElogConsts.POSTGRESQL) && "targetid".equalsIgnoreCase(next.getKey())){ + } else if (databaseId.equalsIgnoreCase(ElogConsts.POSTGRESQL) && "targetid".equalsIgnoreCase(next.getKey())) { //兼容PG环境int类型不支持模糊搜索的问题 String value = next.getValue().toString().replaceAll("'", "''"); value = ElogSeviceUtils.checkValSql(value.toString()); @@ -838,33 +527,32 @@ public class LoggerTableService implements ILoggerTableService { String value = next.getValue().toString().replaceAll("'", "''"); value = ElogSeviceUtils.checkValSql(value.toString()); StringBuilder stringBuffer = new StringBuilder(); - if (isLikeSearch(showColumns, key)) { - String logSearchSql = I18nUtil.getLogSearchSql(ElogSeviceUtils.getTableName(module, function), key, value); - String sql = logSearchSql.replaceAll("%_", "%\\\\_"); - try { - logger.error("执行多语言sql:{}",sql); - List maps = queryCommonTabeMapper.queryLabelIds(sql); - if (maps != null && maps.size() > 0) { - for (Map map1 : maps) { - Object indexid = map1.get(key); - if (indexid == null || StringUtils.isEmpty(indexid.toString())) { - indexid = map1.get(key.toLowerCase()); - } - if (indexid != null && StringUtils.isNotEmpty(indexid.toString())) { - String val = indexid.toString().replace("'", "''"); - if (ElogSeviceUtils.checkIsNumber(map.get(key))) { - val = "-"+val; - value = "-"+value; - } - stringBuffer.append("'").append(val).append("',"); - } - } - } - } catch (Exception e) { - logger.error("i18查询sql报错:{}",e.getMessage(),e); - } - - } +// if (isLikeSearch(showColumns, key)) { +// String logSearchSql = I18nUtil.getLogSearchSql(ElogSeviceUtils.getTableName(module, function), key, value); +// String sql = logSearchSql.replaceAll("%_", "%\\\\_"); +// try { +// List maps = queryCommonTabeMapper.queryLabelIds(sql); +// if (maps != null && maps.size() > 0) { +// for (Map map1 : maps) { +// Object indexid = map1.get(key); +// if (indexid == null || StringUtils.isEmpty(indexid.toString())) { +// indexid = map1.get(key.toLowerCase()); +// } +// if (indexid != null && StringUtils.isNotEmpty(indexid.toString())) { +// String val = indexid.toString().replace("'", "''"); +// if (ElogSeviceUtils.checkIsNumber(map.get(key))) { +// val = "-" + val; +// value = "-" + value; +// } +// stringBuffer.append("'").append(val).append("',"); +// } +// } +// } +// } catch (Exception e) { +// logger.error("i18查询sql报错:{}", e.getMessage(), e); +// } +// +// } String str = ""; if (stringBuffer.toString().length() > 0) { str = stringBuffer.substring(0, stringBuffer.length() - 1); @@ -900,38 +588,38 @@ public class LoggerTableService implements ILoggerTableService { return sb.toString(); } - /** - * 是否模糊搜索 - * @param showColumns - * @param key - * @return - */ - private boolean isLikeSearch(List showColumns, String key) { - for (ShowColumsDto showColumn : showColumns) { - if (key.equalsIgnoreCase(showColumn.getColumIndex()) && showColumn.isTransfLanguage()) { - return true; - } - } - return false; - } +// /** +// * 是否模糊搜索 +// * +// * @param showColumns +// * @param key +// * @return +// */ +// private boolean isLikeSearch(List showColumns, String key) { +// for (ShowColumsDto showColumn : showColumns) { +// if (key.equalsIgnoreCase(showColumn.getColumIndex()) && showColumn.isTransfLanguage()) { +// return true; +// } +// } +// return false; +// } - private String getSwithDatabaseDate(String date) { - SecurityUtil.ecodeForSql(date); - if (ElogConsts.ORACLE.equals(DatabaseUtil.getDatabaseId())) { - return " to_date('"+date+"','yyyy-mm-dd hh24:mi:ss') "; - } else if (ElogConsts.POSTGRESQL.equals(DatabaseUtil.getDatabaseId())) { - return " to_timestamp('"+date+"', 'YYYY-MM-DD HH24:MI:SS') "; - } else if (ElogConsts.SQLSERVER.equals(DatabaseUtil.getDatabaseId())) { - return " convert(nvarchar(19),'"+date+"',120) "; - } else { - return " DATE_FORMAT('"+date+"','%Y-%m-%d %H:%i:%s') "; - } - } +// private String getSwithDatabaseDate(String date) { +// if (ElogConsts.ORACLE.equals(DatabaseUtil.getDatabaseId())) { +// return " to_date('" + date + "','yyyy-mm-dd hh24:mi:ss') "; +// } else if (ElogConsts.POSTGRESQL.equals(DatabaseUtil.getDatabaseId())) { +// return " to_timestamp('" + date + "', 'YYYY-MM-DD HH24:MI:SS') "; +// } else if (ElogConsts.SQLSERVER.equals(DatabaseUtil.getDatabaseId())) { +// return " convert(nvarchar(19),'" + date + "',120) "; +// } else { +// return " DATE_FORMAT('" + date + "','%Y-%m-%d %H:%i:%s') "; +// } +// } public String matchOperatetype(String str) { - if (ElogSeviceUtils.currentLanguage() != 8) { - return ""; - } +// if (ElogSeviceUtils.currentLanguage() != 8) { +// return ""; +// } List list = new ArrayList(); list.add(OperateType.add); list.add(OperateType.update); @@ -989,11 +677,6 @@ public class LoggerTableService implements ILoggerTableService { */ private String getsql(FilterConditionDto filterConditionDto) { StringBuffer sb = new StringBuffer(); - /* if (StringUtils.isNotBlank(filterConditionDto.getSql())) { - sb.append(" ").append(filterConditionDto.getSql()).append(" "); - return sb.toString(); - }*/ - SecurityUtil.sqlCheck(filterConditionDto.getColumIndex()); filterConditionDto.setConnectCondition(ElogSeviceUtils.checkConditionSql(filterConditionDto.getConnectCondition())); filterConditionDto.setType(ElogSeviceUtils.checkTypeSql(filterConditionDto.getType())); filterConditionDto.setValue(ElogSeviceUtils.checkValSql(filterConditionDto.getValue())); @@ -1176,6 +859,7 @@ public class LoggerTableService implements ILoggerTableService { /** * 明细分页查询 + * * @param module * @param function * @param mainid @@ -1189,45 +873,35 @@ public class LoggerTableService implements ILoggerTableService { Integer pageNum = Util.getIntValue(current, 1); Integer size = Util.getIntValue(pageSize, 10); - Page page = new Page(pageNum,size); + Page page = new Page(pageNum, size); List> list = getDetailChangesMethod(module, function, mainid, null, page); //查询分页总数 String tableName = ElogSeviceUtils.getTableName(module, function, true); - Integer total = localElogDaoMapper.queryAllChangesPageCounts(tableName, mainid); - page.setTotal(total); - WeaTable weaTable =new WeaTable(); + Integer total = getLocalElogDaoMapper().queryAllChangesPageCounts(tableName, mainid); + WeaTable weaTable = new WeaTable(); weaTable.setColumns(getDetailColumns(list)); - weaTable.setPage(page); - weaTable.setData(list); - if (Util.isNotEmpty(detailTransMethod)) { - // 消费到消息,通过MethodHandler调用对应的方法 - MethodHandler methodHandler = ElogMethodHandler.loadMethodHandler(detailTransMethod); - if (methodHandler != null) { - try { - methodHandler.execute(weaTable); - } catch (Exception e) { - logger.error("转换出错:" + e); - } - } - } + + PageInfo pageInfo = SalaryPageUtil.buildPage(pageNum, size, list); + pageInfo.setTotal(total); + return weaTable; } private List getDetailColumns(List> list) { List columns = new ArrayList<>(); - if (Util.isNotEmpty(list)) { - List detailcontexts= (List) list.get(0).get("detailcontexts"); - if (Util.isNotEmpty(detailcontexts)) { + if (CollectionUtils.isNotEmpty(list)) { + List detailcontexts = (List) list.get(0).get("detailcontexts"); + if (CollectionUtils.isNotEmpty(detailcontexts)) { for (Map map : detailcontexts) { WeaTableColumn weaTableColumn = new WeaTableColumn(); // 列表属性名 - weaTableColumn.setDataIndex((String) map.get("fieldname")); + weaTableColumn.setColumn((String) map.get("fieldname")); //显示名称 多语言转换 fieldnamelabelid - weaTableColumn.setTitle((String) map.get("fieldname")); + weaTableColumn.setText((String) map.get("fieldname")); columns.add(weaTableColumn); } } @@ -1235,69 +909,24 @@ public class LoggerTableService implements ILoggerTableService { return columns; } - public List> getDetailChangesMethod(String module, String function, String mainid, String detailTransMethod,Page page) { + public List> 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); - List maps = localElogDaoMapper.queryAllMainData(maintableName, mainid); - - for (Map map : maps) { - - if (map.get("params") != null && ElogConsts.ES.equalsIgnoreCase(map.get("params").toString())) { - - String logDate = map.get("log_date").toString(); - logger.info("logDate:{}" ,logDate); - String esDate = logDate.substring(0, 10); - //先判断表存不存在,不存在创建 - if (checkEsTableIsExist(esDate)) { - // 根据id通过es查询大字段(params)然后赋值 - SearchRequest searchRequest = new SearchRequest(getElogESTableName(true,esDate)); - - SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); - // 只获取指定字段 - String[] fields = {"params"}; - searchSourceBuilder.fetchSource(fields, null); - // 根据id匹配 - searchSourceBuilder.query(QueryBuilders.termQuery("id",map.get("id").toString())); - searchRequest.source(searchSourceBuilder); - - SearchResponse searchResponse = null; - try { - searchResponse = restHighLevelClient.search(searchRequest, RequestOptions.DEFAULT); - } catch (IOException e) { - logger.info("查询ES出现异常:{}",e.getMessage()); - } - - SearchHits hits = searchResponse.getHits(); - SearchHit[] searchHits = hits.getHits(); - if (searchHits != null && searchHits.length > 0) { - // 根据id匹配唯一,所以直接取第一个 - Map sourceAsMap = searchHits[0].getSourceAsMap(); - if (Objects.nonNull(sourceAsMap) && Objects.nonNull(sourceAsMap.get("params")) && StringUtils.isNotEmpty(sourceAsMap.get("params").toString())) { - logger.info("ES查出来的params:{}",sourceAsMap.get("params")); - map.put("params",sourceAsMap.get("params")); - } - } - } - } - if (map.get("params") != null && map.get("params").toString().startsWith("H4s")) { - map.put("params", ElogSeviceUtils.uncompress(map.get("params").toString())); - map.put("params",SecurityUtil.encodeForHtml(map.get("params").toString(), true)); - } - } + List maps = getLocalElogDaoMapper().queryAllMainData(maintableName, mainid); maps = ElogSeviceSwitchUtils.getSwitchDatabaseData(maps); ElogSeviceSwitchUtils.changKey2Lower(maps); List allChangesData = new ArrayList<>(); //如果有分页数据则走分页方法 - if (Objects.nonNull(page) ) { + if (Objects.nonNull(page)) { // Integer offset = (pageNum - 1) * size; //分页查询明细数据 - allChangesData = localElogDaoMapper.queryAllChangesDataPages(tableName, mainid, page); + allChangesData = getLocalElogDaoMapper().queryAllChangesDataPages(tableName, mainid, page); } else { //没有被则不分页 - allChangesData = localElogDaoMapper.queryAllChangesData(tableName, mainid); + allChangesData = getLocalElogDaoMapper().queryAllChangesData(tableName, mainid); } ElogSeviceSwitchUtils.changKey2Lower(allChangesData); allChangesData = ElogSeviceSwitchUtils.getSwitchDatabaseData(allChangesData); @@ -1315,8 +944,8 @@ public class LoggerTableService implements ILoggerTableService { } } } -// List mainlist = localElogDaoMapper.queryAllMainChanges(tableName, mainid); -// List detaillist = localElogDaoMapper.queryAllDetailChanges(tableName, mainid); +// List mainlist = getLocalElogDaoMapper().queryAllMainChanges(tableName, mainid); +// List detaillist = getLocalElogDaoMapper().queryAllDetailChanges(tableName, mainid); //List moduleInfo = queryCommonTabeMapper.queryModuleNameInfo(module); List moduleInfo = new ArrayList<>(); processDetailInfo(mainlist, detaillist, moduleInfo); @@ -1325,34 +954,23 @@ public class LoggerTableService implements ILoggerTableService { map.putAll(detailMap); if (maps != null && maps.size() > 0) { Map maininfoMap = maps.get(0); - String operatetypename = (String)maininfoMap.get("operatetypename"); - String targetname = (String)maininfoMap.get("targetname"); + String operatetypename = (String) maininfoMap.get("operatetypename"); + String targetname = (String) maininfoMap.get("targetname"); //长度大于1避免部分模块为1,2,3这类的操作类型 if (StringUtils.isNumeric(operatetypename) && operatetypename.length() > 1 && operatetypename.length() < 10) { String transfOperatetypename = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(operatetypename), operatetypename); - maininfoMap.put("operatetypename",transfOperatetypename); + maininfoMap.put("operatetypename", transfOperatetypename); } if (StringUtils.isNumeric(targetname) && targetname.length() > 1 && targetname.length() < 10) { String transfTargetname = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(targetname), targetname); - maininfoMap.put("targetname",transfTargetname); + maininfoMap.put("targetname", transfTargetname); } - map.put("maininfo",maininfoMap); + map.put("maininfo", maininfoMap); map.put("detailtitle", ""); } list.add(map); - if (Util.isNotEmpty(detailTransMethod)) { - // 消费到消息,通过MethodHandler调用对应的方法 - MethodHandler methodHandler = ElogMethodHandler.loadMethodHandler(detailTransMethod); - if (methodHandler != null) { - try { - methodHandler.execute(list); - } catch (Exception e) { - logger.error("转换出错:" + e); - } - } - } //List transfLanguageData = ElogSeviceSwitchUtils.transfLanguageData(list); return list; @@ -1445,19 +1063,19 @@ public class LoggerTableService implements ILoggerTableService { } @Override - public List queryLogList(String module, String function, String current, String pageSize, String condition) { + public List queryLogList(ELogGetLogParam param) { LoggerContext context = new LoggerContext(); - context.setModuleName(module); - context.setFunctionName(function); - int pagenum = Util.getIntValue(current, 1) - 1; - int size = Util.getIntValue(pageSize, 10); + context.setModuleName(param.getModule()); + context.setFunctionName(param.getFunction()); + int pagenum = Util.getIntValue(param.getCurrent(), 1) - 1; + int size = Util.getIntValue(param.getPageSize(), 10); int start = pagenum * size; int end = start + size; Page page = new Page(pagenum, size); String limit = " limit " + start + "," + (end - start); - String tableName = ElogSeviceUtils.getTableName(module, function); - List list = localElogDaoMapper.queryElogList(page, context, null, tableName, null,"*"); + String tableName = ElogSeviceUtils.getTableName(param.getModule(), param.getFunction()); + List list = getLocalElogDaoMapper().queryElogList(page, context, null, tableName, null, "*"); list = ElogSeviceSwitchUtils.getSwitchDatabaseData(list); return switchString(list); } @@ -1502,60 +1120,21 @@ public class LoggerTableService implements ILoggerTableService { String sb = getQueryCondition(filterConditionDtos); logger.info("elog查询条件拼接sql:{}", sb); // 消费到消息,通过MethodHandler调用对应的方法 - //String targetid = getTargetid(filterConditionDtos); - Map customAuthMap = getCustomAuthSql(transMethod, jsonObject, "auth"); - if (!customAuthMap.isEmpty()) { - Object flag = customAuthMap.get("flag"); - if (flag != null && flag instanceof Boolean) { - boolean f = (boolean) flag; - if (!f) { - List list = new ArrayList<>(); - list.add(customAuthMap); - return list; - } - } - } String customSql = getCustomSql(transMethod, sb, "before"); Page pages = new Page(ElogSeviceUtils.getIntValue(pageNum, 1), ElogSeviceUtils.getIntValue(pageSize, 10)); - int page = Util.getIntValue(pages.getCurrent() + "", 1) - 1; - int size = Util.getIntValue(pages.getSize() + "", 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); - long l = System.currentTimeMillis(); - Map hashMap = addPermissionHandler(transMethod); - String permissionId = ""; - String permissionType = ""; - String mainDataTableAlias = ""; - String mainDataTable = ""; - String primaryKey = ""; - String permissionTargetId = ""; - String permissionConfigSourceId = ""; - - permissionId = getPermissionStr(hashMap, "permissionId"); - permissionType = getPermissionStr(hashMap, "permissionType"); - mainDataTableAlias = getPermissionStr(hashMap, "mainDataTableAlias"); - mainDataTable = getPermissionStr(hashMap, "mainDataTable"); - primaryKey = getPermissionStr(hashMap, "primaryKey"); - permissionTargetId = getPermissionStr(hashMap, "permissionTargetId"); - permissionConfigSourceId = getPermissionStr(hashMap, "permissionConfigSourceId"); //String columns = getshowColumsStr(showColums); List list = new ArrayList<>(); Map countMap = new HashMap<>(); - if (StringUtils.isNotEmpty(permissionId) || StringUtils.isNotEmpty(permissionType) || StringUtils.isNotEmpty(mainDataTableAlias) || StringUtils.isNotEmpty(mainDataTable) || StringUtils.isNotEmpty(permissionTargetId) || StringUtils.isNotEmpty(permissionConfigSourceId)) { - list = localElogDaoMapper.queryElogList(pages, context, null, tableName, customSql, mainDataTable, permissionId, permissionType, mainDataTableAlias, primaryKey,permissionTargetId,permissionConfigSourceId,"*"); - countMap = localElogDaoMapper.elogCountByMorePermission(context, tableName, customSql, mainDataTable, permissionId, permissionType, mainDataTableAlias, primaryKey, permissionTargetId,permissionConfigSourceId); - } else { - list = localElogDaoMapper.queryElogList(pages, context, null, tableName, customSql,"*"); - long l1 = System.currentTimeMillis(); - logger.info("elog查询列表耗时:{}", (l1 - l)); - countMap = localElogDaoMapper.elogCount(context, tableName, customSql); - long l2 = System.currentTimeMillis(); - logger.info("elog查询总数耗时:{}", (l2 - l1)); - } + list = getLocalElogDaoMapper().queryElogList(pages, context, null, tableName, customSql, "*"); + countMap = getLocalElogDaoMapper().elogCount(context, tableName, customSql); list = ElogSeviceSwitchUtils.getSwitchDatabaseData(list); if (list != null && list.size() > 0) { @@ -1564,25 +1143,9 @@ public class LoggerTableService implements ILoggerTableService { //} } transUserInfo(list); - long l3 = System.currentTimeMillis(); //System.out.println("elog查询名称和头像耗时:{}"+ (l3-l2)); transfLanguageData(list, showColums); - if (Util.isNotEmpty(transMethod)) { - // 消费到消息,通过MethodHandler调用对应的方法 - MethodHandler methodHandler = ElogMethodHandler.loadMethodHandler(transMethod); - if (methodHandler != null) { - try { - methodHandler.execute(list); - } catch (Exception e) { - logger.error("转换出错:" + e); - } - } - - } - long l4 = System.currentTimeMillis(); - logger.info("elog查询转换耗时:{}", (l4 - l3)); List res = switchString(list); - logger.info("elog查询总耗时:{}", (l4 - l)); return res; } @@ -1610,18 +1173,18 @@ public class LoggerTableService 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(), SystemEnv.getHtmlLabelName(63252, "新增")); + map.put(entry.getKey(), SalaryI18nUtil.getI18nLabel(1111111, "新增")); } else if ("read".equals(entry.getValue().toString()) || "view".equals(entry.getValue().toString()) || "查看".equals(entry.getValue().toString())) { - map.put(entry.getKey(), SystemEnv.getHtmlLabelName(55172, "查看")); + map.put(entry.getKey(), SalaryI18nUtil.getI18nLabel(1111111, "查看")); } else if ("edit".equals(entry.getValue().toString()) || "update".equals(entry.getValue().toString()) || "更新".equals(entry.getValue().toString())) { - map.put(entry.getKey(), SystemEnv.getHtmlLabelName(63253, "修改")); - } else if ("delete".equals(entry.getValue().toString()) || "删除".equals(entry.getValue().toString()) ) { - map.put(entry.getKey(), SystemEnv.getHtmlLabelName(63254, "删除")); + map.put(entry.getKey(), SalaryI18nUtil.getI18nLabel(1111111, "修改")); + } else if ("delete".equals(entry.getValue().toString()) || "删除".equals(entry.getValue().toString())) { + map.put(entry.getKey(), SalaryI18nUtil.getI18nLabel(63254, "删除")); } else if (entry.getValue().toString().contains("取消关联标签 ")) { - String val = entry.getValue().toString().replace("取消关联标签 ", SystemEnv.getHtmlLabelName(83237, "取消关联标签 ") + " "); + String val = entry.getValue().toString().replace("取消关联标签 ", SalaryI18nUtil.getI18nLabel(1111111, "取消关联标签 ") + " "); map.put(entry.getKey(), val); } else if (entry.getValue().toString().contains("关联标签 ")) { - String val = entry.getValue().toString().replace("关联标签 ", SystemEnv.getHtmlLabelName(83236, "关联标签 ") + " "); + String val = entry.getValue().toString().replace("关联标签 ", SalaryI18nUtil.getI18nLabel(1111111, "关联标签 ") + " "); map.put(entry.getKey(), val); } } @@ -1641,7 +1204,7 @@ public class LoggerTableService implements ILoggerTableService { context.setFunctionName(function); context.setTenant_key(getTenantKey()); String tableName = ElogSeviceUtils.getTableName(module, function); - return localElogDaoMapper.elogCount(context, tableName, null); + return getLocalElogDaoMapper().elogCount(context, tableName, null); } @Override @@ -1658,7 +1221,7 @@ public class LoggerTableService implements ILoggerTableService { String limit = " limit " + start + "," + (end - start); // 还需要支持下查询 String tableName = ElogSeviceUtils.getTableName(module, function, true); - List list = localElogDaoMapper.queryDetailElogList(context, limit, tableName, null); + List list = getLocalElogDaoMapper().queryDetailElogList(context, limit, tableName, null); list = ElogSeviceSwitchUtils.getSwitchDatabaseData(list); return switchString(list); } @@ -1671,7 +1234,7 @@ public class LoggerTableService implements ILoggerTableService { context.setTenant_key(getTenantKey()); context.setUuid(mainId); String tableName = ElogSeviceUtils.getTableName(module, function, true); - return localElogDaoMapper.elogDetailCount(context, tableName, null); + return getLocalElogDaoMapper().elogDetailCount(context, tableName, null); } @Override @@ -1680,32 +1243,17 @@ public class LoggerTableService implements ILoggerTableService { if (StringUtils.isNotEmpty(traceId)) { String tableName = ElogSeviceUtils.getTableName(module, function); Integer offset = (currentPage - 1) * pageSize; - List list = localElogDaoMapper.queryElogTraceInfo(traceId, tableName, offset, pageSize); + List 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())); } } //list = ElogSeviceSwitchUtils.getSwitchDatabaseData(list); - int count = localElogDaoMapper.queryElogTraceInfoCount(traceId, tableName); - weaTable.setTotal(count); - Page page = new Page(); - page.setTotal(count); - page.setSize(pageSize); - page.setCurrent(currentPage); - weaTable.setPage(page); - if (Util.isNotEmpty(traceTransMethod)) { - // 消费到消息,通过MethodHandler调用对应的方法 - MethodHandler methodHandler = ElogMethodHandler.loadMethodHandler(traceTransMethod); - if (methodHandler != null) { - try { - methodHandler.execute(list); - } catch (Exception e) { - logger.error("转换出错:" + e); - } - } - } - weaTable.setData(list); + int count = getLocalElogDaoMapper().queryElogTraceInfoCount(traceId, tableName); + PageInfo pageInfo = SalaryPageUtil.buildPage(currentPage, pageSize, list); +// pageInfo.setColumns(); + pageInfo.setTotal(count); } return weaTable; @@ -1719,7 +1267,7 @@ public class LoggerTableService implements ILoggerTableService { StringBuffer sql = new StringBuffer(); sql.append(field).append(" = '").append(value).append("' "); - list = localElogDaoMapper.queryLogInfoByCustom(tableName, sql.toString()); + list = getLocalElogDaoMapper().queryLogInfoByCustom(tableName, sql.toString()); } return list; } @@ -1746,153 +1294,88 @@ public class LoggerTableService implements ILoggerTableService { } } - @Override - public BatchDocumentMessage downloadLog(String data) { - JSONObject jsonObject = JSONObject.parseObject(data); - String module = jsonObject.getString("downloadmodule"); - String function = jsonObject.getString("function"); - String serviceName = jsonObject.getString("serviceName"); - String fileName = jsonObject.getString("fileName"); - String passWord = jsonObject.getString("passWord"); - - if (StringUtils.isEmpty(fileName)) { - fileName = SystemEnv.getHtmlLabelName(191432,"日志记录"); - } - - BatchDocumentMessage batchDocumentMessage = new BatchDocumentMessage(); - WeaTable weaTable = queryLogs(data); - List columns = weaTable.getColumns(); - List headers = new ArrayList<>(); - if (columns != null && !columns.isEmpty()) { - for (WeaTableColumn column : columns) { - Map header = new HashMap<>(); - header.put("key", column.getDataIndex()); - header.put("name", column.getTitle()); - headers.add(header); - } - } - List> dataList = weaTable.getData(); - List> maps = new ArrayList<>(); - if (dataList != null && !dataList.isEmpty()) { - dataList.stream().forEach(m -> { - Map map = new HashMap<>(); - headers.stream().forEach(h -> { - map.put(h.get("key").toString(), m.get(h.get("key"))); - }); - maps.add(map); - }); - } - - //必传--业务id - batchDocumentMessage.setBizId(IdGenerator.generate() + ""); - //必传-处理名称 - batchDocumentMessage.setHandlerName("ebatchdemo"); - //必传-服务名称 - batchDocumentMessage.setServiceName(serviceName); - //必传-数据类型 - batchDocumentMessage.setDataType(fileName); - //任务id - batchDocumentMessage.setBatchTaskId(IdGenerator.generate()); - //必传-模块 - batchDocumentMessage.setModule(module); //com.weaver.teams.domain.EntityType 中的module(没有的话需要找温明刚维护下) - //必传-功能 - batchDocumentMessage.setFunction(function); - //必传-eteamsid - batchDocumentMessage.setEteamsId(TenantRpcContext.getEteamsId()); - - //非必传 - if (StringUtils.isNotBlank(passWord)) { - batchDocumentMessage.setPassword(passWord); - } - - //必传 - BatchFile batchFile = new BatchFile(); - batchFile.setName(fileName); - //必传 - batchFile.setFileType(FileType.EXCEL); - //必传 - batchFile.setHandlerFileMethod(HandlerFileMethod.HANDLER_EXCEL_WITH_DATA); - batchFile.setTemplateId(1l); - List excelSheets = new ArrayList<>(); - ExcelSheet excelSheet = new ExcelSheet(); - - excelSheet.setHeader(headers); - excelSheet.setData(maps); - excelSheet.setName(fileName); - excelSheets.add(excelSheet); - batchFile.setExcelSheets(excelSheets); - batchDocumentMessage.setBatchFile(batchFile); - batchDocumentMessage.setChunk(false);//不分片 - batchExportSender.sendBatchExport(batchDocumentMessage); - - return batchDocumentMessage; - } - - public Boolean checkEsTableIsExist(String date) { - try { - String esMainIndex = getElogESTableName(true, date); - //先检查表是否存在 不存在则创建 - boolean existsLog = isExistsIndex(esMainIndex); - return existsLog; - } catch (Exception e) { - logger.info("创建相关ES表失败:{}", e.getMessage(), e); - } - return false; - } - - /** - * 判断一个索引是否存在 - * - * @param indexName - * @return - */ - public boolean isExistsIndex(String indexName) { - GetIndexRequest request = new GetIndexRequest(); - try { - boolean exists = restHighLevelClient.indices().exists(request.indices(indexName), RequestOptions.DEFAULT); - return exists; - } catch (Exception e) { - logger.info("判断索引是否存在出现异常:{}", e.getMessage()); - - } - return false; - } - - /** - * 创建主表语句 - * - * @throws IOException - */ - private void createLogIndex(String esMainIndex) { - // 1.创建Request对象 - CreateIndexRequest request = new CreateIndexRequest(esMainIndex); - // 2.准备请求的参数:DSL语句 - request.source(MAPPING_TEMPLATE, XContentType.JSON); - // 3.发送请求 - try { - restHighLevelClient.indices().create(request, RequestOptions.DEFAULT); - } catch (IOException e) { - logger.info("创建ES主表失败:{}", e.getMessage()); - - } - } - - private String getElogESTableName(boolean flag, String date) { - String currentDate = ""; - if (StringUtils.isEmpty(date)) { - currentDate = DateUtils.getCurrentDate().replaceAll("-", ""); - } else { - currentDate = date.replaceAll("-", ""); - } - return getEsMainIndex(flag, currentDate); - } - - private String getEsMainIndex(boolean flag, String date) { - if (flag) { - return ElogEsTableConsts.ELOG_CENTER_LOGS_ES + date; - } - return ElogEsTableConsts.ELOG_CENTER_LOGSDETAIL_ES + date; - } +// @Override +// public BatchDocumentMessage downloadLog(String data) { +// JSONObject jsonObject = JSONObject.parseObject(data); +// String module = jsonObject.getString("downloadmodule"); +// String function = jsonObject.getString("function"); +// String serviceName = jsonObject.getString("serviceName"); +// String fileName = jsonObject.getString("fileName"); +// String passWord = jsonObject.getString("passWord"); +// +// if (StringUtils.isEmpty(fileName)) { +// fileName = SalaryI18nUtil.getI18nLabel(191432, "日志记录"); +// } +// +// BatchDocumentMessage batchDocumentMessage = new BatchDocumentMessage(); +// WeaTable weaTable = queryLogs(data); +// List columns = weaTable.getColumns(); +// List headers = new ArrayList<>(); +// if (columns != null && !columns.isEmpty()) { +// for (WeaTableColumn column : columns) { +// Map header = new HashMap<>(); +// header.put("key", column.getDataIndex()); +// header.put("name", column.getTitle()); +// headers.add(header); +// } +// } +// List> dataList = weaTable.getData(); +// List> maps = new ArrayList<>(); +// if (dataList != null && !dataList.isEmpty()) { +// dataList.stream().forEach(m -> { +// Map map = new HashMap<>(); +// headers.stream().forEach(h -> { +// map.put(h.get("key").toString(), m.get(h.get("key"))); +// }); +// maps.add(map); +// }); +// } +// +// //必传--业务id +// batchDocumentMessage.setBizId(IdGenerator.generate() + ""); +// //必传-处理名称 +// batchDocumentMessage.setHandlerName("ebatchdemo"); +// //必传-服务名称 +// batchDocumentMessage.setServiceName(serviceName); +// //必传-数据类型 +// batchDocumentMessage.setDataType(fileName); +// //任务id +// batchDocumentMessage.setBatchTaskId(IdGenerator.generate()); +// //必传-模块 +// batchDocumentMessage.setModule(module); //com.weaver.teams.domain.EntityType 中的module(没有的话需要找温明刚维护下) +// //必传-功能 +// batchDocumentMessage.setFunction(function); +// //必传-eteamsid +// batchDocumentMessage.setEteamsId(TenantRpcContext.getEteamsId()); +// +// //非必传 +// if (StringUtils.isNotBlank(passWord)) { +// batchDocumentMessage.setPassword(passWord); +// } +// +// //必传 +// BatchFile batchFile = new BatchFile(); +// batchFile.setName(fileName); +// //必传 +// batchFile.setFileType(FileType.EXCEL); +// //必传 +// batchFile.setHandlerFileMethod(HandlerFileMethod.HANDLER_EXCEL_WITH_DATA); +// batchFile.setTemplateId(1l); +// List excelSheets = new ArrayList<>(); +// ExcelSheet excelSheet = new ExcelSheet(); +// +// excelSheet.setHeader(headers); +// excelSheet.setData(maps); +// excelSheet.setName(fileName); +// excelSheets.add(excelSheet); +// batchFile.setExcelSheets(excelSheets); +// batchDocumentMessage.setBatchFile(batchFile); +// batchDocumentMessage.setChunk(false);//不分片 +// batchExportSender.sendBatchExport(batchDocumentMessage); +// +// return batchDocumentMessage; +// } +// private String[] getESfields(String value) { String[] split = value.split(","); diff --git a/src/com/engine/salary/elog/threadlocal/ElogThreadLocal.java b/src/com/engine/salary/elog/threadlocal/ElogThreadLocal.java index 81eb070f0..63e188956 100644 --- a/src/com/engine/salary/elog/threadlocal/ElogThreadLocal.java +++ b/src/com/engine/salary/elog/threadlocal/ElogThreadLocal.java @@ -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; diff --git a/src/com/engine/salary/elog/util/ElogServiceUtils.java b/src/com/engine/salary/elog/util/ElogServiceUtils.java index 1e7428366..e06225b36 100644 --- a/src/com/engine/salary/elog/util/ElogServiceUtils.java +++ b/src/com/engine/salary/elog/util/ElogServiceUtils.java @@ -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; diff --git a/src/com/engine/salary/elog/util/ElogSeviceSwitchUtils.java b/src/com/engine/salary/elog/util/ElogSeviceSwitchUtils.java index f6d55aece..78a78dc94 100644 --- a/src/com/engine/salary/elog/util/ElogSeviceSwitchUtils.java +++ b/src/com/engine/salary/elog/util/ElogSeviceSwitchUtils.java @@ -1,1338 +1,1345 @@ -//package com.engine.salary.elog.util; -// -//import cn.hutool.core.map.CaseInsensitiveMap; -//import com.alibaba.druid.proxy.jdbc.ClobProxyImpl; -//import com.alibaba.fastjson.JSON; -//import com.alibaba.fastjson.JSONArray; -//import com.alibaba.fastjson.JSONObject; -//import com.weaver.common.component.table.WeaTable; -//import com.weaver.common.component.table.column.WeaTableColumn; -//import com.weaver.common.elog.annotation.OperateType; -//import com.weaver.common.elog.enums.ElogConsts; -//import com.weaver.common.i18n.label.SystemEnv; -//import com.weaver.common.mybatis.util.DatabaseUtil; -//import com.weaver.common.security.util.SecurityUtil; -//import org.apache.commons.lang3.StringUtils; -//import org.slf4j.Logger; -//import org.slf4j.LoggerFactory; -// -//import java.sql.Clob; -//import java.util.*; -//import java.util.regex.Matcher; -//import java.util.regex.Pattern; -// -///** -// * @Date: 2022/5/18 19:34 -// * @Author: deli.xu -// * @Description: elog服务转换类 -// **/ -//public class ElogSeviceSwitchUtils { -// -// private static final Logger logger = LoggerFactory.getLogger(ElogSeviceSwitchUtils.class); -// // TODO 后续需要考虑多语言label写法 -// public static final Map moduleMap = new HashMap<>(); -// -// private static final Map> moduleFuctionMap = new HashMap<>(); -// -// static { -// /*moduleMap.put("elog", SystemEnv.getHtmlLabelName(62975, ElogSeviceUtils.currentLanguage(), "日志")); -// moduleMap.put("report", SystemEnv.getHtmlLabelName(62976, ElogSeviceUtils.currentLanguage(), "报表")); -// moduleMap.put("edc", SystemEnv.getHtmlLabelName(62977, ElogSeviceUtils.currentLanguage(), "数据中心")); -// moduleMap.put("hrm", SystemEnv.getHtmlLabelName(62978, ElogSeviceUtils.currentLanguage(), "人力资源")); -// moduleMap.put("crm", SystemEnv.getHtmlLabelName(62979, ElogSeviceUtils.currentLanguage(), "资产")); -// moduleMap.put("demo", SystemEnv.getHtmlLabelName(62980, ElogSeviceUtils.currentLanguage(), "示例")); -// moduleMap.put("attc", SystemEnv.getHtmlLabelName(62981, ElogSeviceUtils.currentLanguage(), "出勤打卡")); -// moduleMap.put("attm", SystemEnv.getHtmlLabelName(62982, ElogSeviceUtils.currentLanguage(), "出勤机")); -// moduleMap.put("attw", SystemEnv.getHtmlLabelName(62983, ElogSeviceUtils.currentLanguage(), "出勤报表")); -// moduleMap.put("auth", SystemEnv.getHtmlLabelName(62984, ElogSeviceUtils.currentLanguage(), "系统权限")); -// moduleMap.put("bank", SystemEnv.getHtmlLabelName(62985, ElogSeviceUtils.currentLanguage(), "银企直联")); -// moduleMap.put("bap", SystemEnv.getHtmlLabelName(62986, ElogSeviceUtils.currentLanguage(), "云办公")); -// moduleMap.put("base", SystemEnv.getHtmlLabelName(62987, ElogSeviceUtils.currentLanguage(), "应用管理")); -// moduleMap.put("batc", SystemEnv.getHtmlLabelName(62988, ElogSeviceUtils.currentLanguage(), "导入导出")); -// moduleMap.put("blog", SystemEnv.getHtmlLabelName(62989, ElogSeviceUtils.currentLanguage(), "日报微博")); -// moduleMap.put("cld", SystemEnv.getHtmlLabelName(62990, ElogSeviceUtils.currentLanguage(), "日程管理")); -// moduleMap.put("cmca", SystemEnv.getHtmlLabelName(62991, ElogSeviceUtils.currentLanguage(), "资金管理")); -// moduleMap.put("cmcl", SystemEnv.getHtmlLabelName(62992, ElogSeviceUtils.currentLanguage(), "线索管理")); -// moduleMap.put("cmco", SystemEnv.getHtmlLabelName(62993, ElogSeviceUtils.currentLanguage(), "联系人管理")); -// moduleMap.put("cmcp", SystemEnv.getHtmlLabelName(62994, ElogSeviceUtils.currentLanguage(), "对手管理")); -// moduleMap.put("cmcu", SystemEnv.getHtmlLabelName(62995, ElogSeviceUtils.currentLanguage(), "客户管理")); -// moduleMap.put("cmex", SystemEnv.getHtmlLabelName(62996, ElogSeviceUtils.currentLanguage(), "批量操作")); -// moduleMap.put("cmmk", SystemEnv.getHtmlLabelName(62997, ElogSeviceUtils.currentLanguage(), "营销管理")); -// moduleMap.put("cmor", SystemEnv.getHtmlLabelName(62998, ElogSeviceUtils.currentLanguage(), "订单管理")); -// moduleMap.put("cmpc", SystemEnv.getHtmlLabelName(62999, ElogSeviceUtils.currentLanguage(), "价格管理")); -// moduleMap.put("cmpr", SystemEnv.getHtmlLabelName(63000, ElogSeviceUtils.currentLanguage(), "产品管理")); -// moduleMap.put("cmpt", SystemEnv.getHtmlLabelName(63001, ElogSeviceUtils.currentLanguage(), "外部门户")); -// moduleMap.put("cmqu", SystemEnv.getHtmlLabelName(63002, ElogSeviceUtils.currentLanguage(), "报价管理")); -// moduleMap.put("cmsa", SystemEnv.getHtmlLabelName(63003, ElogSeviceUtils.currentLanguage(), "商机管理")); -// moduleMap.put("cmtr", SystemEnv.getHtmlLabelName(63004, ElogSeviceUtils.currentLanguage(), "合同管理")); -// moduleMap.put("comp", SystemEnv.getHtmlLabelName(63005, ElogSeviceUtils.currentLanguage(), "文档对比")); -// moduleMap.put("cs", SystemEnv.getHtmlLabelName(63006, ElogSeviceUtils.currentLanguage(), "云商店")); -// moduleMap.put("cowork", SystemEnv.getHtmlLabelName(63007, ElogSeviceUtils.currentLanguage(), "协作区")); -// moduleMap.put("dbs", SystemEnv.getHtmlLabelName(63008, ElogSeviceUtils.currentLanguage(), "文档公共模块")); -// moduleMap.put("dcad", SystemEnv.getHtmlLabelName(63009, ElogSeviceUtils.currentLanguage(), "数据中心运行")); -// moduleMap.put("dcap", SystemEnv.getHtmlLabelName(63010, ElogSeviceUtils.currentLanguage(), "数据中心分析开发配置")); -// moduleMap.put("dcrd", SystemEnv.getHtmlLabelName(63011, ElogSeviceUtils.currentLanguage(), "数据中心开发配置")); -// moduleMap.put("dcre", SystemEnv.getHtmlLabelName(63012, ElogSeviceUtils.currentLanguage(), "数据中心分析生产运行")); -// moduleMap.put("dcs", SystemEnv.getHtmlLabelName(63013, ElogSeviceUtils.currentLanguage(), "文档目录模块")); -// moduleMap.put("dds", SystemEnv.getHtmlLabelName(63014, ElogSeviceUtils.currentLanguage(), "文档模块")); -// moduleMap.put("dps", SystemEnv.getHtmlLabelName(63015, ElogSeviceUtils.currentLanguage(), "文档权限模块")); -// moduleMap.put("drle", SystemEnv.getHtmlLabelName(63016, ElogSeviceUtils.currentLanguage(), "数据规则库")); -// moduleMap.put("ds", SystemEnv.getHtmlLabelName(63017, ElogSeviceUtils.currentLanguage(), "数据安全")); -// moduleMap.put("dw_etl", SystemEnv.getHtmlLabelName(63018, ElogSeviceUtils.currentLanguage(), "ETL(抽取,转换,治理)")); -// moduleMap.put("dw_model", SystemEnv.getHtmlLabelName(63019, ElogSeviceUtils.currentLanguage(), "建模服务")); -// moduleMap.put("dw_process", SystemEnv.getHtmlLabelName(63020, ElogSeviceUtils.currentLanguage(), "计算服务")); -// moduleMap.put("dw_search", SystemEnv.getHtmlLabelName(63021, ElogSeviceUtils.currentLanguage(), "查询服务")); -// moduleMap.put("dw_sync", SystemEnv.getHtmlLabelName(63022, ElogSeviceUtils.currentLanguage(), "数据抽取")); -// moduleMap.put("eb", SystemEnv.getHtmlLabelName(63023, ElogSeviceUtils.currentLanguage(), "云桥")); -// moduleMap.put("ebda", SystemEnv.getHtmlLabelName(62987, ElogSeviceUtils.currentLanguage(), "应用管理")); -// moduleMap.put("ebdd", SystemEnv.getHtmlLabelName(63024, ElogSeviceUtils.currentLanguage(), "页面设计")); -// moduleMap.put("ebdf", SystemEnv.getHtmlLabelName(63025, ElogSeviceUtils.currentLanguage(), "表单服务")); -// moduleMap.put("ebdp", SystemEnv.getHtmlLabelName(63026, ElogSeviceUtils.currentLanguage(), "页面管理")); -// moduleMap.put("ecod", SystemEnv.getHtmlLabelName(63027, ElogSeviceUtils.currentLanguage(), "ecode")); -// moduleMap.put("ei", SystemEnv.getHtmlLabelName(63028, ElogSeviceUtils.currentLanguage(), "数据导出导入")); -// moduleMap.put("em", SystemEnv.getHtmlLabelName(63029, ElogSeviceUtils.currentLanguage(), "移动相关")); -// moduleMap.put("es", SystemEnv.getHtmlLabelName(63030, ElogSeviceUtils.currentLanguage(), "微搜搜索")); -// moduleMap.put("esa", SystemEnv.getHtmlLabelName(63031, ElogSeviceUtils.currentLanguage(), "微搜文件分析")); -// moduleMap.put("esb", SystemEnv.getHtmlLabelName(63032, ElogSeviceUtils.currentLanguage(), "ESB")); -// moduleMap.put("esch", SystemEnv.getHtmlLabelName(63033, ElogSeviceUtils.currentLanguage(), "计划任务")); -// moduleMap.put("esd", SystemEnv.getHtmlLabelName(63034, ElogSeviceUtils.currentLanguage(), "微搜索引数据")); -// moduleMap.put("exfo", SystemEnv.getHtmlLabelName(63035, ElogSeviceUtils.currentLanguage(), "excel函数引擎")); -// moduleMap.put("fbdg", SystemEnv.getHtmlLabelName(63036, ElogSeviceUtils.currentLanguage(), "预算编制")); -// moduleMap.put("fdt", SystemEnv.getHtmlLabelName(63037, ElogSeviceUtils.currentLanguage(), "表单数据")); -// moduleMap.put("fexs", SystemEnv.getHtmlLabelName(63038, ElogSeviceUtils.currentLanguage(), "费用管理")); -// moduleMap.put("file", SystemEnv.getHtmlLabelName(63039, ElogSeviceUtils.currentLanguage(), "文件服务")); -// moduleMap.put("finc", SystemEnv.getHtmlLabelName(63040, ElogSeviceUtils.currentLanguage(), "微报账")); -// moduleMap.put("fnar", SystemEnv.getHtmlLabelName(63041, ElogSeviceUtils.currentLanguage(), "财务报表")); -// moduleMap.put("fomo", SystemEnv.getHtmlLabelName(63042, ElogSeviceUtils.currentLanguage(), "表单监控")); -// moduleMap.put("form", SystemEnv.getHtmlLabelName(63043, ElogSeviceUtils.currentLanguage(), "表单服务")); -// moduleMap.put("frpt", SystemEnv.getHtmlLabelName(63043, ElogSeviceUtils.currentLanguage(), "业务表单")); -// moduleMap.put("fvou", SystemEnv.getHtmlLabelName(63044, ElogSeviceUtils.currentLanguage(), "凭证集成")); -// moduleMap.put("hp", SystemEnv.getHtmlLabelName(63045, ElogSeviceUtils.currentLanguage(), "门户")); -// moduleMap.put("hr", SystemEnv.getHtmlLabelName(63046, ElogSeviceUtils.currentLanguage(), "人事档案")); -// moduleMap.put("ic", SystemEnv.getHtmlLabelName(63047, ElogSeviceUtils.currentLanguage(), "集成服务")); -// moduleMap.put("il", SystemEnv.getHtmlLabelName(63048, ElogSeviceUtils.currentLanguage(), "集成登录")); -// moduleMap.put("im", SystemEnv.getHtmlLabelName(63049, ElogSeviceUtils.currentLanguage(), "IM相关服务")); -// moduleMap.put("inc", SystemEnv.getHtmlLabelName(63050, ElogSeviceUtils.currentLanguage(), "发票云服务")); -// moduleMap.put("iua", SystemEnv.getHtmlLabelName(63051, ElogSeviceUtils.currentLanguage(), "统一认证")); -// moduleMap.put("iut", SystemEnv.getHtmlLabelName(63052, ElogSeviceUtils.currentLanguage(), "统一待办")); -// moduleMap.put("mail", SystemEnv.getHtmlLabelName(63053, ElogSeviceUtils.currentLanguage(), "邮件服务")); -// moduleMap.put("mc", SystemEnv.getHtmlLabelName(63054, ElogSeviceUtils.currentLanguage(), "消息服务")); -// moduleMap.put("mt", SystemEnv.getHtmlLabelName(63055, ElogSeviceUtils.currentLanguage(), "会议管理")); -// moduleMap.put("my", SystemEnv.getHtmlLabelName(63056, ElogSeviceUtils.currentLanguage(), "关注&收藏&标签")); -// moduleMap.put("odoc", SystemEnv.getHtmlLabelName(63057, ElogSeviceUtils.currentLanguage(), "公文管理")); -// moduleMap.put("odoc_exchange", SystemEnv.getHtmlLabelName(63058, ElogSeviceUtils.currentLanguage(), "公文交换平台")); -// moduleMap.put("open", SystemEnv.getHtmlLabelName(63059, ElogSeviceUtils.currentLanguage(), "开放平台")); -// moduleMap.put("pr", SystemEnv.getHtmlLabelName(63060, ElogSeviceUtils.currentLanguage(), "工作画像")); -// moduleMap.put("proj", SystemEnv.getHtmlLabelName(63061, ElogSeviceUtils.currentLanguage(), "项目管理")); -// moduleMap.put("prt", SystemEnv.getHtmlLabelName(63062, ElogSeviceUtils.currentLanguage(), "打印服务")); -// moduleMap.put("pspt", SystemEnv.getHtmlLabelName(63063, ElogSeviceUtils.currentLanguage(), "系统登录")); -// moduleMap.put("rptc", SystemEnv.getHtmlLabelName(63064, ElogSeviceUtils.currentLanguage(), "数据协作")); -// moduleMap.put("rpts", SystemEnv.getHtmlLabelName(63065, ElogSeviceUtils.currentLanguage(), "上报调查")); -// moduleMap.put("sala", SystemEnv.getHtmlLabelName(63066, ElogSeviceUtils.currentLanguage(), "薪资管理")); -// moduleMap.put("sign", SystemEnv.getHtmlLabelName(63067, ElogSeviceUtils.currentLanguage(), "印控中心")); -// moduleMap.put("sms", SystemEnv.getHtmlLabelName(63068, ElogSeviceUtils.currentLanguage(), "短信")); -// moduleMap.put("task", SystemEnv.getHtmlLabelName(63069, ElogSeviceUtils.currentLanguage(), "任务管理")); -// moduleMap.put("tnt", SystemEnv.getHtmlLabelName(63070, ElogSeviceUtils.currentLanguage(), "租户管理")); -// moduleMap.put("wf", SystemEnv.getHtmlLabelName(63071, ElogSeviceUtils.currentLanguage(), "路径定义")); -// moduleMap.put("wfc", SystemEnv.getHtmlLabelName(63072, ElogSeviceUtils.currentLanguage(), "流程流转")); -// moduleMap.put("wfr", SystemEnv.getHtmlLabelName(63073, ElogSeviceUtils.currentLanguage(), "流程规则路由")); -// moduleMap.put("wrgm", SystemEnv.getHtmlLabelName(63074, ElogSeviceUtils.currentLanguage(), "目标管理")); -// moduleMap.put("wrgp", SystemEnv.getHtmlLabelName(63075, ElogSeviceUtils.currentLanguage(), "绩效考核")); -// moduleMap.put("wrpr", SystemEnv.getHtmlLabelName(63076, ElogSeviceUtils.currentLanguage(), "计划报告")); -// moduleMap.put("doc", SystemEnv.getHtmlLabelName(63077, ElogSeviceUtils.currentLanguage(), "文档服务")); -// moduleMap.put("placard", SystemEnv.getHtmlLabelName(63078, ElogSeviceUtils.currentLanguage(), "团队公告")); -// moduleMap.put("fna", SystemEnv.getHtmlLabelName(135042, ElogSeviceUtils.currentLanguage(), "云报销")); -// moduleMap.put("meeting", SystemEnv.getHtmlLabelName(63080, ElogSeviceUtils.currentLanguage(), "会议")); -// moduleMap.put("wfp", SystemEnv.getHtmlLabelName(63081, ElogSeviceUtils.currentLanguage(), "流程")); -// moduleMap.put("portal", SystemEnv.getHtmlLabelName(63045, ElogSeviceUtils.currentLanguage(), "门户")); -// moduleMap.put("workreport", SystemEnv.getHtmlLabelName(63082, ElogSeviceUtils.currentLanguage(), "工作报告")); -// moduleMap.put("goal", SystemEnv.getHtmlLabelName(63074, ElogSeviceUtils.currentLanguage(), "目标管理")); -// moduleMap.put("performance", SystemEnv.getHtmlLabelName(63075, ElogSeviceUtils.currentLanguage(), "绩效考核")); -// moduleMap.put("intlogin", SystemEnv.getHtmlLabelName(63083, ElogSeviceUtils.currentLanguage(), "集成登录设置")); -// moduleMap.put("i18n", SystemEnv.getHtmlLabelName(64559, ElogSeviceUtils.currentLanguage(), "国际化")); -// moduleMap.put("timecard", SystemEnv.getHtmlLabelName(63085, ElogSeviceUtils.currentLanguage(), "出勤")); -// moduleMap.put("market", SystemEnv.getHtmlLabelName(63086, ElogSeviceUtils.currentLanguage(), "营销")); -// moduleMap.put("excelformula", SystemEnv.getHtmlLabelName(64560, ElogSeviceUtils.currentLanguage(), "函数服务")); -// moduleMap.put("ic_ldap", SystemEnv.getHtmlLabelName(70081, ElogSeviceUtils.currentLanguage(), "Ldap集成")); -// moduleMap.put("iut_c_c", SystemEnv.getHtmlLabelName(70303, ElogSeviceUtils.currentLanguage(), "统一待办推送设置")); -// moduleMap.put("plan", SystemEnv.getHtmlLabelName(70303, ElogSeviceUtils.currentLanguage(), "计划报告")); -// moduleMap.put("document", SystemEnv.getHtmlLabelName(34218, ElogSeviceUtils.currentLanguage(), "文档")); -// moduleMap.put("taskCustStatus", SystemEnv.getHtmlLabelName(73988, ElogSeviceUtils.currentLanguage(), "任务状态")); -// moduleMap.put("project", SystemEnv.getHtmlLabelName(55158, ElogSeviceUtils.currentLanguage(), "项目")); -// moduleMap.put("calendar", SystemEnv.getHtmlLabelName(74186, ElogSeviceUtils.currentLanguage(), "日历")); -// moduleMap.put("web", SystemEnv.getHtmlLabelName(75598, ElogSeviceUtils.currentLanguage(), "浏览")); -// moduleMap.put("formdatareport", SystemEnv.getHtmlLabelName(76068, ElogSeviceUtils.currentLanguage(), "来自上报数据")); -// moduleMap.put("mainline", SystemEnv.getHtmlLabelName(31898, ElogSeviceUtils.currentLanguage(), "主线")); -// moduleMap.put("customer", SystemEnv.getHtmlLabelName(32726, ElogSeviceUtils.currentLanguage(), "客户")); -// moduleMap.put("contract", SystemEnv.getHtmlLabelName(32864, ElogSeviceUtils.currentLanguage(), "合同")); -// moduleMap.put("group", SystemEnv.getHtmlLabelName(19426, ElogSeviceUtils.currentLanguage(), "分组")); -// moduleMap.put("workflow", SystemEnv.getHtmlLabelName(81851, ElogSeviceUtils.currentLanguage(), "工作流程")); -// moduleMap.put("biaoge", SystemEnv.getHtmlLabelName(30919, ElogSeviceUtils.currentLanguage(), "表格")); -// moduleMap.put("clue", SystemEnv.getHtmlLabelName(28908, ElogSeviceUtils.currentLanguage(), "线索")); -// moduleMap.put("competitor", SystemEnv.getHtmlLabelName(81852, ElogSeviceUtils.currentLanguage(), "竞争对手")); -// moduleMap.put("kpiFlow", SystemEnv.getHtmlLabelName(81853, ElogSeviceUtils.currentLanguage(), "kpil流程")); -// moduleMap.put("mainlineCustStatus", SystemEnv.getHtmlLabelName(81854, ElogSeviceUtils.currentLanguage(), "主线客户状态")); -// moduleMap.put("marketactivity", SystemEnv.getHtmlLabelName(34221, ElogSeviceUtils.currentLanguage(), "市场活动")); -// moduleMap.put("mtPhase", SystemEnv.getHtmlLabelName(81855, ElogSeviceUtils.currentLanguage(), "mt阶段")); -// moduleMap.put("production", SystemEnv.getHtmlLabelName(29329, ElogSeviceUtils.currentLanguage(), "产品")); -// moduleMap.put("quote", SystemEnv.getHtmlLabelName(34231, ElogSeviceUtils.currentLanguage(), "报价")); -// moduleMap.put("saleChance", SystemEnv.getHtmlLabelName(32863, ElogSeviceUtils.currentLanguage(), "商机")); -// moduleMap.put("orderform", SystemEnv.getHtmlLabelName(34230, ElogSeviceUtils.currentLanguage(), "订单")); -// moduleMap.put("contact", SystemEnv.getHtmlLabelName(32711, ElogSeviceUtils.currentLanguage(), "联系人")); -// moduleMap.put("price", SystemEnv.getHtmlLabelName(31922, ElogSeviceUtils.currentLanguage(), "价格")); -// moduleMap.put("capital", SystemEnv.getHtmlLabelName(83428, ElogSeviceUtils.currentLanguage(), "资金")); -// moduleMap.put("ice", SystemEnv.getHtmlLabelName(94360, ElogSeviceUtils.currentLanguage(), "日程会议集成")); -// moduleMap.put("ic_hr", SystemEnv.getHtmlLabelName(84284, ElogSeviceUtils.currentLanguage(), "HR同步")); -// moduleMap.put("intunifyauth", SystemEnv.getHtmlLabelName(84467, ElogSeviceUtils.currentLanguage(), "统一认证接入管理")); -// moduleMap.put("signcenter", SystemEnv.getHtmlLabelName(84691, ElogSeviceUtils.currentLanguage(), "电子签")); -// moduleMap.put("iut_s_c", SystemEnv.getHtmlLabelName(91503, ElogSeviceUtils.currentLanguage(), "统一待办-异构系统")); -// moduleMap.put("iut_s_c1", SystemEnv.getHtmlLabelName(91503, ElogSeviceUtils.currentLanguage(), "统一待办-应用系统")); -// moduleMap.put("iut_s_c2", SystemEnv.getHtmlLabelName(91503, ElogSeviceUtils.currentLanguage(), "统一待办中心")); -// moduleMap.put("iut_s_c3", SystemEnv.getHtmlLabelName(91503, ElogSeviceUtils.currentLanguage(), "统一待办-应用系统-流程类型")); -// moduleMap.put("ic_mail", SystemEnv.getHtmlLabelName(100715, ElogSeviceUtils.currentLanguage(), "邮箱集成")); -// moduleMap.put("hrsa", SystemEnv.getHtmlLabelName(105038, ElogSeviceUtils.currentLanguage(), "薪酬管理")); -// moduleMap.put("icc", SystemEnv.getHtmlLabelName(113884, ElogSeviceUtils.currentLanguage(), "转换规则")); -// moduleMap.put("basicserver", SystemEnv.getHtmlLabelName(113885, ElogSeviceUtils.currentLanguage(), "整体基础")); -// moduleMap.put("dw", SystemEnv.getHtmlLabelName(115549, ElogSeviceUtils.currentLanguage(), "数据仓库")); -// moduleMap.put("msg", SystemEnv.getHtmlLabelName(115563, ElogSeviceUtils.currentLanguage(), "工作消息")); -// moduleMap.put("intunifybase", SystemEnv.getHtmlLabelName(115599, ElogSeviceUtils.currentLanguage(), "统一认证服务")); -// moduleMap.put("esearch", SystemEnv.getHtmlLabelName(21694, ElogSeviceUtils.currentLanguage(), "全文检索")); -// moduleMap.put("iaauthserver", SystemEnv.getHtmlLabelName(115603, ElogSeviceUtils.currentLanguage(), "统一认证注册应用")); -// moduleMap.put("excel", SystemEnv.getHtmlLabelName(115543, ElogSeviceUtils.currentLanguage(), "excel函数")); -// moduleMap.put("scene", SystemEnv.getHtmlLabelName(115539, ElogSeviceUtils.currentLanguage(), "绘图")); -// moduleMap.put("bcw", SystemEnv.getHtmlLabelName(115651, ElogSeviceUtils.currentLanguage(), "公共模块")); -// moduleMap.put("folder", SystemEnv.getHtmlLabelName(10734, ElogSeviceUtils.currentLanguage(), "文件夹")); -// moduleMap.put("pdfcnv", SystemEnv.getHtmlLabelName(115957, ElogSeviceUtils.currentLanguage(), "PDF转换服务")); -// moduleMap.put("ebform", SystemEnv.getHtmlLabelName(121462, ElogSeviceUtils.currentLanguage(), "e-Builder表单")); -// moduleMap.put("statistics", SystemEnv.getHtmlLabelName(17745, ElogSeviceUtils.currentLanguage(), "自定义统计")); -// moduleMap.put("edcapp", SystemEnv.getHtmlLabelName(121631, ElogSeviceUtils.currentLanguage(), "多级填报")); -// -// */ -// -// moduleMap.put("elog", 62975); -// moduleMap.put("report", 62976); -// moduleMap.put("edc", 52689); -// moduleMap.put("hrm", 62978); -// moduleMap.put("crm", 62979); -// moduleMap.put("demo", 62980); -// moduleMap.put("attc", 62981); -// moduleMap.put("attm", 62982); -// moduleMap.put("attw", 62983); -// moduleMap.put("auth", 62984); -// moduleMap.put("bank", 62985); -// moduleMap.put("bap", 62986); -// moduleMap.put("base", 62987); -// moduleMap.put("batc", 62988); -// moduleMap.put("blog", 62989); -// moduleMap.put("cld", 62990); -// moduleMap.put("cmca", 62991); -// moduleMap.put("cmcl", 62992); -// moduleMap.put("cmco", 62993); -// moduleMap.put("cmcp", 62994); -// moduleMap.put("cmcu", 62995); -// moduleMap.put("cmex", 62996); -// moduleMap.put("cmmk", 62997); -// moduleMap.put("cmor", 62998); -// moduleMap.put("cmpc", 62999); -// moduleMap.put("cmpr", 63000); -// moduleMap.put("cmpt", 63001); -// moduleMap.put("cmqu", 63002); -// moduleMap.put("cmsa", 63003); -// moduleMap.put("cmtr", 63004); -// moduleMap.put("comp", 63005); -// moduleMap.put("cs", 63006); -// moduleMap.put("cowork", 63007); -// moduleMap.put("dbs", 63008); -// moduleMap.put("dcad", 63009); -// moduleMap.put("dcap", 63010); -// moduleMap.put("dcrd", 63011); -// moduleMap.put("dcre", 63012); -// moduleMap.put("dcs", 63013); -// moduleMap.put("dds", 63014); -// moduleMap.put("dps", 63015); -// moduleMap.put("drle", 63016); -// moduleMap.put("ds", 63017); -// moduleMap.put("dw_etl", 63018); -// moduleMap.put("dw_model", 63019); -// moduleMap.put("dw_process", 63020); -// moduleMap.put("dw_search", 63021); -// moduleMap.put("dw_sync", 63022); -// moduleMap.put("eb", 63023); -// moduleMap.put("ebda", 62987); -// moduleMap.put("ebdd", 63024); -// moduleMap.put("ebdf", 63025); -// moduleMap.put("ebdp", 63026); -// moduleMap.put("ecod", 63027); -// moduleMap.put("ei", 63028); -// moduleMap.put("em", 63029); -// moduleMap.put("es", 63030); -// moduleMap.put("esa", 63031); -// moduleMap.put("esb", 63032); -// moduleMap.put("esch", 63033); -// moduleMap.put("esd", 63034); -// moduleMap.put("exfo", 63035); -// moduleMap.put("fbdg", 63036); -// moduleMap.put("fdt",63037); -// moduleMap.put("fexs", 63038); -// moduleMap.put("file", 63039); -// moduleMap.put("finc", 63040); -// moduleMap.put("fnar", 63041); -// moduleMap.put("fomo", 63042); -// moduleMap.put("form", 63043); -// moduleMap.put("frpt", 63043); -// moduleMap.put("fvou", 63044); -// moduleMap.put("hp", 63045); -// moduleMap.put("hr", 63046); -// moduleMap.put("ic", 63047); -// moduleMap.put("il", 63048); -// moduleMap.put("im", 63049); -// moduleMap.put("inc", 63050); -// moduleMap.put("iua", 63051); -// moduleMap.put("iut", 63052); -// moduleMap.put("mail", 63053); -// moduleMap.put("mc", 63054); -// moduleMap.put("mt", 63055); -// moduleMap.put("my", 63056); -// moduleMap.put("odoc", 63057); -// moduleMap.put("odoc_exchange", 63058); -// moduleMap.put("open", 63059); -// moduleMap.put("pr", 63060); -// moduleMap.put("proj", 63061); -// moduleMap.put("prt", 63062); -// moduleMap.put("pspt", 63063); -// moduleMap.put("rptc", 63064); -// moduleMap.put("rpts", 63065); -// moduleMap.put("sala", 63066); -// moduleMap.put("sign", 63067); -// moduleMap.put("sms", 63068); -// moduleMap.put("task", 63069); -// moduleMap.put("tnt", 63070); -// moduleMap.put("wf", 63071); -// moduleMap.put("wfc", 63072); -// moduleMap.put("wfr", 63073); -// moduleMap.put("wrgm", 63074); -// moduleMap.put("wrgp", 63075); -// moduleMap.put("wrpr", 63076); -// moduleMap.put("doc", 63077); -// moduleMap.put("placard", 63078); -// moduleMap.put("fna", 135042); -// moduleMap.put("meeting", 63080); -// moduleMap.put("wfp", 63081); -// moduleMap.put("portal", 63045); -// moduleMap.put("workreport", 63082); -// moduleMap.put("goal", 63074); -// moduleMap.put("performance", 63075); -// moduleMap.put("intlogin", 63083); -// moduleMap.put("i18n", 64559); -// moduleMap.put("timecard", 63085); -// moduleMap.put("market", 63086); -// moduleMap.put("excelformula", 64560); -// moduleMap.put("ebatch", 69280); -// moduleMap.put("ic_ldap", 70081); -// moduleMap.put("iut_c_c", 96493); -// moduleMap.put("plan", 63076); -// moduleMap.put("document", 34218); -// moduleMap.put("taskCustStatus", 73988); -// moduleMap.put("calendar", 74186); -// moduleMap.put("batch", 69280); -// moduleMap.put("project", 55158); -// moduleMap.put("web", 75598); -// moduleMap.put("formdatareport", 76068); -// moduleMap.put("mainline", 31898); -// moduleMap.put("customer", 32726); -// moduleMap.put("contract", 32864); -// moduleMap.put("group", 19426); -// moduleMap.put("workflow", 81851); -// moduleMap.put("biaoge", 30919); -// moduleMap.put("clue", 28908); -// moduleMap.put("competitor", 81852); -// moduleMap.put("kpiFlow", 81853); -// moduleMap.put("mainlineCustStatus", 81854); -// moduleMap.put("marketactivity", 34221); -// moduleMap.put("mtPhase", 81855); -// moduleMap.put("production", 29329); -// moduleMap.put("quote", 34231); -// moduleMap.put("saleChance", 32863); -// moduleMap.put("orderform", 34230); -// moduleMap.put("contact", 32711); -// moduleMap.put("price", 31922); -// moduleMap.put("capital", 83428); -// moduleMap.put("ice", 87722); -// moduleMap.put("ic_hr", 84284); -// moduleMap.put("intunifyauth", 84508); -// moduleMap.put("signcenter", 84691); -// moduleMap.put("iut_s_c", 91503); -// moduleMap.put("iut_s_c1", 95218); -// moduleMap.put("iut_s_c2", 95219); -// moduleMap.put("iut_s_c3", 95220); -// moduleMap.put("iut_c_log", 96494); -// moduleMap.put("ic_mail", 100715); -// moduleMap.put("hrsa", 105038); -// moduleMap.put("icc", 113884); -// moduleMap.put("basicserver", 113885); -// moduleMap.put("dw", 115549); -// moduleMap.put("msg", 115563); -// moduleMap.put("intunifybase", 115599); -// moduleMap.put("esearch", 21694); -// moduleMap.put("iaauthserver", 115603); -// moduleMap.put("excel", 115543); -// moduleMap.put("scene", 115539); -// moduleMap.put("bcw", 115651); -// moduleMap.put("folder", 10734); -// moduleMap.put("pdfcnv", 115957); -// moduleMap.put("login", 63063); -// moduleMap.put("ebform", 121462); -// moduleMap.put("statistics", 17745); -// moduleMap.put("edcapp", 121631); -// moduleMap.put("cusapp", 16381); -// moduleMap.put("e10-allinone-base", 141083); -// moduleMap.put("voice", 142713); -// moduleMap.put("filter", 147832); -// moduleMap.put("ias", 146674); -// moduleMap.put("device", 153666); -// moduleMap.put("meetingTopic", 180274); -// moduleMap.put("meetingService", 180276); -// moduleMap.put("meetingDecision", 180277); -// moduleMap.put("meetingSign", 180278); -// moduleMap.put("meetingSignSet", 61601); -// moduleMap.put("meetingMember", 180280); -// moduleMap.put("meetingShare", 180281); -// moduleMap.put("int", 40031); -// moduleMap.put("print", 160051); -// moduleMap.put("wcwIconUpdate", 182661); -// moduleMap.put("wcwIconRelease", 183123); -// moduleMap.put("wcwIconUse", 183124); -// moduleMap.put("wcw", 29385); -// moduleMap.put("component", 115651); -// moduleMap.put("ic_exchange", 87722); -// moduleMap.put("iut_c_c", 240048); -// moduleMap.put("iut_c_set", 240049); -// -// Map elogMap = new HashMap<>(); -// Map reportMap = new HashMap<>(); -// Map edcMap = new HashMap<>(); -// Map hrmMap = new HashMap<>(); -// Map crmMap = new HashMap<>(); -// Map demoMap = new HashMap<>(); -// -// moduleFuctionMap.put("elog", elogMap); -// moduleFuctionMap.put("report", reportMap); -// moduleFuctionMap.put("edc", edcMap); -// moduleFuctionMap.put("hrm", hrmMap); -// moduleFuctionMap.put("crm", crmMap); -// moduleFuctionMap.put("demo", demoMap); -// -// -// -// elogMap.put("operator", "日志操作"); -// elogMap.put("reportcusinfo","报表自定义"); -// edcMap.put("dataset","数据集合"); -// -// demoMap.put("reportcusinfo","报表自定义字段"); -// } -// -// /** -// * 获取模块名称 -// * @param module -// * @return -// */ -// public static String getModuleName(String module) { +package com.engine.salary.elog.util; + +import cn.hutool.core.map.CaseInsensitiveMap; +import com.alibaba.druid.proxy.jdbc.ClobProxyImpl; +import com.alibaba.fastjson.JSON; +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.util.SalaryI18nUtil; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import weaver.conn.RecordSet; + +import java.sql.Clob; +import java.util.*; + +/** + * @Date: 2022/5/18 19:34 + * @Author: deli.xu + * @Description: elog服务转换类 + **/ +public class ElogSeviceSwitchUtils { + + private static final Logger logger = LoggerFactory.getLogger(ElogSeviceSwitchUtils.class); + // TODO 后续需要考虑多语言label写法 + public static final Map moduleMap = new HashMap<>(); + + private static final Map> moduleFuctionMap = new HashMap<>(); + + static { + /*moduleMap.put("elog", SalaryI18nUtil.getI18nLabel(62975, ElogSeviceUtils.currentLanguage(), "日志")); + moduleMap.put("report", SalaryI18nUtil.getI18nLabel(62976, ElogSeviceUtils.currentLanguage(), "报表")); + moduleMap.put("edc", SalaryI18nUtil.getI18nLabel(62977, ElogSeviceUtils.currentLanguage(), "数据中心")); + moduleMap.put("hrm", SalaryI18nUtil.getI18nLabel(62978, ElogSeviceUtils.currentLanguage(), "人力资源")); + moduleMap.put("crm", SalaryI18nUtil.getI18nLabel(62979, ElogSeviceUtils.currentLanguage(), "资产")); + moduleMap.put("demo", SalaryI18nUtil.getI18nLabel(62980, ElogSeviceUtils.currentLanguage(), "示例")); + moduleMap.put("attc", SalaryI18nUtil.getI18nLabel(62981, ElogSeviceUtils.currentLanguage(), "出勤打卡")); + moduleMap.put("attm", SalaryI18nUtil.getI18nLabel(62982, ElogSeviceUtils.currentLanguage(), "出勤机")); + moduleMap.put("attw", SalaryI18nUtil.getI18nLabel(62983, ElogSeviceUtils.currentLanguage(), "出勤报表")); + moduleMap.put("auth", SalaryI18nUtil.getI18nLabel(62984, ElogSeviceUtils.currentLanguage(), "系统权限")); + moduleMap.put("bank", SalaryI18nUtil.getI18nLabel(62985, ElogSeviceUtils.currentLanguage(), "银企直联")); + moduleMap.put("bap", SalaryI18nUtil.getI18nLabel(62986, ElogSeviceUtils.currentLanguage(), "云办公")); + moduleMap.put("base", SalaryI18nUtil.getI18nLabel(62987, ElogSeviceUtils.currentLanguage(), "应用管理")); + moduleMap.put("batc", SalaryI18nUtil.getI18nLabel(62988, ElogSeviceUtils.currentLanguage(), "导入导出")); + moduleMap.put("blog", SalaryI18nUtil.getI18nLabel(62989, ElogSeviceUtils.currentLanguage(), "日报微博")); + moduleMap.put("cld", SalaryI18nUtil.getI18nLabel(62990, ElogSeviceUtils.currentLanguage(), "日程管理")); + moduleMap.put("cmca", SalaryI18nUtil.getI18nLabel(62991, ElogSeviceUtils.currentLanguage(), "资金管理")); + moduleMap.put("cmcl", SalaryI18nUtil.getI18nLabel(62992, ElogSeviceUtils.currentLanguage(), "线索管理")); + moduleMap.put("cmco", SalaryI18nUtil.getI18nLabel(62993, ElogSeviceUtils.currentLanguage(), "联系人管理")); + moduleMap.put("cmcp", SalaryI18nUtil.getI18nLabel(62994, ElogSeviceUtils.currentLanguage(), "对手管理")); + moduleMap.put("cmcu", SalaryI18nUtil.getI18nLabel(62995, ElogSeviceUtils.currentLanguage(), "客户管理")); + moduleMap.put("cmex", SalaryI18nUtil.getI18nLabel(62996, ElogSeviceUtils.currentLanguage(), "批量操作")); + moduleMap.put("cmmk", SalaryI18nUtil.getI18nLabel(62997, ElogSeviceUtils.currentLanguage(), "营销管理")); + moduleMap.put("cmor", SalaryI18nUtil.getI18nLabel(62998, ElogSeviceUtils.currentLanguage(), "订单管理")); + moduleMap.put("cmpc", SalaryI18nUtil.getI18nLabel(62999, ElogSeviceUtils.currentLanguage(), "价格管理")); + moduleMap.put("cmpr", SalaryI18nUtil.getI18nLabel(63000, ElogSeviceUtils.currentLanguage(), "产品管理")); + moduleMap.put("cmpt", SalaryI18nUtil.getI18nLabel(63001, ElogSeviceUtils.currentLanguage(), "外部门户")); + moduleMap.put("cmqu", SalaryI18nUtil.getI18nLabel(63002, ElogSeviceUtils.currentLanguage(), "报价管理")); + moduleMap.put("cmsa", SalaryI18nUtil.getI18nLabel(63003, ElogSeviceUtils.currentLanguage(), "商机管理")); + moduleMap.put("cmtr", SalaryI18nUtil.getI18nLabel(63004, ElogSeviceUtils.currentLanguage(), "合同管理")); + moduleMap.put("comp", SalaryI18nUtil.getI18nLabel(63005, ElogSeviceUtils.currentLanguage(), "文档对比")); + moduleMap.put("cs", SalaryI18nUtil.getI18nLabel(63006, ElogSeviceUtils.currentLanguage(), "云商店")); + moduleMap.put("cowork", SalaryI18nUtil.getI18nLabel(63007, ElogSeviceUtils.currentLanguage(), "协作区")); + moduleMap.put("dbs", SalaryI18nUtil.getI18nLabel(63008, ElogSeviceUtils.currentLanguage(), "文档公共模块")); + moduleMap.put("dcad", SalaryI18nUtil.getI18nLabel(63009, ElogSeviceUtils.currentLanguage(), "数据中心运行")); + moduleMap.put("dcap", SalaryI18nUtil.getI18nLabel(63010, ElogSeviceUtils.currentLanguage(), "数据中心分析开发配置")); + moduleMap.put("dcrd", SalaryI18nUtil.getI18nLabel(63011, ElogSeviceUtils.currentLanguage(), "数据中心开发配置")); + moduleMap.put("dcre", SalaryI18nUtil.getI18nLabel(63012, ElogSeviceUtils.currentLanguage(), "数据中心分析生产运行")); + moduleMap.put("dcs", SalaryI18nUtil.getI18nLabel(63013, ElogSeviceUtils.currentLanguage(), "文档目录模块")); + moduleMap.put("dds", SalaryI18nUtil.getI18nLabel(63014, ElogSeviceUtils.currentLanguage(), "文档模块")); + moduleMap.put("dps", SalaryI18nUtil.getI18nLabel(63015, ElogSeviceUtils.currentLanguage(), "文档权限模块")); + moduleMap.put("drle", SalaryI18nUtil.getI18nLabel(63016, ElogSeviceUtils.currentLanguage(), "数据规则库")); + moduleMap.put("ds", SalaryI18nUtil.getI18nLabel(63017, ElogSeviceUtils.currentLanguage(), "数据安全")); + moduleMap.put("dw_etl", SalaryI18nUtil.getI18nLabel(63018, ElogSeviceUtils.currentLanguage(), "ETL(抽取,转换,治理)")); + moduleMap.put("dw_model", SalaryI18nUtil.getI18nLabel(63019, ElogSeviceUtils.currentLanguage(), "建模服务")); + moduleMap.put("dw_process", SalaryI18nUtil.getI18nLabel(63020, ElogSeviceUtils.currentLanguage(), "计算服务")); + moduleMap.put("dw_search", SalaryI18nUtil.getI18nLabel(63021, ElogSeviceUtils.currentLanguage(), "查询服务")); + moduleMap.put("dw_sync", SalaryI18nUtil.getI18nLabel(63022, ElogSeviceUtils.currentLanguage(), "数据抽取")); + moduleMap.put("eb", SalaryI18nUtil.getI18nLabel(63023, ElogSeviceUtils.currentLanguage(), "云桥")); + moduleMap.put("ebda", SalaryI18nUtil.getI18nLabel(62987, ElogSeviceUtils.currentLanguage(), "应用管理")); + moduleMap.put("ebdd", SalaryI18nUtil.getI18nLabel(63024, ElogSeviceUtils.currentLanguage(), "页面设计")); + moduleMap.put("ebdf", SalaryI18nUtil.getI18nLabel(63025, ElogSeviceUtils.currentLanguage(), "表单服务")); + moduleMap.put("ebdp", SalaryI18nUtil.getI18nLabel(63026, ElogSeviceUtils.currentLanguage(), "页面管理")); + moduleMap.put("ecod", SalaryI18nUtil.getI18nLabel(63027, ElogSeviceUtils.currentLanguage(), "ecode")); + moduleMap.put("ei", SalaryI18nUtil.getI18nLabel(63028, ElogSeviceUtils.currentLanguage(), "数据导出导入")); + moduleMap.put("em", SalaryI18nUtil.getI18nLabel(63029, ElogSeviceUtils.currentLanguage(), "移动相关")); + moduleMap.put("es", SalaryI18nUtil.getI18nLabel(63030, ElogSeviceUtils.currentLanguage(), "微搜搜索")); + moduleMap.put("esa", SalaryI18nUtil.getI18nLabel(63031, ElogSeviceUtils.currentLanguage(), "微搜文件分析")); + moduleMap.put("esb", SalaryI18nUtil.getI18nLabel(63032, ElogSeviceUtils.currentLanguage(), "ESB")); + moduleMap.put("esch", SalaryI18nUtil.getI18nLabel(63033, ElogSeviceUtils.currentLanguage(), "计划任务")); + moduleMap.put("esd", SalaryI18nUtil.getI18nLabel(63034, ElogSeviceUtils.currentLanguage(), "微搜索引数据")); + moduleMap.put("exfo", SalaryI18nUtil.getI18nLabel(63035, ElogSeviceUtils.currentLanguage(), "excel函数引擎")); + moduleMap.put("fbdg", SalaryI18nUtil.getI18nLabel(63036, ElogSeviceUtils.currentLanguage(), "预算编制")); + moduleMap.put("fdt", SalaryI18nUtil.getI18nLabel(63037, ElogSeviceUtils.currentLanguage(), "表单数据")); + moduleMap.put("fexs", SalaryI18nUtil.getI18nLabel(63038, ElogSeviceUtils.currentLanguage(), "费用管理")); + moduleMap.put("file", SalaryI18nUtil.getI18nLabel(63039, ElogSeviceUtils.currentLanguage(), "文件服务")); + moduleMap.put("finc", SalaryI18nUtil.getI18nLabel(63040, ElogSeviceUtils.currentLanguage(), "微报账")); + moduleMap.put("fnar", SalaryI18nUtil.getI18nLabel(63041, ElogSeviceUtils.currentLanguage(), "财务报表")); + moduleMap.put("fomo", SalaryI18nUtil.getI18nLabel(63042, ElogSeviceUtils.currentLanguage(), "表单监控")); + moduleMap.put("form", SalaryI18nUtil.getI18nLabel(63043, ElogSeviceUtils.currentLanguage(), "表单服务")); + moduleMap.put("frpt", SalaryI18nUtil.getI18nLabel(63043, ElogSeviceUtils.currentLanguage(), "业务表单")); + moduleMap.put("fvou", SalaryI18nUtil.getI18nLabel(63044, ElogSeviceUtils.currentLanguage(), "凭证集成")); + moduleMap.put("hp", SalaryI18nUtil.getI18nLabel(63045, ElogSeviceUtils.currentLanguage(), "门户")); + moduleMap.put("hr", SalaryI18nUtil.getI18nLabel(63046, ElogSeviceUtils.currentLanguage(), "人事档案")); + moduleMap.put("ic", SalaryI18nUtil.getI18nLabel(63047, ElogSeviceUtils.currentLanguage(), "集成服务")); + moduleMap.put("il", SalaryI18nUtil.getI18nLabel(63048, ElogSeviceUtils.currentLanguage(), "集成登录")); + moduleMap.put("im", SalaryI18nUtil.getI18nLabel(63049, ElogSeviceUtils.currentLanguage(), "IM相关服务")); + moduleMap.put("inc", SalaryI18nUtil.getI18nLabel(63050, ElogSeviceUtils.currentLanguage(), "发票云服务")); + moduleMap.put("iua", SalaryI18nUtil.getI18nLabel(63051, ElogSeviceUtils.currentLanguage(), "统一认证")); + moduleMap.put("iut", SalaryI18nUtil.getI18nLabel(63052, ElogSeviceUtils.currentLanguage(), "统一待办")); + moduleMap.put("mail", SalaryI18nUtil.getI18nLabel(63053, ElogSeviceUtils.currentLanguage(), "邮件服务")); + moduleMap.put("mc", SalaryI18nUtil.getI18nLabel(63054, ElogSeviceUtils.currentLanguage(), "消息服务")); + moduleMap.put("mt", SalaryI18nUtil.getI18nLabel(63055, ElogSeviceUtils.currentLanguage(), "会议管理")); + moduleMap.put("my", SalaryI18nUtil.getI18nLabel(63056, ElogSeviceUtils.currentLanguage(), "关注&收藏&标签")); + moduleMap.put("odoc", SalaryI18nUtil.getI18nLabel(63057, ElogSeviceUtils.currentLanguage(), "公文管理")); + moduleMap.put("odoc_exchange", SalaryI18nUtil.getI18nLabel(63058, ElogSeviceUtils.currentLanguage(), "公文交换平台")); + moduleMap.put("open", SalaryI18nUtil.getI18nLabel(63059, ElogSeviceUtils.currentLanguage(), "开放平台")); + moduleMap.put("pr", SalaryI18nUtil.getI18nLabel(63060, ElogSeviceUtils.currentLanguage(), "工作画像")); + moduleMap.put("proj", SalaryI18nUtil.getI18nLabel(63061, ElogSeviceUtils.currentLanguage(), "项目管理")); + moduleMap.put("prt", SalaryI18nUtil.getI18nLabel(63062, ElogSeviceUtils.currentLanguage(), "打印服务")); + moduleMap.put("pspt", SalaryI18nUtil.getI18nLabel(63063, ElogSeviceUtils.currentLanguage(), "系统登录")); + moduleMap.put("rptc", SalaryI18nUtil.getI18nLabel(63064, ElogSeviceUtils.currentLanguage(), "数据协作")); + moduleMap.put("rpts", SalaryI18nUtil.getI18nLabel(63065, ElogSeviceUtils.currentLanguage(), "上报调查")); + moduleMap.put("sala", SalaryI18nUtil.getI18nLabel(63066, ElogSeviceUtils.currentLanguage(), "薪资管理")); + moduleMap.put("sign", SalaryI18nUtil.getI18nLabel(63067, ElogSeviceUtils.currentLanguage(), "印控中心")); + moduleMap.put("sms", SalaryI18nUtil.getI18nLabel(63068, ElogSeviceUtils.currentLanguage(), "短信")); + moduleMap.put("task", SalaryI18nUtil.getI18nLabel(63069, ElogSeviceUtils.currentLanguage(), "任务管理")); + moduleMap.put("tnt", SalaryI18nUtil.getI18nLabel(63070, ElogSeviceUtils.currentLanguage(), "租户管理")); + moduleMap.put("wf", SalaryI18nUtil.getI18nLabel(63071, ElogSeviceUtils.currentLanguage(), "路径定义")); + moduleMap.put("wfc", SalaryI18nUtil.getI18nLabel(63072, ElogSeviceUtils.currentLanguage(), "流程流转")); + moduleMap.put("wfr", SalaryI18nUtil.getI18nLabel(63073, ElogSeviceUtils.currentLanguage(), "流程规则路由")); + moduleMap.put("wrgm", SalaryI18nUtil.getI18nLabel(63074, ElogSeviceUtils.currentLanguage(), "目标管理")); + moduleMap.put("wrgp", SalaryI18nUtil.getI18nLabel(63075, ElogSeviceUtils.currentLanguage(), "绩效考核")); + moduleMap.put("wrpr", SalaryI18nUtil.getI18nLabel(63076, ElogSeviceUtils.currentLanguage(), "计划报告")); + moduleMap.put("doc", SalaryI18nUtil.getI18nLabel(63077, ElogSeviceUtils.currentLanguage(), "文档服务")); + moduleMap.put("placard", SalaryI18nUtil.getI18nLabel(63078, ElogSeviceUtils.currentLanguage(), "团队公告")); + moduleMap.put("fna", SalaryI18nUtil.getI18nLabel(135042, ElogSeviceUtils.currentLanguage(), "云报销")); + moduleMap.put("meeting", SalaryI18nUtil.getI18nLabel(63080, ElogSeviceUtils.currentLanguage(), "会议")); + moduleMap.put("wfp", SalaryI18nUtil.getI18nLabel(63081, ElogSeviceUtils.currentLanguage(), "流程")); + moduleMap.put("portal", SalaryI18nUtil.getI18nLabel(63045, ElogSeviceUtils.currentLanguage(), "门户")); + moduleMap.put("workreport", SalaryI18nUtil.getI18nLabel(63082, ElogSeviceUtils.currentLanguage(), "工作报告")); + moduleMap.put("goal", SalaryI18nUtil.getI18nLabel(63074, ElogSeviceUtils.currentLanguage(), "目标管理")); + moduleMap.put("performance", SalaryI18nUtil.getI18nLabel(63075, ElogSeviceUtils.currentLanguage(), "绩效考核")); + moduleMap.put("intlogin", SalaryI18nUtil.getI18nLabel(63083, ElogSeviceUtils.currentLanguage(), "集成登录设置")); + moduleMap.put("i18n", SalaryI18nUtil.getI18nLabel(64559, ElogSeviceUtils.currentLanguage(), "国际化")); + moduleMap.put("timecard", SalaryI18nUtil.getI18nLabel(63085, ElogSeviceUtils.currentLanguage(), "出勤")); + moduleMap.put("market", SalaryI18nUtil.getI18nLabel(63086, ElogSeviceUtils.currentLanguage(), "营销")); + moduleMap.put("excelformula", SalaryI18nUtil.getI18nLabel(64560, ElogSeviceUtils.currentLanguage(), "函数服务")); + moduleMap.put("ic_ldap", SalaryI18nUtil.getI18nLabel(70081, ElogSeviceUtils.currentLanguage(), "Ldap集成")); + moduleMap.put("iut_c_c", SalaryI18nUtil.getI18nLabel(70303, ElogSeviceUtils.currentLanguage(), "统一待办推送设置")); + moduleMap.put("plan", SalaryI18nUtil.getI18nLabel(70303, ElogSeviceUtils.currentLanguage(), "计划报告")); + moduleMap.put("document", SalaryI18nUtil.getI18nLabel(34218, ElogSeviceUtils.currentLanguage(), "文档")); + moduleMap.put("taskCustStatus", SalaryI18nUtil.getI18nLabel(73988, ElogSeviceUtils.currentLanguage(), "任务状态")); + moduleMap.put("project", SalaryI18nUtil.getI18nLabel(55158, ElogSeviceUtils.currentLanguage(), "项目")); + moduleMap.put("calendar", SalaryI18nUtil.getI18nLabel(74186, ElogSeviceUtils.currentLanguage(), "日历")); + moduleMap.put("web", SalaryI18nUtil.getI18nLabel(75598, ElogSeviceUtils.currentLanguage(), "浏览")); + moduleMap.put("formdatareport", SalaryI18nUtil.getI18nLabel(76068, ElogSeviceUtils.currentLanguage(), "来自上报数据")); + moduleMap.put("mainline", SalaryI18nUtil.getI18nLabel(31898, ElogSeviceUtils.currentLanguage(), "主线")); + moduleMap.put("customer", SalaryI18nUtil.getI18nLabel(32726, ElogSeviceUtils.currentLanguage(), "客户")); + moduleMap.put("contract", SalaryI18nUtil.getI18nLabel(32864, ElogSeviceUtils.currentLanguage(), "合同")); + moduleMap.put("group", SalaryI18nUtil.getI18nLabel(19426, ElogSeviceUtils.currentLanguage(), "分组")); + moduleMap.put("workflow", SalaryI18nUtil.getI18nLabel(81851, ElogSeviceUtils.currentLanguage(), "工作流程")); + moduleMap.put("biaoge", SalaryI18nUtil.getI18nLabel(30919, ElogSeviceUtils.currentLanguage(), "表格")); + moduleMap.put("clue", SalaryI18nUtil.getI18nLabel(28908, ElogSeviceUtils.currentLanguage(), "线索")); + moduleMap.put("competitor", SalaryI18nUtil.getI18nLabel(81852, ElogSeviceUtils.currentLanguage(), "竞争对手")); + moduleMap.put("kpiFlow", SalaryI18nUtil.getI18nLabel(81853, ElogSeviceUtils.currentLanguage(), "kpil流程")); + moduleMap.put("mainlineCustStatus", SalaryI18nUtil.getI18nLabel(81854, ElogSeviceUtils.currentLanguage(), "主线客户状态")); + moduleMap.put("marketactivity", SalaryI18nUtil.getI18nLabel(34221, ElogSeviceUtils.currentLanguage(), "市场活动")); + moduleMap.put("mtPhase", SalaryI18nUtil.getI18nLabel(81855, ElogSeviceUtils.currentLanguage(), "mt阶段")); + moduleMap.put("production", SalaryI18nUtil.getI18nLabel(29329, ElogSeviceUtils.currentLanguage(), "产品")); + moduleMap.put("quote", SalaryI18nUtil.getI18nLabel(34231, ElogSeviceUtils.currentLanguage(), "报价")); + moduleMap.put("saleChance", SalaryI18nUtil.getI18nLabel(32863, ElogSeviceUtils.currentLanguage(), "商机")); + moduleMap.put("orderform", SalaryI18nUtil.getI18nLabel(34230, ElogSeviceUtils.currentLanguage(), "订单")); + moduleMap.put("contact", SalaryI18nUtil.getI18nLabel(32711, ElogSeviceUtils.currentLanguage(), "联系人")); + moduleMap.put("price", SalaryI18nUtil.getI18nLabel(31922, ElogSeviceUtils.currentLanguage(), "价格")); + moduleMap.put("capital", SalaryI18nUtil.getI18nLabel(83428, ElogSeviceUtils.currentLanguage(), "资金")); + moduleMap.put("ice", SalaryI18nUtil.getI18nLabel(94360, ElogSeviceUtils.currentLanguage(), "日程会议集成")); + moduleMap.put("ic_hr", SalaryI18nUtil.getI18nLabel(84284, ElogSeviceUtils.currentLanguage(), "HR同步")); + moduleMap.put("intunifyauth", SalaryI18nUtil.getI18nLabel(84467, ElogSeviceUtils.currentLanguage(), "统一认证接入管理")); + moduleMap.put("signcenter", SalaryI18nUtil.getI18nLabel(84691, ElogSeviceUtils.currentLanguage(), "电子签")); + moduleMap.put("iut_s_c", SalaryI18nUtil.getI18nLabel(91503, ElogSeviceUtils.currentLanguage(), "统一待办-异构系统")); + moduleMap.put("iut_s_c1", SalaryI18nUtil.getI18nLabel(91503, ElogSeviceUtils.currentLanguage(), "统一待办-应用系统")); + moduleMap.put("iut_s_c2", SalaryI18nUtil.getI18nLabel(91503, ElogSeviceUtils.currentLanguage(), "统一待办中心")); + moduleMap.put("iut_s_c3", SalaryI18nUtil.getI18nLabel(91503, ElogSeviceUtils.currentLanguage(), "统一待办-应用系统-流程类型")); + moduleMap.put("ic_mail", SalaryI18nUtil.getI18nLabel(100715, ElogSeviceUtils.currentLanguage(), "邮箱集成")); + moduleMap.put("hrsa", SalaryI18nUtil.getI18nLabel(105038, ElogSeviceUtils.currentLanguage(), "薪酬管理")); + moduleMap.put("icc", SalaryI18nUtil.getI18nLabel(113884, ElogSeviceUtils.currentLanguage(), "转换规则")); + moduleMap.put("basicserver", SalaryI18nUtil.getI18nLabel(113885, ElogSeviceUtils.currentLanguage(), "整体基础")); + moduleMap.put("dw", SalaryI18nUtil.getI18nLabel(115549, ElogSeviceUtils.currentLanguage(), "数据仓库")); + moduleMap.put("msg", SalaryI18nUtil.getI18nLabel(115563, ElogSeviceUtils.currentLanguage(), "工作消息")); + moduleMap.put("intunifybase", SalaryI18nUtil.getI18nLabel(115599, ElogSeviceUtils.currentLanguage(), "统一认证服务")); + moduleMap.put("esearch", SalaryI18nUtil.getI18nLabel(21694, ElogSeviceUtils.currentLanguage(), "全文检索")); + moduleMap.put("iaauthserver", SalaryI18nUtil.getI18nLabel(115603, ElogSeviceUtils.currentLanguage(), "统一认证注册应用")); + moduleMap.put("excel", SalaryI18nUtil.getI18nLabel(115543, ElogSeviceUtils.currentLanguage(), "excel函数")); + moduleMap.put("scene", SalaryI18nUtil.getI18nLabel(115539, ElogSeviceUtils.currentLanguage(), "绘图")); + moduleMap.put("bcw", SalaryI18nUtil.getI18nLabel(115651, ElogSeviceUtils.currentLanguage(), "公共模块")); + moduleMap.put("folder", SalaryI18nUtil.getI18nLabel(10734, ElogSeviceUtils.currentLanguage(), "文件夹")); + moduleMap.put("pdfcnv", SalaryI18nUtil.getI18nLabel(115957, ElogSeviceUtils.currentLanguage(), "PDF转换服务")); + moduleMap.put("ebform", SalaryI18nUtil.getI18nLabel(121462, ElogSeviceUtils.currentLanguage(), "e-Builder表单")); + moduleMap.put("statistics", SalaryI18nUtil.getI18nLabel(17745, ElogSeviceUtils.currentLanguage(), "自定义统计")); + moduleMap.put("edcapp", SalaryI18nUtil.getI18nLabel(121631, ElogSeviceUtils.currentLanguage(), "多级填报")); + + */ + + moduleMap.put("elog", 62975); + moduleMap.put("report", 62976); + moduleMap.put("edc", 52689); + moduleMap.put("hrm", 62978); + moduleMap.put("crm", 62979); + moduleMap.put("demo", 62980); + moduleMap.put("attc", 62981); + moduleMap.put("attm", 62982); + moduleMap.put("attw", 62983); + moduleMap.put("auth", 62984); + moduleMap.put("bank", 62985); + moduleMap.put("bap", 62986); + moduleMap.put("base", 62987); + moduleMap.put("batc", 62988); + moduleMap.put("blog", 62989); + moduleMap.put("cld", 62990); + moduleMap.put("cmca", 62991); + moduleMap.put("cmcl", 62992); + moduleMap.put("cmco", 62993); + moduleMap.put("cmcp", 62994); + moduleMap.put("cmcu", 62995); + moduleMap.put("cmex", 62996); + moduleMap.put("cmmk", 62997); + moduleMap.put("cmor", 62998); + moduleMap.put("cmpc", 62999); + moduleMap.put("cmpr", 63000); + moduleMap.put("cmpt", 63001); + moduleMap.put("cmqu", 63002); + moduleMap.put("cmsa", 63003); + moduleMap.put("cmtr", 63004); + moduleMap.put("comp", 63005); + moduleMap.put("cs", 63006); + moduleMap.put("cowork", 63007); + moduleMap.put("dbs", 63008); + moduleMap.put("dcad", 63009); + moduleMap.put("dcap", 63010); + moduleMap.put("dcrd", 63011); + moduleMap.put("dcre", 63012); + moduleMap.put("dcs", 63013); + moduleMap.put("dds", 63014); + moduleMap.put("dps", 63015); + moduleMap.put("drle", 63016); + moduleMap.put("ds", 63017); + moduleMap.put("dw_etl", 63018); + moduleMap.put("dw_model", 63019); + moduleMap.put("dw_process", 63020); + moduleMap.put("dw_search", 63021); + moduleMap.put("dw_sync", 63022); + moduleMap.put("eb", 63023); + moduleMap.put("ebda", 62987); + moduleMap.put("ebdd", 63024); + moduleMap.put("ebdf", 63025); + moduleMap.put("ebdp", 63026); + moduleMap.put("ecod", 63027); + moduleMap.put("ei", 63028); + moduleMap.put("em", 63029); + moduleMap.put("es", 63030); + moduleMap.put("esa", 63031); + moduleMap.put("esb", 63032); + moduleMap.put("esch", 63033); + moduleMap.put("esd", 63034); + moduleMap.put("exfo", 63035); + moduleMap.put("fbdg", 63036); + moduleMap.put("fdt", 63037); + moduleMap.put("fexs", 63038); + moduleMap.put("file", 63039); + moduleMap.put("finc", 63040); + moduleMap.put("fnar", 63041); + moduleMap.put("fomo", 63042); + moduleMap.put("form", 63043); + moduleMap.put("frpt", 63043); + moduleMap.put("fvou", 63044); + moduleMap.put("hp", 63045); + moduleMap.put("hr", 63046); + moduleMap.put("ic", 63047); + moduleMap.put("il", 63048); + moduleMap.put("im", 63049); + moduleMap.put("inc", 63050); + moduleMap.put("iua", 63051); + moduleMap.put("iut", 63052); + moduleMap.put("mail", 63053); + moduleMap.put("mc", 63054); + moduleMap.put("mt", 63055); + moduleMap.put("my", 63056); + moduleMap.put("odoc", 63057); + moduleMap.put("odoc_exchange", 63058); + moduleMap.put("open", 63059); + moduleMap.put("pr", 63060); + moduleMap.put("proj", 63061); + moduleMap.put("prt", 63062); + moduleMap.put("pspt", 63063); + moduleMap.put("rptc", 63064); + moduleMap.put("rpts", 63065); + moduleMap.put("sala", 63066); + moduleMap.put("sign", 63067); + moduleMap.put("sms", 63068); + moduleMap.put("task", 63069); + moduleMap.put("tnt", 63070); + moduleMap.put("wf", 63071); + moduleMap.put("wfc", 63072); + moduleMap.put("wfr", 63073); + moduleMap.put("wrgm", 63074); + moduleMap.put("wrgp", 63075); + moduleMap.put("wrpr", 63076); + moduleMap.put("doc", 63077); + moduleMap.put("placard", 63078); + moduleMap.put("fna", 135042); + moduleMap.put("meeting", 63080); + moduleMap.put("wfp", 63081); + moduleMap.put("portal", 63045); + moduleMap.put("workreport", 63082); + moduleMap.put("goal", 63074); + moduleMap.put("performance", 63075); + moduleMap.put("intlogin", 63083); + moduleMap.put("i18n", 64559); + moduleMap.put("timecard", 63085); + moduleMap.put("market", 63086); + moduleMap.put("excelformula", 64560); + moduleMap.put("ebatch", 69280); + moduleMap.put("ic_ldap", 70081); + moduleMap.put("iut_c_c", 96493); + moduleMap.put("plan", 63076); + moduleMap.put("document", 34218); + moduleMap.put("taskCustStatus", 73988); + moduleMap.put("calendar", 74186); + moduleMap.put("batch", 69280); + moduleMap.put("project", 55158); + moduleMap.put("web", 75598); + moduleMap.put("formdatareport", 76068); + moduleMap.put("mainline", 31898); + moduleMap.put("customer", 32726); + moduleMap.put("contract", 32864); + moduleMap.put("group", 19426); + moduleMap.put("workflow", 81851); + moduleMap.put("biaoge", 30919); + moduleMap.put("clue", 28908); + moduleMap.put("competitor", 81852); + moduleMap.put("kpiFlow", 81853); + moduleMap.put("mainlineCustStatus", 81854); + moduleMap.put("marketactivity", 34221); + moduleMap.put("mtPhase", 81855); + moduleMap.put("production", 29329); + moduleMap.put("quote", 34231); + moduleMap.put("saleChance", 32863); + moduleMap.put("orderform", 34230); + moduleMap.put("contact", 32711); + moduleMap.put("price", 31922); + moduleMap.put("capital", 83428); + moduleMap.put("ice", 87722); + moduleMap.put("ic_hr", 84284); + moduleMap.put("intunifyauth", 84508); + moduleMap.put("signcenter", 84691); + moduleMap.put("iut_s_c", 91503); + moduleMap.put("iut_s_c1", 95218); + moduleMap.put("iut_s_c2", 95219); + moduleMap.put("iut_s_c3", 95220); + moduleMap.put("iut_c_log", 96494); + moduleMap.put("ic_mail", 100715); + moduleMap.put("hrsa", 105038); + moduleMap.put("icc", 113884); + moduleMap.put("basicserver", 113885); + moduleMap.put("dw", 115549); + moduleMap.put("msg", 115563); + moduleMap.put("intunifybase", 115599); + moduleMap.put("esearch", 21694); + moduleMap.put("iaauthserver", 115603); + moduleMap.put("excel", 115543); + moduleMap.put("scene", 115539); + moduleMap.put("bcw", 115651); + moduleMap.put("folder", 10734); + moduleMap.put("pdfcnv", 115957); + moduleMap.put("login", 63063); + moduleMap.put("ebform", 121462); + moduleMap.put("statistics", 17745); + moduleMap.put("edcapp", 121631); + moduleMap.put("cusapp", 16381); + moduleMap.put("e10-allinone-base", 141083); + moduleMap.put("voice", 142713); + moduleMap.put("filter", 147832); + moduleMap.put("ias", 146674); + moduleMap.put("device", 153666); + moduleMap.put("meetingTopic", 180274); + moduleMap.put("meetingService", 180276); + moduleMap.put("meetingDecision", 180277); + moduleMap.put("meetingSign", 180278); + moduleMap.put("meetingSignSet", 61601); + moduleMap.put("meetingMember", 180280); + moduleMap.put("meetingShare", 180281); + moduleMap.put("int", 40031); + moduleMap.put("print", 160051); + moduleMap.put("wcwIconUpdate", 182661); + moduleMap.put("wcwIconRelease", 183123); + moduleMap.put("wcwIconUse", 183124); + moduleMap.put("wcw", 29385); + moduleMap.put("component", 115651); + moduleMap.put("ic_exchange", 87722); + moduleMap.put("iut_c_c", 240048); + moduleMap.put("iut_c_set", 240049); + + Map elogMap = new HashMap<>(); + Map reportMap = new HashMap<>(); + Map edcMap = new HashMap<>(); + Map hrmMap = new HashMap<>(); + Map crmMap = new HashMap<>(); + Map demoMap = new HashMap<>(); + + moduleFuctionMap.put("elog", elogMap); + moduleFuctionMap.put("report", reportMap); + moduleFuctionMap.put("edc", edcMap); + moduleFuctionMap.put("hrm", hrmMap); + moduleFuctionMap.put("crm", crmMap); + moduleFuctionMap.put("demo", demoMap); + + + elogMap.put("operator", "日志操作"); + elogMap.put("reportcusinfo", "报表自定义"); + edcMap.put("dataset", "数据集合"); + + demoMap.put("reportcusinfo", "报表自定义字段"); + } + + /** + * 获取模块名称 + * + * @param module + * @return + */ + public static String getModuleName(String module) { // String modulename = ElogSeviceUtils.null2String(moduleMap.get(module), module); -// -// return ElogSeviceUtils.isLongValue(modulename) ? SystemEnv.getHtmlLabelName(ElogSeviceUtils.getLongValue(modulename),modulename) : modulename; -// } -// -// /** -// * 获取模块名称 -// * @param module -// * @return -// */ -// public static String getModuleNamePapi(String module) { +// return ElogSeviceUtils.isLongValue(modulename) ? SalaryI18nUtil.getI18nLabel(ElogSeviceUtils.getLongValue(modulename), modulename) : modulename; + return module; + } + + /** + * 获取模块名称 + * + * @param module + * @return + */ + public static String getModuleNamePapi(String module) { // String modulename = ElogSeviceUtils.null2String(moduleMap.get(module), module); -// -// return ElogSeviceUtils.isLongValue(modulename) ? SystemEnv.getHtmlLabelName(ElogSeviceUtils.getLongValue(modulename),modulename) : modulename; -// } -// -// -// /** -// * 获取方法名称 -// * @param module -// * @param function -// * @return -// */ -// public static String getFunctionName(String module, String function) { +// return ElogSeviceUtils.isLongValue(modulename) ? SalaryI18nUtil.getI18nLabel(ElogSeviceUtils.getLongValue(modulename), modulename) : modulename; + return module; + } + + + /** + * 获取方法名称 + * + * @param module + * @param function + * @return + */ + public static String getFunctionName(String module, String function) { // Map functionMap = moduleFuctionMap.get(module); // -// if(functionMap != null) -// function = ElogSeviceUtils.null2String(functionMap.get(function),function); +// if (functionMap != null) +// function = ElogSeviceUtils.null2String(functionMap.get(function), function); // -// return ElogSeviceUtils.isLongValue(function) ? SystemEnv.getHtmlLabelName(ElogSeviceUtils.getLongValue(function),function) : function; -// } -// -// public static void switchValues(List resultMap, List recordColumns) { -// -// switchValues(resultMap,recordColumns,false); -// -// } -// -// -// public static void switchValues(List list,List recordColumns, boolean islocal) { -//// if(!islocal) { -//// changKey2Lower(list); -//// } -// for(Map map : list) { -// Iterator> iterator = map.entrySet().iterator(); -// while (iterator.hasNext()) { -// Map.Entry next = iterator.next(); -// for (String recordColumn : recordColumns) { -// if (next.getKey().equals(recordColumn) && next.getValue() instanceof String) { -// map.put(next.getKey(), transfi18Method(next.getValue())); -// } -// } -// } -// map.put("modulenamespan", getModuleName(map.get("modulename"))); -// //map.put("functionnamespan", getFunctionName(map.get("modulename"), map.get("functionname"))); -// //switchDatabaseField(map); +// return ElogSeviceUtils.isLongValue(function) ? SalaryI18nUtil.getI18nLabel(ElogSeviceUtils.getLongValue(function), function) : function; + return function; + } + + public static void switchValues(List resultMap, List recordColumns) { + + switchValues(resultMap, recordColumns, false); + + } + + + public static void switchValues(List list, List recordColumns, boolean islocal) { +// if(!islocal) { +// changKey2Lower(list); // } -// -// } -// -// public static void switchDatabaseField(Map map) { -// map.put("date", map.get("log_date")); -// map.put("operator", map.get("log_operator")); -// map.put("result", map.get("log_result")); -// } -// -// /** -// * 转换数据成多语言 -// * @param lists -// */ -// public static List transfLanguageData(List lists) { -// if (lists != null && lists.size() > 0) { -// for (Map map : lists) { -// if (map != null) { -// Iterator> iterator = map.entrySet().iterator(); -// while (iterator.hasNext()) { -// Map.Entry 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())); -// }else{ -// map.put(entry.getKey(), entry.getValue()); -// } -// } -// } -// } -// } -// return lists; -// } -// -// public static String transfi18Method(String str) { -// if ("新增".equals(str)){ -// return transfLanguageLableid(63252l,str); -// } else if ("查看".equals(str)) { -// return transfLanguageLableid(55172l,str); -// }else if ("修改".equals(str)) { -// return transfLanguageLableid(63253l,str); -// }else if ("更新".equals(str)) { -// return transfLanguageLableid(29540l,str); -// }else if ("删除".equals(str)) { -// return transfLanguageLableid(63254l,str); -// }else if (StringUtils.isNumeric(str) && str.length()< 10) { -// return transfLanguageLableid(Long.parseLong(str),str); -// }else { -// return str; -// } -// } -// -// public static String transfLanguageLableid(Long lableid) { -// return SystemEnv.getHtmlLabelName(lableid, lableid.toString()); -// } -// -// /** -// * 转换多语言 -// * @param lableid -// * @param def -// * @return -// */ -// public static String transfLanguageLableid(Long lableid,String def) { -// return SystemEnv.getHtmlLabelName(lableid, def); -// } -// -// -// /** -// * 日志本地服务-更新明细转换 -// * -// * @param mainlist -// * @param list -// * @return -// */ -// public static Map switchChangeValue(List mainlist, List list) { -// Map res = new HashMap<>(); -// StringBuilder valuesChange = new StringBuilder(); -// List valuesChanges = new ArrayList<>(); -// String values = ""; -// String operatetypeName = ""; -// int oldCount = 0; -// int newCount = 0; -// String operatetype = ""; -// CaseInsensitiveMap map = null; -// if (list != null && list.size() > 0) { -// for (Map hashmap : list) { -// map = new CaseInsensitiveMap<>(hashmap); -// Object obj = map.get("operatetype"); -// if (obj != null) { -// operatetype = obj.toString(); -// } -// } -// } -// if (mainlist != null && mainlist.size() > 0) { -// for (Map hashMap : mainlist) { -// map = new CaseInsensitiveMap<>(hashMap); -// Object isdetail = map.get("isdetail"); -// if (isdetail != null) { -// if (StringUtils.isBlank(isdetail.toString())||!"0".equals(isdetail.toString())){ -// continue; -// } -// }else{ -// continue; -// } -// Object oldvalue = map.get("oldvalue"); -// if (oldvalue != null) { -// if (StringUtils.isNotBlank(oldvalue.toString())) { -// oldCount++; -// } -// } -// -// Object newvalue = map.get("newvalue"); -// if (newvalue != null) { -// if (StringUtils.isNotBlank(newvalue.toString())) { -// newCount++; -// } -// } -// -// } -// } -// CaseInsensitiveMap jo = null; -// for(int i = 0 ; i < mainlist.size(); i++) { -// Map jomap = mainlist.get(i); -// jo = new CaseInsensitiveMap<>(jomap); -// String fieldName = jo.get("fielddesc"); -// String oldvalue = obj2String(jo.get("oldvalue")); -// String oldrealvalue = obj2String(jo.get("oldrealvalue")); -// String newValue = obj2String(jo.get("newvalue")); -// String newrealvalue = obj2String(jo.get("newrealvalue")); -// // oracle.sql.CLOB类型处理 -// jomap.put("oldvalue", oldvalue); -// jomap.put("oldrealvalue", oldrealvalue); -// jomap.put("newvalue", newValue); -// jomap.put("newrealvalue", newrealvalue); -// -// String fieldNameLabelId = jo.get("fieldnamelabelid"); -// if (StringUtils.isNotBlank(fieldNameLabelId)&&StringUtils.isNumeric(fieldNameLabelId)) { -// fieldName = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(fieldNameLabelId),fieldName); -// } else if (StringUtils.isNotBlank(fieldNameLabelId)&&!StringUtils.isNumeric(fieldNameLabelId) && !"-1".equals(fieldNameLabelId)) { -// fieldName = fieldNameLabelId; -// } else if (StringUtils.isNotBlank(fieldName)&&StringUtils.isNumeric(fieldName)) { -// fieldName = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(fieldName),fieldName); -// } -// if (StringUtils.isNotBlank(oldrealvalue)&&StringUtils.isNumeric(oldrealvalue)) { -// oldvalue = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(oldrealvalue),oldvalue); -// }else if (StringUtils.isNotBlank(oldrealvalue)&&!StringUtils.isNumeric(oldrealvalue)) { -// oldvalue = oldrealvalue; -// } -// if (StringUtils.isNotBlank(newrealvalue)&&StringUtils.isNumeric(newrealvalue)) { -// newValue = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(newrealvalue),newValue); -// }else if (StringUtils.isNotBlank(newrealvalue)&&!StringUtils.isNumeric(newrealvalue)) { -// newValue = newrealvalue; -// } -// -// //oldvalue,newValue 避免xss漏洞 分别进行转义 + for (Map map : list) { + Iterator> iterator = map.entrySet().iterator(); + while (iterator.hasNext()) { + Map.Entry next = iterator.next(); + for (String recordColumn : recordColumns) { + if (next.getKey().equals(recordColumn) && next.getValue() instanceof String) { + map.put(next.getKey(), transfi18Method(next.getValue())); + } + } + } + map.put("modulenamespan", getModuleName(map.get("modulename"))); + //map.put("functionnamespan", getFunctionName(map.get("modulename"), map.get("functionname"))); + //switchDatabaseField(map); + } + + } + + public static void switchDatabaseField(Map map) { + map.put("date", map.get("log_date")); + map.put("operator", map.get("log_operator")); + map.put("result", map.get("log_result")); + } + + /** + * 转换数据成多语言 + * + * @param lists + */ + public static List transfLanguageData(List lists) { + if (lists != null && lists.size() > 0) { + for (Map map : lists) { + if (map != null) { + Iterator> iterator = map.entrySet().iterator(); + while (iterator.hasNext()) { + Map.Entry 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())); + } else { + map.put(entry.getKey(), entry.getValue()); + } + } + } + } + } + return lists; + } + + public static String transfi18Method(String str) { + if ("新增".equals(str)) { + return transfLanguageLableid(63252l, str); + } else if ("查看".equals(str)) { + return transfLanguageLableid(55172l, str); + } else if ("修改".equals(str)) { + return transfLanguageLableid(63253l, str); + } else if ("更新".equals(str)) { + return transfLanguageLableid(29540l, str); + } else if ("删除".equals(str)) { + return transfLanguageLableid(63254l, str); + } else if (StringUtils.isNumeric(str) && str.length() < 10) { + return transfLanguageLableid(Long.parseLong(str), str); + } else { + return str; + } + } + + public static String transfLanguageLableid(Long lableid) { + return SalaryI18nUtil.getI18nLabel(Integer.parseInt(lableid.toString()), lableid.toString()); + } + + /** + * 转换多语言 + * + * @param lableid + * @param def + * @return + */ + public static String transfLanguageLableid(Long lableid, String def) { + return SalaryI18nUtil.getI18nLabel(Integer.parseInt(lableid.toString()), def); + } + + + /** + * 日志本地服务-更新明细转换 + * + * @param mainlist + * @param list + * @return + */ + public static Map switchChangeValue(List mainlist, List list) { + Map res = new HashMap<>(); + StringBuilder valuesChange = new StringBuilder(); + List valuesChanges = new ArrayList<>(); + String values = ""; + String operatetypeName = ""; + int oldCount = 0; + int newCount = 0; + String operatetype = ""; + CaseInsensitiveMap map = null; + if (list != null && list.size() > 0) { + for (Map hashmap : list) { + map = new CaseInsensitiveMap<>(hashmap); + Object obj = map.get("operatetype"); + if (obj != null) { + operatetype = obj.toString(); + } + } + } + if (mainlist != null && mainlist.size() > 0) { + for (Map hashMap : mainlist) { + map = new CaseInsensitiveMap<>(hashMap); + Object isdetail = map.get("isdetail"); + if (isdetail != null) { + if (StringUtils.isBlank(isdetail.toString()) || !"0".equals(isdetail.toString())) { + continue; + } + } else { + continue; + } + Object oldvalue = map.get("oldvalue"); + if (oldvalue != null) { + if (StringUtils.isNotBlank(oldvalue.toString())) { + oldCount++; + } + } + + Object newvalue = map.get("newvalue"); + if (newvalue != null) { + if (StringUtils.isNotBlank(newvalue.toString())) { + newCount++; + } + } + + } + } + CaseInsensitiveMap jo = null; + for (int i = 0; i < mainlist.size(); i++) { + Map jomap = mainlist.get(i); + jo = new CaseInsensitiveMap<>(jomap); + String fieldName = jo.get("fielddesc"); + String oldvalue = obj2String(jo.get("oldvalue")); + String oldrealvalue = obj2String(jo.get("oldrealvalue")); + String newValue = obj2String(jo.get("newvalue")); + String newrealvalue = obj2String(jo.get("newrealvalue")); + // oracle.sql.CLOB类型处理 + jomap.put("oldvalue", oldvalue); + jomap.put("oldrealvalue", oldrealvalue); + jomap.put("newvalue", newValue); + jomap.put("newrealvalue", newrealvalue); + + String fieldNameLabelId = jo.get("fieldnamelabelid"); + if (StringUtils.isNotBlank(fieldNameLabelId) && StringUtils.isNumeric(fieldNameLabelId)) { + fieldName = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(fieldNameLabelId), fieldName); + } else if (StringUtils.isNotBlank(fieldNameLabelId) && !StringUtils.isNumeric(fieldNameLabelId) && !"-1".equals(fieldNameLabelId)) { + fieldName = fieldNameLabelId; + } else if (StringUtils.isNotBlank(fieldName) && StringUtils.isNumeric(fieldName)) { + fieldName = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(fieldName), fieldName); + } + if (StringUtils.isNotBlank(oldrealvalue) && StringUtils.isNumeric(oldrealvalue)) { + oldvalue = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(oldrealvalue), oldvalue); + } else if (StringUtils.isNotBlank(oldrealvalue) && !StringUtils.isNumeric(oldrealvalue)) { + oldvalue = oldrealvalue; + } + if (StringUtils.isNotBlank(newrealvalue) && StringUtils.isNumeric(newrealvalue)) { + newValue = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(newrealvalue), newValue); + } else if (StringUtils.isNotBlank(newrealvalue) && !StringUtils.isNumeric(newrealvalue)) { + newValue = newrealvalue; + } + + //oldvalue,newValue 避免xss漏洞 分别进行转义 // oldvalue = StringConversionForXSS(oldvalue); // newValue = StringConversionForXSS(newValue); -// -// if (oldCount != 0) { -// valuesChanges.add(String.format(valueChangeFormat(), fieldName, oldvalue, newValue)); -// -// } else if (oldCount == 0 || newCount==0 || operatetype.startsWith(OperateType.add)||operatetype.startsWith(OperateType.delete)) { -// valuesChanges.add(String.format(valueChangeNewFormat(), fieldName, newValue)); -// -// } else { -// valuesChanges.add(String.format(valueChangeFormat(), fieldName, oldvalue, newValue)); -// } -// //} -// /*if (valuesChange.length() > 3) { -// values = valuesChange.substring(0, valuesChange.length() - 3); -// }*/ -// } -// -// res.put("valueschanges", valuesChanges); -// res.put("detailcontexts", mainlist); -// return res; -// } -// -// private static String obj2String(Object o) { -// if (o == null) { -// return ""; -// } -// if (o instanceof String) { -// return (String) o; -// } -// return JSON.toJSONString(o); -// } -// -// /** -// * 服务中心结果集转换 -// */ -// public static void switchChangeValues(List list) { -// CaseInsensitiveMap map = null; -// for(Map hashMap : list) { -// map = new CaseInsensitiveMap<>(hashMap); -// int count = 0; -// StringBuilder valuesChange = new StringBuilder(); -// List valuesChanges = new ArrayList(); -// Object detailContexts = map.get("detailcontexts"); -// if(detailContexts != null) { -// JSONArray jsonArray = JSONArray.parseArray(JSON.toJSONString(detailContexts)); -// for(int i = 0 ; i < jsonArray.size(); i++) { -// JSONObject jo = jsonArray.getJSONObject(i); -// String isDetail = jo.getString("isDetail"); -// if (StringUtils.isBlank(isDetail)||!"0".equals(isDetail)){ -// continue; -// } -// String oldvalue = jo.getString("oldValue"); -// if (StringUtils.isNotBlank(oldvalue)) { -// count++; -// } -// } -// } -// -// if(detailContexts != null) { -// JSONArray jsonArray = JSONArray.parseArray(JSON.toJSONString(detailContexts)); -// for(int i = 0 ; i < jsonArray.size(); i++) { -// JSONObject jo = jsonArray.getJSONObject(i); -// String isDetail = jo.getString("isDetail"); -// if (StringUtils.isBlank(isDetail)||!"0".equals(isDetail)){ -// continue; -// } -// String fieldName = jo.getString("fieldDesc"); -// String oldvalue = jo.getString("oldValue"); -// String oldrealvalue = jo.getString("oldRealValue"); -// String newValue = jo.getString("newValue"); -// String newrealvalue = jo.getString("newRealValue"); -// String fieldNameLabelId = jo.getString("fieldNameLabelId"); -// if (StringUtils.isNotBlank(fieldNameLabelId)&&StringUtils.isNumeric(fieldNameLabelId)) { -// fieldName = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(fieldNameLabelId)); -// } -// if (StringUtils.isNotBlank(oldrealvalue)&&StringUtils.isNumeric(oldrealvalue)) { -// oldvalue = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(oldrealvalue)); -// } -// if (StringUtils.isNotBlank(newrealvalue)&&StringUtils.isNumeric(newrealvalue)) { -// newValue = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(newrealvalue)); -// } -// if (count == 0) { -// valuesChanges.add(String.format(valueChangeNewFormat(), fieldName, newValue)); -// } else { -// valuesChanges.add(String.format(valueChangeFormat(), fieldName, oldvalue, newValue)); -// } -// -// } -// /*String values = ""; -// if (valuesChange.length() > 3) { -// values = valuesChange.substring(0, valuesChange.length() - 3); -// }*/ -// -// map.put("valueschanges", valuesChanges); -// } -// -// } -// } -// -// public static String valueChangeNewFormat(){ -// return "【%s】:%s"; -// } -// public static String valueChangeFormat(){ -// return "【%s】:"+SystemEnv.getHtmlLabelName(61695,"由")+ -// "[%s] "+SystemEnv.getHtmlLabelName(61697,"改为")+" [%s]"; -// } -// -// public static void changKey2Lower(List list) { -// -// List newList = new ArrayList<>(); -// for(Map orgMap : list) { -// Map resultMap = new HashMap<>(); -// -// if (orgMap == null || orgMap.isEmpty()) { -// newList.add(resultMap); -// continue; -// } -// -// Set keySet = orgMap.keySet(); -// for (String key : keySet) { -// resultMap.put(key != null ? key.toLowerCase() : "", orgMap.get(key)); -// } -// newList.add(resultMap); -// } -// list.clear(); -// list.addAll(newList); -// } -// -// /** -// * 查看详细表的数据 -// * @param list -// */ -// public static Map switchDetailChangeValue(List list) { -// Map res = new HashMap<>(); -// List> lists = new ArrayList<>(); -// HashMap repeatTableName = new HashMap<>(); -// CaseInsensitiveMap map = null; -// for (Map hashMap : list) { -// map = new CaseInsensitiveMap<>(hashMap); -// List detailmap = new ArrayList<>(); -// HashMap detailoldMap= new HashMap<>(); -// detailoldMap.put("operator",SystemEnv.getHtmlLabelName(63248,"操作(旧)")); -// detailoldMap.put("dataid",map.get("dataid")); -// HashMap detailnewMap= new HashMap<>(); -// detailnewMap.put("operator",SystemEnv.getHtmlLabelName(63249,"操作(新)")); -// detailnewMap.put("dataid",map.get("dataid")); -// detailmap.add(detailoldMap); -// detailmap.add(detailnewMap); -// WeaTable wea = new WeaTable(); -// wea.getColumns().add(new WeaTableColumn(SystemEnv.getHtmlLabelName(63250,"操作"), "operator", "5%")); + + if (oldCount != 0) { + valuesChanges.add(String.format(valueChangeFormat(), fieldName, oldvalue, newValue)); + + } else if (oldCount == 0 || newCount == 0 || operatetype.startsWith(OperateType.add) || operatetype.startsWith(OperateType.delete)) { + valuesChanges.add(String.format(valueChangeNewFormat(), fieldName, newValue)); + + } else { + valuesChanges.add(String.format(valueChangeFormat(), fieldName, oldvalue, newValue)); + } + //} + /*if (valuesChange.length() > 3) { + values = valuesChange.substring(0, valuesChange.length() - 3); + }*/ + } + + res.put("valueschanges", valuesChanges); + res.put("detailcontexts", mainlist); + return res; + } + + private static String obj2String(Object o) { + if (o == null) { + return ""; + } + if (o instanceof String) { + return (String) o; + } + return JSON.toJSONString(o); + } + + /** + * 服务中心结果集转换 + */ + public static void switchChangeValues(List list) { + CaseInsensitiveMap map = null; + for (Map hashMap : list) { + map = new CaseInsensitiveMap<>(hashMap); + int count = 0; + StringBuilder valuesChange = new StringBuilder(); + List valuesChanges = new ArrayList(); + Object detailContexts = map.get("detailcontexts"); + if (detailContexts != null) { + JSONArray jsonArray = JSONArray.parseArray(JSON.toJSONString(detailContexts)); + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject jo = jsonArray.getJSONObject(i); + String isDetail = jo.getString("isDetail"); + if (StringUtils.isBlank(isDetail) || !"0".equals(isDetail)) { + continue; + } + String oldvalue = jo.getString("oldValue"); + if (StringUtils.isNotBlank(oldvalue)) { + count++; + } + } + } + + if (detailContexts != null) { + JSONArray jsonArray = JSONArray.parseArray(JSON.toJSONString(detailContexts)); + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject jo = jsonArray.getJSONObject(i); + String isDetail = jo.getString("isDetail"); + if (StringUtils.isBlank(isDetail) || !"0".equals(isDetail)) { + continue; + } + String fieldName = jo.getString("fieldDesc"); + String oldvalue = jo.getString("oldValue"); + String oldrealvalue = jo.getString("oldRealValue"); + String newValue = jo.getString("newValue"); + String newrealvalue = jo.getString("newRealValue"); + String fieldNameLabelId = jo.getString("fieldNameLabelId"); + if (StringUtils.isNotBlank(fieldNameLabelId) && StringUtils.isNumeric(fieldNameLabelId)) { + fieldName = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(fieldNameLabelId)); + } + if (StringUtils.isNotBlank(oldrealvalue) && StringUtils.isNumeric(oldrealvalue)) { + oldvalue = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(oldrealvalue)); + } + if (StringUtils.isNotBlank(newrealvalue) && StringUtils.isNumeric(newrealvalue)) { + newValue = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(newrealvalue)); + } + if (count == 0) { + valuesChanges.add(String.format(valueChangeNewFormat(), fieldName, newValue)); + } else { + valuesChanges.add(String.format(valueChangeFormat(), fieldName, oldvalue, newValue)); + } + + } + /*String values = ""; + if (valuesChange.length() > 3) { + values = valuesChange.substring(0, valuesChange.length() - 3); + }*/ + + map.put("valueschanges", valuesChanges); + } + + } + } + + public static String valueChangeNewFormat() { + return "【%s】:%s"; + } + + public static String valueChangeFormat() { + return "【%s】:" + SalaryI18nUtil.getI18nLabel(61695, "由") + + "[%s] " + SalaryI18nUtil.getI18nLabel(61697, "改为") + " [%s]"; + } + + public static void changKey2Lower(List list) { + + List newList = new ArrayList<>(); + for (Map orgMap : list) { + Map resultMap = new HashMap<>(); + + if (orgMap == null || orgMap.isEmpty()) { + newList.add(resultMap); + continue; + } + + Set keySet = orgMap.keySet(); + for (String key : keySet) { + resultMap.put(key != null ? key.toLowerCase() : "", orgMap.get(key)); + } + newList.add(resultMap); + } + list.clear(); + list.addAll(newList); + } + + /** + * 查看详细表的数据 + * + * @param list + */ + public static Map switchDetailChangeValue(List list) { + Map res = new HashMap<>(); + List> lists = new ArrayList<>(); + HashMap repeatTableName = new HashMap<>(); + CaseInsensitiveMap map = null; + for (Map hashMap : list) { + map = new CaseInsensitiveMap<>(hashMap); + List detailmap = new ArrayList<>(); + HashMap detailoldMap = new HashMap<>(); + detailoldMap.put("operator", SalaryI18nUtil.getI18nLabel(63248, "操作(旧)")); + detailoldMap.put("dataid", map.get("dataid")); + HashMap detailnewMap = new HashMap<>(); + detailnewMap.put("operator", SalaryI18nUtil.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("dataid", "dataid", true)); -// Object tablename = map.get("tablename"); -// Object tablenamelabelid = map.get("tablenamelabelid"); -// if (tablenamelabelid != null) { -// if (StringUtils.isNotBlank(tablenamelabelid.toString())&&StringUtils.isNumeric(tablenamelabelid.toString())) { -// tablename = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(tablenamelabelid.toString())); -// } -// } -// Map m = new HashMap<>(); -// if (tablename!=null&&StringUtils.isNotBlank(tablename.toString())) { -// String temptablename = repeatTableName.get(tablename.toString()); -// if (tablename.toString().equals(temptablename)) { -// continue; -// } -// repeatTableName.put(tablename.toString(), tablename.toString()); -// m.put("tablename", tablename.toString()); -// m.put("detailmap", detailmap); -// m.put("column", wea); -// lists.add(m); -// } else { -// tablename = tablename!=null?tablename:""; -// String temptablename = repeatTableName.get(tablename.toString()); -// if (tablename.toString().equals(temptablename)) { -// continue; -// } -// repeatTableName.put(tablename.toString(), tablename.toString()); -// m.put("tablename", ""); -// m.put("detailmap", detailmap); -// m.put("column", wea); -// lists.add(m); -// } -// } -// -// for (Map hashMap : list) { -// map = new CaseInsensitiveMap<>(hashMap); -// Object isDetail = map.get("isdetail"); -// if (isDetail != null) { -// if ("0".equals(isDetail.toString())) { -// continue; -// } -// } else { -// continue; -// } -// String title = ""; -// String dataIndex = ""; -// String oldValue = ""; -// String newValue = ""; -// String tableName = ""; -// String dataId = ""; -// -// Object fieldDesc = map.get("fielddesc"); -// if (fieldDesc != null) { -// if (StringUtils.isNotBlank(fieldDesc.toString())) { -// title = fieldDesc.toString(); -// } -// } -// -// Object fieldnamelabelid = map.get("fieldnamelabelid"); -// if (fieldnamelabelid != null) { -// if (StringUtils.isNotBlank(fieldnamelabelid.toString())&&StringUtils.isNumeric(fieldnamelabelid.toString())) { -// title = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(fieldnamelabelid.toString())); -// } -// } -// -// Object fieldName = map.get("fieldname"); -// if (fieldName != null) { -// if (StringUtils.isNotBlank(fieldName.toString())) { -// dataIndex = fieldName.toString(); -// } -// } -// Object oValue = map.get("oldvalue"); -// if (oValue != null) { -// if (StringUtils.isNotBlank(oValue.toString())) { -// oldValue = oValue.toString(); -// } -// } -// Object nValue = map.get("newvalue"); -// if (nValue != null) { -// if (StringUtils.isNotBlank(nValue.toString())) { -// newValue = nValue.toString(); -// } -// } -// Object oldRealValue = map.get("oldrealvalue"); -// if (oldRealValue != null) { -// if (StringUtils.isNotBlank(oldRealValue.toString())&&StringUtils.isNumeric(oldRealValue.toString())) { -// oldValue = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(oldRealValue.toString())); -// } -// } -// -// Object newrealvalue = map.get("newrealvalue"); -// if (newrealvalue != null) { -// if (StringUtils.isNotBlank(newrealvalue.toString())&&StringUtils.isNumeric(newrealvalue.toString())) { -// newValue = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(newrealvalue.toString())); -// } -// } -// -// Object tablename = map.get("tablename"); -// if (StringUtils.isNotBlank(tablename.toString())) { -// tableName = tablename.toString(); -// } else { -// tableName = ""; -// } -// Object tablenamelabelid = map.get("tablenamelabelid"); -// if (tablenamelabelid != null) { -// if (tablenamelabelid != null) { -// if (StringUtils.isNotBlank(tablenamelabelid.toString())&&StringUtils.isNumeric(tablenamelabelid.toString())) { -// tableName = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(tablenamelabelid.toString())); -// } -// } -// } -// Object dataid = map.get("dataid"); -// if (StringUtils.isNotBlank(dataid.toString())) { -// dataId = dataid.toString(); -// } else { -// dataId = ""; -// } -// for (Map m : lists) { -// Object o = m.get("tablename"); -// if (o != null) { -// if (tableName.equals(o)) { -// List details = (List) m.get("detailmap"); -// List newDetails = new ArrayList<>(); -// if (details != null && details.size() > 0) { -// for (Map detail : details) { -// Object data_id = detail.get("dataid"); -// if (data_id != null) { -// if (dataId.equals(data_id)) { -// Object operator = detail.get("operator"); -// if (operator != null) { -// if (SystemEnv.getHtmlLabelName(63248, "操作(旧)").equals(operator.toString())) { -// detail.put(dataIndex, oldValue); -// } else if (SystemEnv.getHtmlLabelName(63249, "操作(新)").equals(operator.toString())) { -// detail.put(dataIndex, newValue); -// } -// } -// }else{ -// if (newDetails.size() > 2) { -// for (Map newDetail : newDetails) { -// if (dataId.equals(newDetail.get("dataid"))) { -// Object operator = detail.get("operator"); -// if (operator != null) { -// if (SystemEnv.getHtmlLabelName(63248, "操作(旧)").equals(operator.toString())) { -// detail.put(dataIndex, oldValue); -// } else if (SystemEnv.getHtmlLabelName(63249, "操作(新)").equals(operator.toString())) { -// detail.put(dataIndex, newValue); -// } -// } -// }else{ -// HashMap detailoldMap= new HashMap<>(); -// detailoldMap.put("operator",SystemEnv.getHtmlLabelName(63248,"操作(旧)")); -// detailoldMap.put("dataid",map.get("dataid")); -// detailoldMap.put(dataIndex, oldValue); -// HashMap detailnewMap= new HashMap<>(); -// detailnewMap.put("operator",SystemEnv.getHtmlLabelName(63249,"操作(新)")); -// detailnewMap.put("dataid",map.get("dataid")); -// detailnewMap.put(dataIndex, newValue); -// newDetails.add(detailoldMap); -// newDetails.add(detailnewMap); -// } -// } -// }else if (newDetails.size() == 0) { -// int count = 0; -// for (Map mapdetail : details) { -// Object dataid_ = mapdetail.get("dataid"); -// if (dataid_ != null && dataid_.equals(dataId)) { -// count++; -// } -// } -// if (count == 0) { -// HashMap detailoldMap= new HashMap<>(); -// detailoldMap.put("operator",SystemEnv.getHtmlLabelName(63248,"操作(旧)")); -// detailoldMap.put("dataid",map.get("dataid")); -// detailoldMap.put(dataIndex, oldValue); -// HashMap detailnewMap= new HashMap<>(); -// detailnewMap.put("operator",SystemEnv.getHtmlLabelName(63249,"操作(新)")); -// detailnewMap.put("dataid",map.get("dataid")); -// detailnewMap.put(dataIndex, newValue); -// newDetails.add(detailoldMap); -// newDetails.add(detailnewMap); -// } -// } -// } -// } -// } -// } -// if (newDetails.size() > 0) { -// details.addAll(newDetails); -// newDetails.clear(); -// } -// -// WeaTable column = (WeaTable) m.get("column"); -// if (column != null) { -// List columns = column.getColumns(); -// if (columns != null && columns.size() > 0) { -// Boolean flag = true; -// for (Object object : columns) { -// WeaTableColumn weaTableColumn = JSONObject.parseObject(JSON.toJSONString(object), WeaTableColumn.class); -// if (weaTableColumn != null) { -// String title1 = weaTableColumn.getTitle(); -// if (title.equals(title1)) { -// flag = false; -// break; -// } -// } -// } -// if (flag) { -// column.getColumns().add(new WeaTableColumn(title, dataIndex, "5%")); -// m.put("column", column); -// } -// } -// } -// } -// } -// } -// } -// res.put("detail", lists); -// return res; -// } -// -// -// public static void switchDetailChangeValues(List list) { -// for (Map map : list) { -// Map repeatTableName = new HashMap<>(); -// List detailContexts = (List) map.get("detailcontexts"); -// List lists = new ArrayList<>(); -// if (detailContexts != null) { -// for (Map detailContext : detailContexts) { -// List detailmap = new ArrayList<>(); -// HashMap detailoldMap = new HashMap<>(); -// detailoldMap.put("operator", SystemEnv.getHtmlLabelName(63248,"操作(旧)")); -// detailoldMap.put("dataid",detailContext.get("dataid")); -// HashMap detailnewMap = new HashMap<>(); -// detailnewMap.put("operator", SystemEnv.getHtmlLabelName(63249,"操作(新)")); -// detailnewMap.put("dataid",detailContext.get("dataid")); -// detailmap.add(detailoldMap); -// detailmap.add(detailnewMap); -// WeaTable wea = new WeaTable(); -// wea.getColumns().add(new WeaTableColumn(SystemEnv.getHtmlLabelName(63250,"操作"), "operator", "5%")); + Object tablename = map.get("tablename"); + Object tablenamelabelid = map.get("tablenamelabelid"); + if (tablenamelabelid != null) { + if (StringUtils.isNotBlank(tablenamelabelid.toString()) && StringUtils.isNumeric(tablenamelabelid.toString())) { + tablename = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(tablenamelabelid.toString())); + } + } + Map m = new HashMap<>(); + if (tablename != null && StringUtils.isNotBlank(tablename.toString())) { + String temptablename = repeatTableName.get(tablename.toString()); + if (tablename.toString().equals(temptablename)) { + continue; + } + repeatTableName.put(tablename.toString(), tablename.toString()); + m.put("tablename", tablename.toString()); + m.put("detailmap", detailmap); + m.put("column", wea); + lists.add(m); + } else { + tablename = tablename != null ? tablename : ""; + String temptablename = repeatTableName.get(tablename.toString()); + if (tablename.toString().equals(temptablename)) { + continue; + } + repeatTableName.put(tablename.toString(), tablename.toString()); + m.put("tablename", ""); + m.put("detailmap", detailmap); + m.put("column", wea); + lists.add(m); + } + } + + for (Map hashMap : list) { + map = new CaseInsensitiveMap<>(hashMap); + Object isDetail = map.get("isdetail"); + if (isDetail != null) { + if ("0".equals(isDetail.toString())) { + continue; + } + } else { + continue; + } + String title = ""; + String dataIndex = ""; + String oldValue = ""; + String newValue = ""; + String tableName = ""; + String dataId = ""; + + Object fieldDesc = map.get("fielddesc"); + if (fieldDesc != null) { + if (StringUtils.isNotBlank(fieldDesc.toString())) { + title = fieldDesc.toString(); + } + } + + Object fieldnamelabelid = map.get("fieldnamelabelid"); + if (fieldnamelabelid != null) { + if (StringUtils.isNotBlank(fieldnamelabelid.toString()) && StringUtils.isNumeric(fieldnamelabelid.toString())) { + title = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(fieldnamelabelid.toString())); + } + } + + Object fieldName = map.get("fieldname"); + if (fieldName != null) { + if (StringUtils.isNotBlank(fieldName.toString())) { + dataIndex = fieldName.toString(); + } + } + Object oValue = map.get("oldvalue"); + if (oValue != null) { + if (StringUtils.isNotBlank(oValue.toString())) { + oldValue = oValue.toString(); + } + } + Object nValue = map.get("newvalue"); + if (nValue != null) { + if (StringUtils.isNotBlank(nValue.toString())) { + newValue = nValue.toString(); + } + } + Object oldRealValue = map.get("oldrealvalue"); + if (oldRealValue != null) { + if (StringUtils.isNotBlank(oldRealValue.toString()) && StringUtils.isNumeric(oldRealValue.toString())) { + oldValue = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(oldRealValue.toString())); + } + } + + Object newrealvalue = map.get("newrealvalue"); + if (newrealvalue != null) { + if (StringUtils.isNotBlank(newrealvalue.toString()) && StringUtils.isNumeric(newrealvalue.toString())) { + newValue = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(newrealvalue.toString())); + } + } + + Object tablename = map.get("tablename"); + if (StringUtils.isNotBlank(tablename.toString())) { + tableName = tablename.toString(); + } else { + tableName = ""; + } + Object tablenamelabelid = map.get("tablenamelabelid"); + if (tablenamelabelid != null) { + if (tablenamelabelid != null) { + if (StringUtils.isNotBlank(tablenamelabelid.toString()) && StringUtils.isNumeric(tablenamelabelid.toString())) { + tableName = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(tablenamelabelid.toString())); + } + } + } + Object dataid = map.get("dataid"); + if (StringUtils.isNotBlank(dataid.toString())) { + dataId = dataid.toString(); + } else { + dataId = ""; + } + for (Map m : lists) { + Object o = m.get("tablename"); + if (o != null) { + if (tableName.equals(o)) { + List details = (List) m.get("detailmap"); + List newDetails = new ArrayList<>(); + if (details != null && details.size() > 0) { + for (Map detail : details) { + Object data_id = detail.get("dataid"); + if (data_id != null) { + if (dataId.equals(data_id)) { + Object operator = detail.get("operator"); + if (operator != null) { + if (SalaryI18nUtil.getI18nLabel(63248, "操作(旧)").equals(operator.toString())) { + detail.put(dataIndex, oldValue); + } else if (SalaryI18nUtil.getI18nLabel(63249, "操作(新)").equals(operator.toString())) { + detail.put(dataIndex, newValue); + } + } + } else { + if (newDetails.size() > 2) { + for (Map newDetail : newDetails) { + if (dataId.equals(newDetail.get("dataid"))) { + Object operator = detail.get("operator"); + if (operator != null) { + if (SalaryI18nUtil.getI18nLabel(63248, "操作(旧)").equals(operator.toString())) { + detail.put(dataIndex, oldValue); + } else if (SalaryI18nUtil.getI18nLabel(63249, "操作(新)").equals(operator.toString())) { + detail.put(dataIndex, newValue); + } + } + } else { + HashMap detailoldMap = new HashMap<>(); + detailoldMap.put("operator", SalaryI18nUtil.getI18nLabel(63248, "操作(旧)")); + detailoldMap.put("dataid", map.get("dataid")); + detailoldMap.put(dataIndex, oldValue); + HashMap detailnewMap = new HashMap<>(); + detailnewMap.put("operator", SalaryI18nUtil.getI18nLabel(63249, "操作(新)")); + detailnewMap.put("dataid", map.get("dataid")); + detailnewMap.put(dataIndex, newValue); + newDetails.add(detailoldMap); + newDetails.add(detailnewMap); + } + } + } else if (newDetails.size() == 0) { + int count = 0; + for (Map mapdetail : details) { + Object dataid_ = mapdetail.get("dataid"); + if (dataid_ != null && dataid_.equals(dataId)) { + count++; + } + } + if (count == 0) { + HashMap detailoldMap = new HashMap<>(); + detailoldMap.put("operator", SalaryI18nUtil.getI18nLabel(63248, "操作(旧)")); + detailoldMap.put("dataid", map.get("dataid")); + detailoldMap.put(dataIndex, oldValue); + HashMap detailnewMap = new HashMap<>(); + detailnewMap.put("operator", SalaryI18nUtil.getI18nLabel(63249, "操作(新)")); + detailnewMap.put("dataid", map.get("dataid")); + detailnewMap.put(dataIndex, newValue); + newDetails.add(detailoldMap); + newDetails.add(detailnewMap); + } + } + } + } + } + } + if (newDetails.size() > 0) { + details.addAll(newDetails); + newDetails.clear(); + } + + WeaTable column = (WeaTable) m.get("column"); + if (column != null) { + List columns = column.getColumns(); + if (columns != null && columns.size() > 0) { + Boolean flag = true; + for (Object object : columns) { + WeaTableColumn weaTableColumn = JSONObject.parseObject(JSON.toJSONString(object), WeaTableColumn.class); + if (weaTableColumn != null) { + String title1 = weaTableColumn.getText(); + if (title.equals(title1)) { + flag = false; + break; + } + } + } + if (flag) { + column.getColumns().add(new WeaTableColumn(title, dataIndex, "5%")); + m.put("column", column); + } + } + } + } + } + } + } + res.put("detail", lists); + return res; + } + + + public static void switchDetailChangeValues(List list) { + for (Map map : list) { + Map repeatTableName = new HashMap<>(); + List detailContexts = (List) map.get("detailcontexts"); + List lists = new ArrayList<>(); + if (detailContexts != null) { + for (Map detailContext : detailContexts) { + List detailmap = new ArrayList<>(); + HashMap detailoldMap = new HashMap<>(); + detailoldMap.put("operator", SalaryI18nUtil.getI18nLabel(63248, "操作(旧)")); + detailoldMap.put("dataid", detailContext.get("dataid")); + HashMap detailnewMap = new HashMap<>(); + detailnewMap.put("operator", SalaryI18nUtil.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("dataid", "dataid", true)); -// Object tableName = detailContext.get("tableName"); -// Object tablenamelabelid = detailContext.get("tableNameLabelId"); -// if (tablenamelabelid != null) { -// if (StringUtils.isNotBlank(tablenamelabelid.toString())&&StringUtils.isNumeric(tablenamelabelid.toString())) { -// tableName = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(tablenamelabelid.toString())); -// } -// } -// Map m = new HashMap<>(); -// if (StringUtils.isNotBlank(tableName.toString())) { -// String temptablename = repeatTableName.get(tableName.toString()); -// if (tableName.toString().equals(temptablename)) { -// continue; -// } -// repeatTableName.put(tableName.toString(), tableName.toString()); -// m.put("tablename", tableName.toString()); -// m.put("detailmap", detailmap); -// m.put("column", wea); -// lists.add(m); -// map.put("detail", lists); -// } else { -// String temptablename = repeatTableName.get(tableName.toString()); -// if (tableName.toString().equals(temptablename)) { -// continue; -// } -// repeatTableName.put(tableName.toString(), tableName.toString()); -// m.put("tablename", ""); -// m.put("detailmap", detailmap); -// m.put("column", wea); -// lists.add(m); -// map.put("detail", lists); -// } -// } -// } -// List details = (List) map.get("detail"); -// if (details != null) { -// int size = details.size(); -// int start = 0; -// while (start < size) { -// start++; -// -// for (int i = 0; i < size; i++) { -// Map detail = details.get(i); -// -// //for (Map detail : details) { -// if (details.size() > size) { -// break; -// } -// for (Map detailContext : detailContexts) { -// Object isDetail = detailContext.get("isDetail"); -// if (isDetail != null) { -// if ("0".equals(isDetail.toString())) { -// continue; -// } -// } else { -// continue; -// } -// String title = ""; -// String dataIndex = ""; -// String oldValue = ""; -// String newValue = ""; -// String tableName = ""; -// String dataId = ""; -// Object fieldDesc = detailContext.get("fieldDesc"); -// if (StringUtils.isNotBlank(fieldDesc.toString())) { -// title = fieldDesc.toString(); -// } -// Object fieldnamelabelid = detailContext.get("fieldNameLabelId"); -// if (fieldnamelabelid != null) { -// if (StringUtils.isNotBlank(fieldnamelabelid.toString())&&StringUtils.isNumeric(fieldnamelabelid.toString())) { -// title = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(fieldnamelabelid.toString())); -// } -// } -// Object fieldName = detailContext.get("fieldName"); -// if (StringUtils.isNotBlank(fieldName.toString())) { -// dataIndex = fieldName.toString(); -// } -// Object oValue = detailContext.get("oldValue"); -// if (StringUtils.isNotBlank(oValue.toString())) { -// oldValue = oValue.toString(); -// } -// Object nValue = detailContext.get("newValue"); -// if (StringUtils.isNotBlank(nValue.toString())) { -// newValue = nValue.toString(); -// } -// Object oldRealValue = detailContext.get("oldRealValue"); -// if (oldRealValue != null) { -// if (StringUtils.isNotBlank(oldRealValue.toString())&&StringUtils.isNumeric(oldRealValue.toString())) { -// oldValue = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(oldRealValue.toString())); -// } -// } -// -// Object newrealvalue = detailContext.get("newRealValue"); -// if (newrealvalue != null) { -// if (StringUtils.isNotBlank(newrealvalue.toString())&&StringUtils.isNumeric(newrealvalue.toString())) { -// newValue = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(newrealvalue.toString())); -// } -// } -// Object tablename = detailContext.get("tableName"); -// if (StringUtils.isNotBlank(tablename.toString())) { -// tableName = tablename.toString(); -// } else { -// tableName = ""; -// } -// Object tablenamelabelid = detailContext.get("tableNameLabelId"); -// if (tablenamelabelid != null) { -// if (tablenamelabelid != null) { -// if (StringUtils.isNotBlank(tablenamelabelid.toString())&&StringUtils.isNumeric(tablenamelabelid.toString())) { -// tableName = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(tablenamelabelid.toString())); -// } -// } -// } -// Object dataid = detailContext.get("dataid"); -// if (StringUtils.isNotBlank(dataid.toString())) { -// dataId = dataid.toString(); -// } else { -// dataId = ""; -// } -// Object detailtablename = detail.get("tablename"); -// if (detailtablename != null) { -// if (tableName.equals(detailtablename.toString())) { -// List detailmap = (List) detail.get("detailmap"); -// List newDetails = new ArrayList<>(); -// if (detailmap != null && detailmap.size() > 0) { -// for (Map d : detailmap) { -// Object data_id = d.get("dataid"); -// if (data_id != null) { -// if (dataId.equals(data_id)) { -// Object operator = d.get("operator"); -// if (operator != null) { -// if (SystemEnv.getHtmlLabelName(63248, "操作(旧)").equals(operator.toString())) { -// d.put(dataIndex, oldValue); -// } else if (SystemEnv.getHtmlLabelName(63249, "操作(新)").equals(operator.toString())) { -// d.put(dataIndex, newValue); -// } -// } -// }else{ -// if (newDetails.size() > 2) { -// for (Map newDetail : newDetails) { -// if (dataId.equals(newDetail.get("dataid"))) { -// Object operator = d.get("operator"); -// if (operator != null) { -// if (SystemEnv.getHtmlLabelName(63248, "操作(旧)").equals(operator.toString())) { -// d.put(dataIndex, oldValue); -// } else if (SystemEnv.getHtmlLabelName(63249, "操作(新)").equals(operator.toString())) { -// d.put(dataIndex, newValue); -// } -// } -// }else{ -// HashMap detailoldMap= new HashMap<>(); -// detailoldMap.put("operator",SystemEnv.getHtmlLabelName(63248,"操作(旧)")); -// detailoldMap.put("dataid",detailContext.get("dataid")); -// detailoldMap.put(dataIndex, oldValue); -// HashMap detailnewMap= new HashMap<>(); -// detailnewMap.put("operator",SystemEnv.getHtmlLabelName(63249,"操作(新)")); -// detailnewMap.put("dataid",detailContext.get("dataid")); -// detailnewMap.put(dataIndex, newValue); -// newDetails.add(detailoldMap); -// newDetails.add(detailnewMap); -// } -// } -// }else if (newDetails.size() == 0) { -// int count = 0; -// for (Map mapdetail : detailmap) { -// Object dataid_ = mapdetail.get("dataid"); -// if (dataid_ != null && dataid_.equals(dataId)) { -// count++; -// } -// } -// if (count == 0) { -// HashMap detailoldMap= new HashMap<>(); -// detailoldMap.put("operator",SystemEnv.getHtmlLabelName(63248,"操作(旧)")); -// detailoldMap.put("dataid",detailContext.get("dataid")); -// detailoldMap.put(dataIndex, oldValue); -// HashMap detailnewMap= new HashMap<>(); -// detailnewMap.put("operator",SystemEnv.getHtmlLabelName(63249,"操作(新)")); -// detailnewMap.put("dataid",detailContext.get("dataid")); -// detailnewMap.put(dataIndex, newValue); -// newDetails.add(detailoldMap); -// newDetails.add(detailnewMap); -// } -// } -// } -// } -// } -// } -// if (newDetails.size() > 0) { -// details.addAll(newDetails); -// newDetails.clear(); -// //detailmap = new ArrayList<>(); -// //detail.put("detailmap", detailmap); -// } -// -// WeaTable column = (WeaTable) detail.get("column"); -// if (column != null) { -// List columns = column.getColumns(); -// if (columns != null && columns.size() > 0) { -// Boolean flag = true; -// for (Object object : columns) { -// WeaTableColumn weaTableColumn = JSONObject.parseObject(JSON.toJSONString(object), WeaTableColumn.class); -// if (weaTableColumn != null) { -// String title1 = weaTableColumn.getTitle(); -// if (title.equals(title1)) { -// flag = false; -// break; -// }else{ -// flag = true; -// } -// } -// } -// if (flag) { -// column.getColumns().add(new WeaTableColumn(title, dataIndex, "5%")); -// detail.put("column", column); -// } -// } -// } -// } -// } -// } -// } -// } -// } -// } -// } -// -// public static List getSwitchDatabaseData(List list) { -// if (ElogConsts.ORACLE.equalsIgnoreCase(DatabaseUtil.getDatabaseId()) || ElogConsts.SQLSERVER.equalsIgnoreCase(DatabaseUtil.getDatabaseId())) { -// List arrayList = new ArrayList<>(); -// for (Map map : list) { -// Set en = map.entrySet(); -// Map hashMap = new HashMap<>(); -// for (Map.Entry entry : en) { -// Object key = entry.getKey(); -// Object val = null; -// if ("PARAMS".equalsIgnoreCase(key.toString())||"CUSTOMINFO".equalsIgnoreCase(key.toString()) -// || entry.getValue() instanceof ClobProxyImpl || entry.getValue() instanceof Clob) { -// val = JSONObject.toJSON(entry.getValue()); -// }else{ -// val = entry.getValue(); -// } -// hashMap.put(key.toString().toLowerCase(),val ); -// } -// switchDatabaseField(hashMap); -// arrayList.add(hashMap); -// } -// return arrayList; -// }else{ -// for (Map map : list) { -// switchDatabaseField(map); -// } -// return list; -// } -// } -// -// public static List getSwitchDatabaseAnalysisData(List list,Map keys) { -// if (!ElogConsts.MYSQL.equalsIgnoreCase(DatabaseUtil.getDatabaseId())) { -// List arrayList = new ArrayList<>(); -// -// for (Map map : list) { -// Set en = map.entrySet(); -// Map hashMap = new HashMap<>(); -// for (Map.Entry entry : en) { -// Object key = entry.getKey(); -// Object val = entry.getValue(); -// if (key.toString().equalsIgnoreCase(keys.get(key.toString().toLowerCase()))){ -// key = keys.get(key.toString().toLowerCase()); -// }else { -// key = key.toString().toLowerCase(); -// } -// hashMap.put(key.toString(),val ); -// } -// arrayList.add(hashMap); -// } -// return arrayList; -// } -// return list; -// } -// -// /** -// * 获取多个模块名称 -// * @param modules -// * @return -// */ -// public static Map getModuleNames(List modules) { -// Map hashMap = new HashMap<>(); -// if (modules == null || modules.size() == 0) { -// return hashMap; -// } -// for (String module : modules) { -// String modulenum = ElogSeviceUtils.null2String(moduleMap.get(module), module); -// String modulename = ElogSeviceUtils.isLongValue(modulenum) ? SystemEnv.getHtmlLabelName(ElogSeviceUtils.getLongValue(modulenum), modulenum) : modulenum; -// hashMap.put(module, modulename); -// } -// return hashMap; -// -// } -// + Object tableName = detailContext.get("tableName"); + Object tablenamelabelid = detailContext.get("tableNameLabelId"); + if (tablenamelabelid != null) { + if (StringUtils.isNotBlank(tablenamelabelid.toString()) && StringUtils.isNumeric(tablenamelabelid.toString())) { + tableName = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(tablenamelabelid.toString())); + } + } + Map m = new HashMap<>(); + if (StringUtils.isNotBlank(tableName.toString())) { + String temptablename = repeatTableName.get(tableName.toString()); + if (tableName.toString().equals(temptablename)) { + continue; + } + repeatTableName.put(tableName.toString(), tableName.toString()); + m.put("tablename", tableName.toString()); + m.put("detailmap", detailmap); + m.put("column", wea); + lists.add(m); + map.put("detail", lists); + } else { + String temptablename = repeatTableName.get(tableName.toString()); + if (tableName.toString().equals(temptablename)) { + continue; + } + repeatTableName.put(tableName.toString(), tableName.toString()); + m.put("tablename", ""); + m.put("detailmap", detailmap); + m.put("column", wea); + lists.add(m); + map.put("detail", lists); + } + } + } + List details = (List) map.get("detail"); + if (details != null) { + int size = details.size(); + int start = 0; + while (start < size) { + start++; + + for (int i = 0; i < size; i++) { + Map detail = details.get(i); + + //for (Map detail : details) { + if (details.size() > size) { + break; + } + for (Map detailContext : detailContexts) { + Object isDetail = detailContext.get("isDetail"); + if (isDetail != null) { + if ("0".equals(isDetail.toString())) { + continue; + } + } else { + continue; + } + String title = ""; + String dataIndex = ""; + String oldValue = ""; + String newValue = ""; + String tableName = ""; + String dataId = ""; + Object fieldDesc = detailContext.get("fieldDesc"); + if (StringUtils.isNotBlank(fieldDesc.toString())) { + title = fieldDesc.toString(); + } + Object fieldnamelabelid = detailContext.get("fieldNameLabelId"); + if (fieldnamelabelid != null) { + if (StringUtils.isNotBlank(fieldnamelabelid.toString()) && StringUtils.isNumeric(fieldnamelabelid.toString())) { + title = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(fieldnamelabelid.toString())); + } + } + Object fieldName = detailContext.get("fieldName"); + if (StringUtils.isNotBlank(fieldName.toString())) { + dataIndex = fieldName.toString(); + } + Object oValue = detailContext.get("oldValue"); + if (StringUtils.isNotBlank(oValue.toString())) { + oldValue = oValue.toString(); + } + Object nValue = detailContext.get("newValue"); + if (StringUtils.isNotBlank(nValue.toString())) { + newValue = nValue.toString(); + } + Object oldRealValue = detailContext.get("oldRealValue"); + if (oldRealValue != null) { + if (StringUtils.isNotBlank(oldRealValue.toString()) && StringUtils.isNumeric(oldRealValue.toString())) { + oldValue = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(oldRealValue.toString())); + } + } + + Object newrealvalue = detailContext.get("newRealValue"); + if (newrealvalue != null) { + if (StringUtils.isNotBlank(newrealvalue.toString()) && StringUtils.isNumeric(newrealvalue.toString())) { + newValue = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(newrealvalue.toString())); + } + } + Object tablename = detailContext.get("tableName"); + if (StringUtils.isNotBlank(tablename.toString())) { + tableName = tablename.toString(); + } else { + tableName = ""; + } + Object tablenamelabelid = detailContext.get("tableNameLabelId"); + if (tablenamelabelid != null) { + if (tablenamelabelid != null) { + if (StringUtils.isNotBlank(tablenamelabelid.toString()) && StringUtils.isNumeric(tablenamelabelid.toString())) { + tableName = ElogSeviceSwitchUtils.transfLanguageLableid(Long.parseLong(tablenamelabelid.toString())); + } + } + } + Object dataid = detailContext.get("dataid"); + if (StringUtils.isNotBlank(dataid.toString())) { + dataId = dataid.toString(); + } else { + dataId = ""; + } + Object detailtablename = detail.get("tablename"); + if (detailtablename != null) { + if (tableName.equals(detailtablename.toString())) { + List detailmap = (List) detail.get("detailmap"); + List newDetails = new ArrayList<>(); + if (detailmap != null && detailmap.size() > 0) { + for (Map d : detailmap) { + Object data_id = d.get("dataid"); + if (data_id != null) { + if (dataId.equals(data_id)) { + Object operator = d.get("operator"); + if (operator != null) { + if (SalaryI18nUtil.getI18nLabel(63248, "操作(旧)").equals(operator.toString())) { + d.put(dataIndex, oldValue); + } else if (SalaryI18nUtil.getI18nLabel(63249, "操作(新)").equals(operator.toString())) { + d.put(dataIndex, newValue); + } + } + } else { + if (newDetails.size() > 2) { + for (Map newDetail : newDetails) { + if (dataId.equals(newDetail.get("dataid"))) { + Object operator = d.get("operator"); + if (operator != null) { + if (SalaryI18nUtil.getI18nLabel(63248, "操作(旧)").equals(operator.toString())) { + d.put(dataIndex, oldValue); + } else if (SalaryI18nUtil.getI18nLabel(63249, "操作(新)").equals(operator.toString())) { + d.put(dataIndex, newValue); + } + } + } else { + HashMap detailoldMap = new HashMap<>(); + detailoldMap.put("operator", SalaryI18nUtil.getI18nLabel(63248, "操作(旧)")); + detailoldMap.put("dataid", detailContext.get("dataid")); + detailoldMap.put(dataIndex, oldValue); + HashMap detailnewMap = new HashMap<>(); + detailnewMap.put("operator", SalaryI18nUtil.getI18nLabel(63249, "操作(新)")); + detailnewMap.put("dataid", detailContext.get("dataid")); + detailnewMap.put(dataIndex, newValue); + newDetails.add(detailoldMap); + newDetails.add(detailnewMap); + } + } + } else if (newDetails.size() == 0) { + int count = 0; + for (Map mapdetail : detailmap) { + Object dataid_ = mapdetail.get("dataid"); + if (dataid_ != null && dataid_.equals(dataId)) { + count++; + } + } + if (count == 0) { + HashMap detailoldMap = new HashMap<>(); + detailoldMap.put("operator", SalaryI18nUtil.getI18nLabel(63248, "操作(旧)")); + detailoldMap.put("dataid", detailContext.get("dataid")); + detailoldMap.put(dataIndex, oldValue); + HashMap detailnewMap = new HashMap<>(); + detailnewMap.put("operator", SalaryI18nUtil.getI18nLabel(63249, "操作(新)")); + detailnewMap.put("dataid", detailContext.get("dataid")); + detailnewMap.put(dataIndex, newValue); + newDetails.add(detailoldMap); + newDetails.add(detailnewMap); + } + } + } + } + } + } + if (newDetails.size() > 0) { + details.addAll(newDetails); + newDetails.clear(); + //detailmap = new ArrayList<>(); + //detail.put("detailmap", detailmap); + } + + WeaTable column = (WeaTable) detail.get("column"); + if (column != null) { + List columns = column.getColumns(); + if (columns != null && columns.size() > 0) { + Boolean flag = true; + for (Object object : columns) { + WeaTableColumn weaTableColumn = JSONObject.parseObject(JSON.toJSONString(object), WeaTableColumn.class); + if (weaTableColumn != null) { + String title1 = weaTableColumn.getText(); + if (title.equals(title1)) { + flag = false; + break; + } else { + flag = true; + } + } + } + if (flag) { + column.getColumns().add(new WeaTableColumn(title, dataIndex, "5%")); + detail.put("column", column); + } + } + } + } + } + } + } + } + } + } + } + + public static List getSwitchDatabaseData(List list) { + String databaseId = new RecordSet().getDBType(); + if (ElogConsts.ORACLE.equalsIgnoreCase(databaseId) || ElogConsts.SQLSERVER.equalsIgnoreCase(databaseId)) { + List arrayList = new ArrayList<>(); + for (Map map : list) { + Set en = map.entrySet(); + Map hashMap = new HashMap<>(); + for (Map.Entry entry : en) { + Object key = entry.getKey(); + Object val = null; + if ("PARAMS".equalsIgnoreCase(key.toString()) || "CUSTOMINFO".equalsIgnoreCase(key.toString()) + || entry.getValue() instanceof ClobProxyImpl || entry.getValue() instanceof Clob) { + val = JSONObject.toJSON(entry.getValue()); + } else { + val = entry.getValue(); + } + hashMap.put(key.toString().toLowerCase(), val); + } + switchDatabaseField(hashMap); + arrayList.add(hashMap); + } + return arrayList; + } else { + for (Map map : list) { + switchDatabaseField(map); + } + return list; + } + } + + public static List getSwitchDatabaseAnalysisData(List list, Map keys) { + String databaseId = new RecordSet().getDBType(); + if (!ElogConsts.MYSQL.equalsIgnoreCase(databaseId)) { + List arrayList = new ArrayList<>(); + + for (Map map : list) { + Set en = map.entrySet(); + Map hashMap = new HashMap<>(); + for (Map.Entry entry : en) { + Object key = entry.getKey(); + Object val = entry.getValue(); + if (key.toString().equalsIgnoreCase(keys.get(key.toString().toLowerCase()))) { + key = keys.get(key.toString().toLowerCase()); + } else { + key = key.toString().toLowerCase(); + } + hashMap.put(key.toString(), val); + } + arrayList.add(hashMap); + } + return arrayList; + } + return list; + } + + /** + * 获取多个模块名称 + * + * @param modules + * @return + */ + public static Map getModuleNames(List modules) { + Map hashMap = new HashMap<>(); + if (modules == null || modules.size() == 0) { + 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; + hashMap.put(module, modulename); + } + return hashMap; + + } + // private static String StringConversionForXSS(String str) { // if (StringUtils.isBlank(str)) // return str; @@ -1348,47 +1355,48 @@ // return SecurityUtil.encodeForHtml(str, true); // // } -// -// -// /** -// * 判断是否为json字符串 -// * -// * @param content -// * @return -// */ -// public static boolean isJSONString(String content) { -// if (StringUtils.isEmpty(content)) { -// return false; -// } -// if (!content.startsWith("{") || !content.endsWith("}")) { -// if (!content.startsWith("[") || !content.endsWith("]")) { -// return false; -// } -// } -// try { -// JSONObject.parse(content); -// return true; -// } catch (Exception e) { -// return false; -// } -// } -// public static List getNameModule(String module) { -// if(StringUtils.isBlank(module)){ -// return new ArrayList<>(); -// } -// Map> dataMap = new HashMap<>(); -// moduleMap.forEach( (k,v)->{ -// List list=new ArrayList<>(); -// Integer moduleCode = moduleMap.get(k); -// String htmlLabelName = SystemEnv.getHtmlLabelName(moduleCode.longValue(), ""); -// if(dataMap.containsKey(htmlLabelName)){ -// list= dataMap.get(htmlLabelName); -// list .add(k); -// }else { -// list.add(k); -// } -// dataMap.put(htmlLabelName,list); -// }); -// return Objects.isNull(dataMap.get(module))?Arrays.asList(module):dataMap.get(module); -// } -//} + + + /** + * 判断是否为json字符串 + * + * @param content + * @return + */ + public static boolean isJSONString(String content) { + if (StringUtils.isEmpty(content)) { + return false; + } + if (!content.startsWith("{") || !content.endsWith("}")) { + if (!content.startsWith("[") || !content.endsWith("]")) { + return false; + } + } + try { + JSONObject.parse(content); + return true; + } catch (Exception e) { + return false; + } + } + + public static List getNameModule(String module) { + if (StringUtils.isBlank(module)) { + return new ArrayList<>(); + } + Map> dataMap = new HashMap<>(); + moduleMap.forEach((k, v) -> { + List list = new ArrayList<>(); + Integer moduleCode = moduleMap.get(k); + String htmlLabelName = SalaryI18nUtil.getI18nLabel(moduleCode, ""); + if (dataMap.containsKey(htmlLabelName)) { + list = dataMap.get(htmlLabelName); + list.add(k); + } else { + list.add(k); + } + dataMap.put(htmlLabelName, list); + }); + return Objects.isNull(dataMap.get(module)) ? Arrays.asList(module) : dataMap.get(module); + } +} diff --git a/src/com/engine/salary/elog/util/ElogSeviceUtils.java b/src/com/engine/salary/elog/util/ElogSeviceUtils.java index 3ee65acaa..58ca9ec31 100644 --- a/src/com/engine/salary/elog/util/ElogSeviceUtils.java +++ b/src/com/engine/salary/elog/util/ElogSeviceUtils.java @@ -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; } diff --git a/src/com/engine/salary/elog/util/ElogUtils.java b/src/com/engine/salary/elog/util/ElogUtils.java index 077593ee6..38edd827d 100644 --- a/src/com/engine/salary/elog/util/ElogUtils.java +++ b/src/com/engine/salary/elog/util/ElogUtils.java @@ -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; diff --git a/src/com/engine/salary/elog/util/FieldNameMap.java b/src/com/engine/salary/elog/util/FieldNameMap.java new file mode 100644 index 000000000..dcde0258c --- /dev/null +++ b/src/com/engine/salary/elog/util/FieldNameMap.java @@ -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 mainFieldNameMap = new HashMap<>(); + + private static Map detailFieldNameMap = new HashMap<>(); + + private static Map> mainCusFieldNameMap = new HashMap<>(); + + private static Map> detailCusFieldNameMap = new HashMap<>(); + + + public static void setMainFieldName(Map fieldNameMap) { + mainFieldNameMap.putAll(fieldNameMap); + } + + public static void setDetailFieldName(Map fieldNameMap) { + detailFieldNameMap.putAll(fieldNameMap); + } + + public static void setMainCusFieldName(String module, String function, Map fieldNameMap) { + mainCusFieldNameMap.put(getKey(module, function), fieldNameMap); + } + + public static void setDetailCusFieldName(String module, String function, Map 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; + } +} diff --git a/src/com/engine/salary/elog/util/LoggerTemplate.java b/src/com/engine/salary/elog/util/LoggerTemplate.java index f3fca954a..c457291df 100644 --- a/src/com/engine/salary/elog/util/LoggerTemplate.java +++ b/src/com/engine/salary/elog/util/LoggerTemplate.java @@ -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; diff --git a/src/com/engine/salary/elog/web/LoggerTableController.java b/src/com/engine/salary/elog/web/LoggerTableController.java index 279bffdfe..b2969f833 100644 --- a/src/com/engine/salary/elog/web/LoggerTableController.java +++ b/src/com/engine/salary/elog/web/LoggerTableController.java @@ -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 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>> carddatas(@RequestBody(required = false) @ApiParam("数据") String data){ - List> list = loggerTableService.queryCardLogList(data); - return WeaResult.success(list); - } - - @ApiOperation("获取单条操作记录的更新明细") - @RequestMapping(path = "getDetailChanges", method = {RequestMethod.GET, RequestMethod.POST}) - @WeaPermission(publicPermission = true) - public WeaResult>> 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 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(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>>(user).run(getLoggerTableService(user)::queryCardLogList, data); + } +// +// @ApiOperation("获取单条操作记录的更新明细") +// @RequestMapping(path = "getDetailChanges", method = {RequestMethod.GET, RequestMethod.POST}) +// @WeaPermission(publicPermission = true) +// public WeaResult>> 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>>(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 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(user).run(getLoggerTableService(user)::queryLogList, param); } - @ApiOperation("获取日志列表") - @RequestMapping(path = "datas", method = {RequestMethod.GET, RequestMethod.POST}) - @WeaPermission(publicPermission = true) - public WeaResult>> 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> list = tableService.queryLogList(module, function, current, pageSize, condition); - return WeaResult.success(list); - } - } catch ( Exception e) { - - } - } - List> 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> 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>> 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> list = tableService.queryDetailLogList(module, function, current, pageSize, condition, mainId); - return WeaResult.success(list); - } - } catch ( Exception e) { - - } - } - List> 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> 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 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 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> 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>> 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> list = tableService.queryDetailLogList(module, function, current, pageSize, condition, mainId); +// return WeaResult.success(list); +// } +// } catch (Exception e) { +// +// } +// } +// List> 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> 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 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 downloadLog(@RequestBody(required = false) @ApiParam("数据") String data) { +// +// BatchDocumentMessage message = getLoggerTableService(user).downloadLog(data); +// return WeaResult.success(message); +// } } diff --git a/src/com/engine/salary/mapper/elog/ElogTableCheckerMapper.java b/src/com/engine/salary/mapper/elog/ElogTableCheckerMapper.java index 5171e2641..c5547e753 100644 --- a/src/com/engine/salary/mapper/elog/ElogTableCheckerMapper.java +++ b/src/com/engine/salary/mapper/elog/ElogTableCheckerMapper.java @@ -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; diff --git a/src/com/engine/salary/mapper/elog/ElogTableCheckerMapper.xml b/src/com/engine/salary/mapper/elog/ElogTableCheckerMapper.xml index a0410827b..03e4028ea 100644 --- a/src/com/engine/salary/mapper/elog/ElogTableCheckerMapper.xml +++ b/src/com/engine/salary/mapper/elog/ElogTableCheckerMapper.xml @@ -297,7 +297,7 @@ - SELECT COLUMN_NAME columnName, DATA_TYPE dataTypeStr, @@ -312,13 +312,13 @@ table_name = #{tableName} and TABLE_SCHEMA = (select database()) - select * from pg_tables where tableowner = (select current_user) and tablename = #{tableName} - SELECT COLUMN_NAME columnName FROM @@ -326,7 +326,7 @@ where TABLE_NAME=UPPER(#{tableName}) - SELECT COLUMN_NAME columnName FROM diff --git a/src/com/engine/salary/mapper/elog/LocalElogAopDaoMapper.java b/src/com/engine/salary/mapper/elog/LocalElogAopDaoMapper.java index 6a969c83e..eda527efa 100644 --- a/src/com/engine/salary/mapper/elog/LocalElogAopDaoMapper.java +++ b/src/com/engine/salary/mapper/elog/LocalElogAopDaoMapper.java @@ -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; diff --git a/src/com/engine/salary/mapper/elog/LocalElogDaoMapper.java b/src/com/engine/salary/mapper/elog/LocalElogDaoMapper.java index 56dddcd45..70807d832 100644 --- a/src/com/engine/salary/mapper/elog/LocalElogDaoMapper.java +++ b/src/com/engine/salary/mapper/elog/LocalElogDaoMapper.java @@ -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> queryElogList(@Param(value = "logContent") LoggerContext loggerContext, - @Param("limit") String limit, - @Param(value = "tableName") String tableName); + List> queryCardElogList(@Param(value = "logContent") LoggerContext loggerContext, + @Param("limit") String limit, + @Param(value = "tableName") String tableName, + @Param(value = "conditionSql") String conditionSql); + + List 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 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 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 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 queryAllChanges(@Param(value = "tableName") String tableName, @Param("mainid") String mainid); Map 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 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 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 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 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 queryDetailElogList(@Param(value = "logContent") LoggerContext loggerContext, + @Param("limit") String limit, + @Param(value = "tableName") String tableName, + @Param(value = "conditionSql") String conditionSql); + + Map elogDetailCount(@Param(value = "logContent") LoggerContext loggerContext, + @Param(value = "tableName") String tableName, + @Param(value = "conditionSql") String conditionSql); + +// List queryOperators(@Param(value = "tableName") String tableName, +// @Param(value = "targetId") String targetId, +// @Param(value = "operateType") String operateType); + + List queryReadInfoOperators(@Param(value = "tableName") String tableName, + @Param(value = "targetId") String targetId, + @Param(value = "operateType") String operateType, + @Param(value = "flag") Boolean flag); + + List 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 queryAllMainData(@Param(value = "tableName") String tableName, @Param("uuid") String uuid); + + List queryAllMainChanges(@Param(value = "tableName") String tableName, @Param("mainid") String mainid); + + List queryAllDetailChanges(@Param(value = "tableName") String tableName, @Param("mainid") String mainid); + + Integer queryElogContextById(@Param(value = "id") Long id, + @Param(value = "tableName") String tableName); + + List 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 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 queryAllChangesDataPages(@Param("tableName") String tableName, + @Param("mainid") String mainid, + @Param(value = "page") Page page); + + Integer queryAllChangesPageCounts(@Param("tableName") String tableName, @Param("mainid") String mainid); } diff --git a/src/com/engine/salary/mapper/elog/LocalElogDaoMapper.xml b/src/com/engine/salary/mapper/elog/LocalElogDaoMapper.xml index 7349e7026..93c233896 100644 --- a/src/com/engine/salary/mapper/elog/LocalElogDaoMapper.xml +++ b/src/com/engine/salary/mapper/elog/LocalElogDaoMapper.xml @@ -2,40 +2,411 @@ - - - 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 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} - ) - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java index a0da13747..56d4c84df 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java @@ -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 salaryAcctEmployeePOS = listByParam(queryParam); Set keySet = SalaryEntityUtil.properties(salaryAcctEmployeePOS, salaryAcctEmployeePO -> salaryAcctEmployeePO.getEmployeeId() + "-" + salaryAcctEmployeePO.getTaxAgentId()); List 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 taxAgentList = getTaxAgentService(user).listAllTaxAgents((long) user.getUID()); - if (CollectionUtils.isNotEmpty(taxAgentList)) { - List taxAgentIds = taxAgentList.stream().map(TaxAgentPO::getId).collect(Collectors.toList()); - // 有查询参数就取交集 - if (CollectionUtils.isNotEmpty(param.getTaxAgent())) { - List 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 taxAgentList = getTaxAgentService(user).listAllTaxAgents((long) user.getUID()); +// if (CollectionUtils.isNotEmpty(taxAgentList)) { +// List taxAgentIds = taxAgentList.stream().map(TaxAgentPO::getId).collect(Collectors.toList()); +// // 有查询参数就取交集 +// if (CollectionUtils.isNotEmpty(param.getTaxAgent())) { +// List 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()); } // 薪资所属月 diff --git a/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java b/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java index 0110994fa..14bec72f5 100644 --- a/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java @@ -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;