月球大数据地理空间分析展示平台-【后端】-月球后台服务
13693261870
2023-08-31 d2b8e4d2ad5848e251998e2dcde09868cd6153a0
src/main/java/com/moon/server/controller/sys/ResController.java
@@ -47,22 +47,26 @@
    @ApiOperation(value = "分页查询并返回记录数")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = ""),
            @ApiImplicitParam(name = "status", value = "状态", dataType = "Integer", paramType = "query", example = ""),
            @ApiImplicitParam(name = "category", value = "服务类别", dataType = "Integer", paramType = "query", example = ""),
            @ApiImplicitParam(name = "type", value = "服务类型", dataType = "Integer", paramType = "query", example = ""),
            @ApiImplicitParam(name = "data", value = "数据类型", dataType = "Integer", paramType = "query", example = ""),
            @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"),
            @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1")
    })
    @GetMapping(value = "/selectByPageAndCount")
    public ResponseMsg<List<ResEntity>> selectByPageAndCount(String name, Integer pageSize, Integer pageIndex) {
    public ResponseMsg<List<ResEntity>> selectByPageAndCount(String name, Integer status, Integer category, Integer type, Integer data, Integer pageSize, Integer pageIndex) {
        try {
            if (pageSize < 1 || pageIndex < 1) {
                return fail("每页页数或分页数小于1", null);
            }
            int count = resService.selectCount(name);
            int count = resService.selectCount(name, status, category, type, data);
            if (count == 0) {
                return success(0, null);
            }
            List<ResEntity> rs = resService.selectByPage(name, pageSize, pageSize * (pageIndex - 1));
            List<ResEntity> rs = resService.selectByPage(name, status, category, type, data, pageSize, pageSize * (pageIndex - 1));
            return success(count, rs);
        } catch (Exception ex) {
@@ -140,10 +144,8 @@
                entity.setDepid(ue.getDepcode());
            }
            permsService.clearPermsCache();
            int count = resService.insert(entity);
            if (count > 0) {
                permsService.clearResCache();
            }
            return success(count);
        } catch (Exception ex) {
@@ -167,10 +169,8 @@
                }
            }
            permsService.clearPermsCache();
            int count = resService.inserts(list);
            if (count > 0) {
                permsService.clearResCache();
            }
            return success(count);
        } catch (Exception ex) {
@@ -186,10 +186,8 @@
    @GetMapping(value = "/delete")
    public ResponseMsg<Integer> delete(int id) {
        try {
            permsService.clearPermsCache();
            int count = resService.delete(id);
            if (count > 0) {
                permsService.clearResCache();
            }
            return success(count);
        } catch (Exception ex) {
@@ -209,10 +207,8 @@
                return fail("id数组不能为空", -1);
            }
            permsService.clearPermsCache();
            int count = resService.deletes(ids);
            if (count > 0) {
                permsService.clearResCache();
            }
            return success(count);
        } catch (Exception ex) {
@@ -235,10 +231,8 @@
                entity.setDepid(ue.getDepcode());
            }
            permsService.clearPermsCache();
            int count = resService.update(entity);
            if (count > 0) {
                permsService.clearResCache();
            }
            return success(count);
        } catch (Exception ex) {
@@ -263,10 +257,8 @@
                }
            }
            permsService.clearPermsCache();
            int count = resService.updates(list);
            if (count > 0) {
                permsService.clearResCache();
            }
            return success(count);
        } catch (Exception ex) {