平台所有业务操作都存储在核心库,以便统一分析处理。各业务微服务通过feign调用核心日志服务。底层提供了API:
<dependency><groupId>org.qlm</groupId><artifactId>qlm-api</artifactId><version>1.0-SNAPSHOT</version> </dependency>
@Autowired private JobAPI jobapi;
SysLogOperationRequestDTO log = new SysLogOperationRequestDTO(); log.setActDate(CommonsUtil.getSysTime()); log.setActType(操作类型); log.setActIP(user.getLoginip()); log.setOperID(user.getUserId()); log.setOperName(user.getUserName()); log.setLinkid(关联id); log.setActName(操作名称); log.setActDes(操作描述); jobAPI.saveSysLogOperation(log);
前端可以使用日志组件显示操作过程:
<el-dialog :visible.sync="showLogDialog" width="72%" title="查看流程日志">
<showOperation v-if="showLogDialog" :showcondition="condition" />
</el-dialog>
import showOperation from "@/qlmcomponents/showOperation"
condition: {
linkid: "",
actType: "",
},
其中linkid就是上面的关联id
actType就是操作类型