管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-02-10 574122bacee86bb9ba6019aa74dabd895043aaa7
1
已修改3个文件
54 ■■■■ 文件已修改
data/ts.sql 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/aspect/LogAspect.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/all/SignController.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
data/ts.sql
@@ -128,11 +128,13 @@
select * from bd.b_hydrogeology_attach limit 1;
select * from bd.b_pac_hydrogeology limit 1;
select * from lf.sys_serve_log;
select * from lf.sys_meta;
select * from lf.sys_operate order by id limit 20;
select modular1,modular2,count(*) from lf.sys_operate group by modular1,modular2 order by modular1 desc,modular2;
select type from lf.sys_operate group by type
src/main/java/com/lf/server/aspect/LogAspect.java
@@ -33,19 +33,19 @@
    @Autowired
    private OperateService operateService;
    private final static String SELECT = "/select";
    private final static String SELECT = "select";
    private final static String INSERT = "/insert";
    private final static String INSERT = "insert";
    private final static String UPDATE = "/update";
    private final static String UPDATE = "update";
    private final static String DELETE = "/delete";
    private final static String DELETE = "delete";
    private final static String UPLOAD = "/upload";
    private final static String UPLOAD = "upload";
    private final static String DOWNLOAD = "/download";
    private final static String DOWNLOAD = "download";
    private final static String COUNT = "/count";
    private final static String COUNT = "count";
    private final static String SPLIT = "\\\\";
src/main/java/com/lf/server/controller/all/SignController.java
@@ -6,11 +6,13 @@
import com.lf.server.entity.all.SettingData;
import com.lf.server.entity.all.StaticData;
import com.lf.server.entity.sys.LoginEntity;
import com.lf.server.entity.sys.OperateEntity;
import com.lf.server.entity.sys.TokenEntity;
import com.lf.server.entity.sys.UserEntity;
import com.lf.server.helper.*;
import com.lf.server.service.all.ScheduleService;
import com.lf.server.service.sys.LoginService;
import com.lf.server.service.sys.OperateService;
import com.lf.server.service.sys.TokenService;
import com.lf.server.service.sys.UserService;
import com.lf.server.service.all.SignService;
@@ -45,6 +47,9 @@
    @Autowired
    SignService signService;
    @Autowired
    private OperateService operateService;
    @Autowired
    PropertiesConfig propertiesConfig;
@@ -226,4 +231,31 @@
            return fail(ex.getMessage(), null);
        }
    }
    @ApiOperation(value = "插入操作日志")
    @GetMapping("/insertOpLog")
    public ResponseMsg<Object> insertOpLog(String m1, String m2, HttpServletRequest req) {
        try {
            if (StringHelper.isEmpty(m1)) {
                return fail("一级模块必填", 0);
            }
            OperateEntity oe = new OperateEntity();
            oe.setIp(WebHelper.getIpAddress(req));
            oe.setModular1(m1);
            oe.setModular2(m2);
            oe.setType(0);
            UserEntity ue = tokenService.getCurrentUser(req);
            if (ue != null) {
                oe.setUserid(ue.getId());
            }
            int rows = operateService.insertOperate(oe);
            return success(rows);
        } catch (Exception ex) {
            return fail(ex.getMessage(), 0);
        }
    }
}