4、因日志记录的大字段信息太长导致卡顿,所以调整集成日志,操作日志,本地日志,修改表格列表不查询显示大字段,点击详情时才显示详细信息。
5、日志页面增加查询属性(页面显示的属性都加上),支持模糊查询。
| | |
| | | return R.data(operateLogService.listByCondition(bladeQueryObject)); |
| | | } |
| | | |
| | | /** |
| | | * 根据oid查询日志详情 |
| | | * @param oid |
| | | * @return |
| | | */ |
| | | @GetMapping("/detailByOid") |
| | | public R<LogOperate> detailByOid(String oid) { |
| | | return R.data(operateLogService.detailByOid(oid)); |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | IPage<LogOperate> listByCondition(BladeQueryObject bladeQueryObject) throws ServiceException; |
| | | |
| | | /** |
| | | * 根据oid查询日志详情 |
| | | * @param oid |
| | | * @return |
| | | * @throws ServiceException |
| | | */ |
| | | LogOperate detailByOid(String oid) throws ServiceException; |
| | | |
| | | } |
| | |
| | | package com.vci.ubcs.log.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; |
| | | import com.vci.ubcs.log.mapper.LogOperateMapper; |
| | |
| | | throw new ServiceException("日志查询必传参数【日志类型】不能为空!"); |
| | | } |
| | | // map对象转换为查询对象 |
| | | IPage<LogOperate> logOperateIPage = this.logOperateMapper.selectPage(Condition.getPage(bladeQueryObject.getQuery().setDescs("TIME")), UBCSCondition.getQueryWrapper(bladeQueryObject.getConditionMap(), LogOperate.class)); |
| | | LambdaQueryWrapper<LogOperate> wrapper = UBCSCondition.getQueryWrapper(bladeQueryObject.getConditionMap(), LogOperate.class).lambda(); |
| | | wrapper.select( |
| | | LogOperate::getOid, |
| | | LogOperate::getUserName, |
| | | LogOperate::getRealName, |
| | | LogOperate::getIp, |
| | | LogOperate::getModel, |
| | | LogOperate::getOperate, |
| | | LogOperate::getTime, |
| | | LogOperate::getOperateResult, |
| | | LogOperate::getLogType, |
| | | LogOperate::getIsAdmin |
| | | ); |
| | | IPage<LogOperate> logOperateIPage = this.logOperateMapper.selectPage(Condition.getPage(bladeQueryObject.getQuery().setDescs("TIME")), wrapper); |
| | | return logOperateIPage; |
| | | } |
| | | |
| | | /** |
| | | * 根据oid查询日志详情 |
| | | * @param oid |
| | | * @return |
| | | * @throws ServiceException |
| | | */ |
| | | @Override |
| | | public LogOperate detailByOid(String oid) throws ServiceException { |
| | | if(Func.isBlank(oid)){ |
| | | throw new ServiceException("必传参数日志的oid不能为空!"); |
| | | } |
| | | LogOperate logOperate = this.logOperateMapper.selectOne(Wrappers.<LogOperate>query().lambda().eq(LogOperate::getOid, oid)); |
| | | return logOperate; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class DockingLog extends BaseModel { |
| | | |
| | | |
| | | /** |
| | | * 序列化 |
| | | */ |
| | | private static final long serialVersionUID = 5020487634341415429L; |
| | | |
| | | /** |
| | | * 系统id |
| | | */ |
| | |
| | | */ |
| | | @ApiModelProperty(value = "接口类型:推送接口/查询接口,暂时不用") |
| | | private String type; |
| | | |
| | | /*** |
| | | * 接口类型显示值 |
| | | */ |
| | |
| | | */ |
| | | private String interfaceStatus; |
| | | |
| | | |
| | | /** |
| | | * 参数 |
| | | */ |
| | | private String paramString; |
| | | |
| | | |
| | | /** |
| | | * 返回 |
| | | */ |
| | | private String returnString; |
| | | |
| | | |
| | | /** |
| | | * 系统编号 |
| | | */ |
| | | private String systemCode; |
| | | |
| | | |
| | | /** |
| | | * 系统名称 |
| | | */ |
| | | private String systemName; |
| | | |
| | | |
| | | /** |
| | | * 系统id |
| | | */ |
| | | private String systemOid; |
| | | |
| | | |
| | | /** |
| | | * 接口类型 |
| | | */ |
| | | private String type; |
| | | |
| | | /** |
| | | * 接口类型显示值 |
| | | */ |
| | |
| | | ", msg='" + msg + '\'' + |
| | | '}'; |
| | | } |
| | | |
| | | } |
| | |
| | | private static final String NOT_NULL = "_notnull"; |
| | | private static final String IGNORE = "_ignore"; |
| | | |
| | | |
| | | public UBCSSqlKeyword() { |
| | | } |
| | | |
| | |
| | | } |
| | | return sqlwhere; |
| | | } |
| | | |
| | | private static String sqlKeywordValueSqlwhere(String field, Object value, SqlKeyword operation){ |
| | | String sqlwhere=""; |
| | | switch(operation) { |
| | |
| | | } |
| | | return sqlwhere; |
| | | } |
| | | |
| | | private static String dateValueSqlwhere(String field, Object value, SqlKeyword operation){ |
| | | String sqlwhere=""; |
| | | switch(operation) { |
| | |
| | | } |
| | | return sqlwhere; |
| | | } |
| | | |
| | | public static String buildSqlwhere(Map<String, Object> query) { |
| | | StringBuffer sb=new StringBuffer(); |
| | | if (!Func.isEmpty(query)) { |
| | |
| | | |
| | | return sb.toString(); |
| | | } |
| | | |
| | | public static void buildCondition(Map<String, Object> query, QueryWrapper<?> qw) { |
| | | if (!Func.isEmpty(query)) { |
| | | query.forEach((k, v) -> { |
| | |
| | | }); |
| | | } |
| | | } |
| | | public static MPJLambdaWrapper buildConditionByMapString(Map<String, String> query) { |
| | | |
| | | public static MPJLambdaWrapper buildConditionByMapString(Map<String, String> query) { |
| | | MPJLambdaWrapper<?>qw=new MPJLambdaWrapper<>(); |
| | | if (!Func.isEmpty(query)) { |
| | | query.forEach((k, v) -> { |
| | |
| | | }; |
| | | return qw; |
| | | } |
| | | |
| | | public static void buildConditionByMapString(Map<String, String> query, MPJLambdaWrapper<?> qw) { |
| | | if (!Func.isEmpty(query)) { |
| | | query.forEach((k, v) -> { |
| | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.map.CaseInsensitiveMap; |
| | | import org.jetbrains.annotations.NotNull; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import java.io.*; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | // 3.1、通过该条数据的分类id,拿到集团属性映射配置,用来将集团的属性映射到我们系统的属性 |
| | | List<DockingPreAttrMapping> dockingPreAttrMappings = dockingPreAttrMappingService.selectByWrapper(Wrappers.<DockingPreAttrMapping>query().lambda().eq(DockingPreAttrMapping::getTargetClassifyId, codeclsfid).eq(DockingPreAttrMapping::getViewName,"编码视图")); |
| | | if(Func.isNotEmpty(dockingPreAttrMappings)){ |
| | | log.info("开始调用sourceAttrKey2TargetKey方法。"); |
| | | //根据集团属性映射将集团转到我们系统,并修改不一致的到我们系统中对应的该条记录的值 |
| | | sourceAttrKey2TargetKey(dockingPreAttrMappings, viewValueList.get(0), oldDatalist, baseModel); |
| | | sourceAttrKey2TargetKey(dockingPreAttrMappings, viewValueList.get(0), baseModel); |
| | | } |
| | | } |
| | | log.info("申请单:"+applyId+",集团码:"+customCoding+"编码:"+baseModel.getId()); |
| | |
| | | * 根据集团属性映射将集团转到我们系统 |
| | | * @param dockingPreAttrMappings |
| | | * @param viewValueMap |
| | | * @param oldDatalist |
| | | * @param baseModel |
| | | */ |
| | | private void sourceAttrKey2TargetKey(List<DockingPreAttrMapping> dockingPreAttrMappings,Map<String, Object> viewValueMap, List<BaseModel> oldDatalist,BaseModel baseModel){ |
| | | Map<String, Object> targetKeyMap = new HashMap<>(); |
| | | private void sourceAttrKey2TargetKey(List<DockingPreAttrMapping> dockingPreAttrMappings,Map<String, Object> viewValueMap,BaseModel baseModel) throws ServiceException { |
| | | log.info("开始根据集团属性映射,将集团属性转成编码系统属性,并进行是否修改的比对!"); |
| | | //深拷贝记录下原对象,如果有更改用来放在旧业务数据字段(oldbusinessdata)上 |
| | | BaseModel oldBaseModel = null; |
| | | try { |
| | | oldBaseModel = deepCopy(baseModel); |
| | | } catch (Exception e) { |
| | | log.error("记录旧的业务数据时,baseModel对象深拷贝出现错误,原因:"+e.getMessage()); |
| | | e.printStackTrace(); |
| | | throw new ServiceException("记录旧的业务数据时,baseModel对象深拷贝出现错误,原因:"+e.getMessage()); |
| | | } |
| | | Map<String, Object> targetKeyMap = new CaseInsensitiveMap<>(); |
| | | // 将集团属性转成我们系统属性的map |
| | | dockingPreAttrMappings.stream().forEach(item->{ |
| | | targetKeyMap.put(item.getTargetAttrKey(),viewValueMap.get(item.getSourceAttrKey())); |
| | | }); |
| | | // 比对baseModel的data中的属性是否和targetKeyMap不一致,不一致的话就需要将baseModel的data中的对应key的value值转成集团的 |
| | | boolean isEdit = false; |
| | | // 忽略大小写 |
| | | Map caseInsensitiveMap = new CaseInsensitiveMap(baseModel.getData()); |
| | | for (Map.Entry<String, Object> entry : targetKeyMap.entrySet()) { |
| | | String key = entry.getKey(); |
| | | Object targetValue = entry.getValue(); |
| | | String dataValue = baseModel.getData().get(key); |
| | | |
| | | String dataValue = String.valueOf(caseInsensitiveMap.get(key)); |
| | | if (targetValue != null && !targetValue.equals(dataValue)) { |
| | | baseModel.getData().put(key, targetValue.toString()); |
| | | caseInsensitiveMap.put(key, targetValue.toString()); |
| | | isEdit = true; |
| | | } |
| | | } |
| | | // 集团对我们系统属性做了调整,我们需要对老的业务数据做记录 |
| | | if (isEdit) { |
| | | baseModel.getData().put("oldbusinessdata", JSON.toJSONString(oldDatalist)); |
| | | log.info("集团返回的数据存在差异,开始执行对编码系统basemodel对象修改操作!"); |
| | | // 清空原先的map,使用新的不区分key大小写的map |
| | | baseModel.getData().clear(); |
| | | baseModel.getData().putAll(caseInsensitiveMap); |
| | | // 移除历史的oldbusinessdata字段,否则会超长 |
| | | oldBaseModel.getData().remove("oldbusinessdata"); |
| | | baseModel.getData().put("oldbusinessdata", JSON.toJSONString(oldBaseModel)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 深拷贝 |
| | | * @param baseModel |
| | | * @return |
| | | * @throws ClassNotFoundException |
| | | * @throws IOException |
| | | */ |
| | | public static BaseModel deepCopy(BaseModel baseModel) throws ClassNotFoundException, IOException { |
| | | ByteArrayOutputStream bos = new ByteArrayOutputStream(); |
| | | ObjectOutputStream oos = new ObjectOutputStream(bos); |
| | | oos.writeObject(baseModel); |
| | | oos.close(); |
| | | |
| | | ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray()); |
| | | ObjectInputStream ois = new ObjectInputStream(bis); |
| | | BaseModel copy = (BaseModel) ois.readObject(); |
| | | ois.close(); |
| | | |
| | | return copy; |
| | | } |
| | | |
| | | /*** |
| | | * 接受集团分类主模型数据 |
| | | * @param dockingClassifyModelAttrVO |
| | |
| | | package com.vci.ubcs.code.controller; |
| | | |
| | | import com.alibaba.nacos.shaded.com.google.protobuf.ServiceException; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.code.dto.DockingSystemConfigDTO; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据集成日志oid,查询日志详情 |
| | | * @param oid |
| | | * @return |
| | | */ |
| | | @GetMapping("/gridLogeDetail") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "分页", notes = "DockingLogeVO") |
| | | public R<DockingLogeVO> getDockingLogDetailByOid(String oid) throws ServiceException { |
| | | return R.data(dokingSysManaentService.getDockingLogDetailByOid(oid)); |
| | | } |
| | | |
| | | /** |
| | | * 接口param列表 |
| | | * @param queryObject 基础查询对象,包含查询条件,分页,排序等 |
| | | * @return 集成日志显示对象列表 |
| | | */ |
| | | @GetMapping("/gridParam") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "分页", notes = "dockingSysIntParam") |
| | | public R<IPage<DockingSysIntParamVO>>gridParam(BaseQueryObject queryObject){ |
| | | Map<String,String> condtionMap=queryObject.getConditionMap(); |
| | |
| | | * @return 集成日志显示对象列表 |
| | | */ |
| | | @GetMapping("/gridHeader") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "分页", notes = "DockingSysIntHeaderVO") |
| | | public R<IPage<DockingSysIntHeaderVO>>gridHeader(BaseQueryObject queryObject){ |
| | | Map<String,String> condtionMap=queryObject.getConditionMap(); |
| | |
| | | package com.vci.ubcs.code.service; |
| | | |
| | | import com.alibaba.nacos.shaded.com.google.protobuf.ServiceException; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.code.entity.*; |
| | | import com.vci.ubcs.code.vo.pagemodel.*; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | |
| | | import java.util.Map; |
| | | |
| | |
| | | * 系統管理相关服务 |
| | | */ |
| | | public interface IDokingSysManaentService { |
| | | |
| | | /** |
| | | * data列表 |
| | | * @param condtionMap 基础查询对象,包含查询条件,分页,排序等 |
| | | * @return 系统集成的系统信息显示对象列表 |
| | | */ |
| | | IPage<DockingTaskVO>gridDockingTask(Map<String,String> condtionMap, Query query); |
| | | |
| | | /** |
| | | * 待集成数据 |
| | | * @param condtionMap 基础查询对象,包含查询条件,分页,排序等 |
| | |
| | | */ |
| | | IPage<DockingDataVO>gridDockingData(Map<String,String> condtionMap, Query query); |
| | | |
| | | |
| | | /** |
| | | * 根据集成日志oid,查询日志详情 |
| | | * @param oid |
| | | * @return |
| | | * @throws ServiceException |
| | | */ |
| | | public DockingLogeVO getDockingLogDetailByOid(String oid) throws ServiceException; |
| | | |
| | | /** |
| | | * 推送数据集成日志列表 |
| | |
| | | * @return 集成日志显示对象列表 |
| | | */ |
| | | IPage<DockingSysIntParamVO>gridParam(Map<String,String> condtionMap , Query query); |
| | | |
| | | |
| | | /** |
| | | * 接口param列表 |
| | |
| | | package com.vci.ubcs.code.service.impl; |
| | | |
| | | import com.alibaba.nacos.shaded.com.google.protobuf.ServiceException; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.vci.ubcs.code.entity.*; |
| | | import com.vci.ubcs.code.mapper.DockingSystemConfigMapper; |
| | | import com.vci.ubcs.code.service.*; |
| | |
| | | import com.vci.ubcs.starter.util.UBCSSqlKeyword; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | @Service |
| | | public class DokingSysManaentServiceImpl extends ServiceImpl<DockingSystemConfigMapper, DockingSystemConfig> implements IDokingSysManaentService { |
| | | |
| | | |
| | | // /*** |
| | | // /*** |
| | | // * 任务生成服务 |
| | | // */ |
| | | // @Resource |
| | | // private IDockingTaskService dockingTaskService; |
| | | |
| | | |
| | | /*** |
| | | * 日志生成服务 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据集成日志oid,查询日志详情 |
| | | * @param oid |
| | | * @return |
| | | * @throws ServiceException |
| | | */ |
| | | @Override |
| | | public DockingLogeVO getDockingLogDetailByOid(String oid) throws ServiceException { |
| | | if(Func.isBlank(oid)){ |
| | | throw new ServiceException("必传参数集成日志oid不能为空!"); |
| | | } |
| | | DockingLog dockingLog = dockingLogeService.getOne(Wrappers.<DockingLog>query().lambda().eq(DockingLog::getOid, oid)); |
| | | return DockingLogeWrapper.build().entityVO(dockingLog); |
| | | } |
| | | |
| | | /** |
| | | * 推送数据集成日志列表 |
| | | * @param condtionMap 基础查询对象,包含查询条件,分页,排序等 |
| | | * @return 集成日志显示对象列表 |
| | |
| | | @Override |
| | | public IPage<DockingLogeVO> gridLoge(Map<String,String> condtionMap, Query query) { |
| | | //IPage<DockingLog> pages=dockingLogeService.page(Condition.getPage(query), Condition.getQueryWrapper(dockingLog)); |
| | | IPage<DockingLog> pages=dockingLogeService.page(Condition.getPage(query), UBCSSqlKeyword.buildConditionByMapString(condtionMap)); |
| | | LambdaQueryWrapper<DockingLog> lambdaQueryWrapper = UBCSCondition.getQueryWrapperByMapString(condtionMap, DockingLog.class).lambda(); |
| | | lambdaQueryWrapper.select( |
| | | DockingLog::getOid, |
| | | DockingLog::getCreateTime, |
| | | DockingLog::getCreator, |
| | | DockingLog::getLastModifier, |
| | | DockingLog::getLastModifyTime, |
| | | DockingLog::getTenantId, |
| | | DockingLog::getSystemOid, |
| | | DockingLog::getSystemCode, |
| | | DockingLog::getSystemName, |
| | | DockingLog::getClassifyOid, |
| | | DockingLog::getClassifyId, |
| | | DockingLog::getClassifyName, |
| | | DockingLog::getUniqueCode, |
| | | DockingLog::getType, |
| | | DockingLog::getMsg, |
| | | //DockingLog::getParamString, |
| | | DockingLog::getSendXml, |
| | | DockingLog::getReturnString, |
| | | DockingLog::getInterfaceStatus |
| | | ); |
| | | IPage<DockingLog> pages=dockingLogeService.page(Condition.getPage(query), lambdaQueryWrapper); |
| | | return DockingLogeWrapper.build().pageVO(pages); |
| | | } |
| | | |
| | |
| | | IPage<DockingSysIntHeader> pages = dockingSysIntHeaderService.page(Condition.getPage(query), UBCSSqlKeyword.buildConditionByMapString(condtionMap)); |
| | | return DockingSysIntHeaderWrapper.build().pageVO(pages); |
| | | } |
| | | |
| | | } |