提交代码

This commit is contained in:
hzj
2025-05-21 10:07:39 +08:00
parent 5a5344a659
commit ca33bc5760
11 changed files with 374 additions and 0 deletions

View File

@@ -0,0 +1,79 @@
package com.njcn.system.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.constant.OperateType;
import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.dto.LogInfoDTO;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.system.pojo.dto.PqFrontLogsDTO;
import com.njcn.system.pojo.param.PqFrontLogsParam;
import com.njcn.system.pojo.po.UserLog;
import com.njcn.system.pojo.vo.PqFrontLogsVO;
import com.njcn.system.service.IUserLogService;
import com.njcn.system.service.PqFrontLogsService;
import com.njcn.web.controller.BaseController;
import com.njcn.web.pojo.param.BaseParam;
import com.njcn.web.utils.RequestUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* <p>
* 前端控制器(行政区域)
* </p>
*
* @author hongawen
* @since 2021-12-13
*/
@Validated
@Slf4j
@RestController
@RequestMapping("/frontLog")
@Api(tags = "前置日志管理")
@AllArgsConstructor
public class PqFrontLogsController extends BaseController {
private final PqFrontLogsService pqFrontLogsService;
/**
* 插入审计日志
*/
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
@PostMapping("/add")
@ApiOperation("插入前置日志")
@ApiImplicitParam(name = "pqFrontLogsDTO", value = "插入日志参数", required = true)
public HttpResult<Object> addFrontLogs(@RequestBody PqFrontLogsDTO pqFrontLogsDTO) {
String methodDescribe = getMethodDescribe("addFrontLogs");
pqFrontLogsService.addFrontLogs(pqFrontLogsDTO);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.QUERY)
@PostMapping("/query")
@ApiOperation("查询审计日志(治理模块)")
@ApiImplicitParam(name = "baseParam", value = "查询日志参数", required = true)
public HttpResult<Page<PqFrontLogsVO>> queryFrontLogs(@RequestBody PqFrontLogsParam baseParam) {
String methodDescribe = getMethodDescribe("queryFrontLogs");
Page<PqFrontLogsVO> list = pqFrontLogsService.queryPage(baseParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
}
}

View File

@@ -0,0 +1,24 @@
package com.njcn.system.mapper;
import com.njcn.db.mapper.BatchBaseMapper;
import com.njcn.system.excel.UserLogExcel;
import com.njcn.system.pojo.po.PqFrontLogs;
import com.njcn.system.pojo.po.UserLog;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author hongawen
* @since 2021-12-13
*/
public interface PqFrontLogsMapper extends BatchBaseMapper<PqFrontLogs> {
}

View File

@@ -0,0 +1,27 @@
package com.njcn.system.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.common.pojo.dto.LogInfoDTO;
import com.njcn.system.pojo.dto.PqFrontLogsDTO;
import com.njcn.system.pojo.param.PqFrontLogsParam;
import com.njcn.system.pojo.po.PqFrontLogs;
import com.njcn.system.pojo.po.UserLog;
import com.njcn.system.pojo.vo.PqFrontLogsVO;
/**
* <p>
* 服务类
* </p>
*
* @author hongawen
* @since 2021-12-13
*/
public interface PqFrontLogsService extends IService<PqFrontLogs> {
void addFrontLogs(PqFrontLogsDTO pqFrontLogsDTO);
Page<PqFrontLogsVO> queryPage(PqFrontLogsParam baseParam);
}

View File

@@ -0,0 +1,48 @@
package com.njcn.system.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.common.pojo.dto.LogInfoDTO;
import com.njcn.system.mapper.PqFrontLogsMapper;
import com.njcn.system.mapper.UserLogMapper;
import com.njcn.system.pojo.dto.PqFrontLogsDTO;
import com.njcn.system.pojo.param.PqFrontLogsParam;
import com.njcn.system.pojo.po.PqFrontLogs;
import com.njcn.system.pojo.po.UserLog;
import com.njcn.system.pojo.vo.PqFrontLogsVO;
import com.njcn.system.service.IUserLogService;
import com.njcn.system.service.PqFrontLogsService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author hongawen
* @since 2021-12-13
*/
@Service
@RequiredArgsConstructor
@Slf4j
public class PqFrontLogsServiceImpl extends ServiceImpl<PqFrontLogsMapper, PqFrontLogs> implements PqFrontLogsService {
@Override
public void addFrontLogs(PqFrontLogsDTO pqFrontLogsDTO) {
PqFrontLogs pqFrontLogs = new PqFrontLogs();
BeanUtils.copyProperties(pqFrontLogsDTO,pqFrontLogs);
pqFrontLogs.setState(1);
this.save(pqFrontLogs);
}
@Override
public Page<PqFrontLogsVO> queryPage(PqFrontLogsParam baseParam) {
return null;
}
}