管道基础大数据平台系统开发-【后端】-Server
13693261870
2024-03-06 f849c87a07300020dbef300c79d1eacfc1439f84
src/main/java/com/lf/server/controller/data/DomainController.java
@@ -8,6 +8,7 @@
import com.lf.server.entity.sys.UserEntity;
import com.lf.server.helper.StringHelper;
import com.lf.server.service.all.BaseQueryService;
import com.lf.server.service.data.DictService;
import com.lf.server.service.data.DomainService;
import com.lf.server.service.sys.TokenService;
import io.swagger.annotations.Api;
@@ -37,6 +38,9 @@
    @Autowired
    BaseQueryService baseQueryService;
    @Autowired
    DictService dictService;
    @SysLog()
    @ApiOperation(value = "查询记录数")
    @ApiImplicitParams({
@@ -51,7 +55,7 @@
            return success(count);
        } catch (Exception ex) {
            return fail(ex.getMessage(), -1);
            return fail(ex, -1);
        }
    }
@@ -75,7 +79,7 @@
            return success(rs);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
            return fail(ex, null);
        }
    }
@@ -84,27 +88,27 @@
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ns", value = "名称空间", dataType = "String", paramType = "query", example = "bd"),
            @ApiImplicitParam(name = "tab", value = "表名", dataType = "String", paramType = "query", example = "b_hy20w_s23"),
            @ApiImplicitParam(name = "code", value = "编码", dataType = "String", paramType = "query", example = "1"),
            @ApiImplicitParam(name = "name", value = "名称", dataType = "String", 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<DomainEntity>> selectByPageAndCount(String ns, String tab, String code, Integer pageSize, Integer pageIndex) {
    public ResponseMsg<List<DomainEntity>> selectByPageAndCount(String ns, String tab, String name, Integer pageSize, Integer pageIndex) {
        try {
            if (pageSize < 1 || pageIndex < 1) {
                return fail("每页页数或分页数小于1", null);
            }
            int count = domainService.selectCount(ns, tab, code);
            int count = domainService.selectCount(ns, tab, name);
            if (count == 0) {
                return success(0, null);
            }
            List<DomainEntity> rs = domainService.selectByPage(ns, tab, code, pageSize, pageSize * (pageIndex - 1));
            List<DomainEntity> rs = domainService.selectByPage(ns, tab, name, pageSize, pageSize * (pageIndex - 1));
            return success(count, rs);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
            return fail(ex, null);
        }
    }
@@ -117,20 +121,24 @@
            return success(list);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
            return fail(ex, null);
        }
    }
    @SysLog()
    @ApiOperation(value = "查询值域表集合")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = "b_"),
            @ApiImplicitParam(name = "hasGeom", value = "含有Geom字段", dataType = "Boolean", paramType = "query", example = "false")
    })
    @GetMapping(value = "/selectDomainTabs")
    public ResponseMsg<List<TabEntity>> selectDomainTabs() {
    public ResponseMsg<List<TabEntity>> selectDomainTabs(String name, Boolean hasGeom) {
        try {
            List<TabEntity> list = domainService.selectDomainTabs();
            List<TabEntity> list = dictService.selectDictTab(name, null == hasGeom || !hasGeom ? "gid" : "geom");
            return success(list);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
            return fail(ex, null);
        }
    }
@@ -151,7 +159,7 @@
            return success(list);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
            return fail(ex, null);
        }
    }
@@ -167,7 +175,7 @@
            return success(entity);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
            return fail(ex, null);
        }
    }
@@ -188,7 +196,7 @@
            return success(count);
        } catch (Exception ex) {
            return fail(ex.getMessage(), -1);
            return fail(ex, -1);
        }
    }
@@ -211,7 +219,7 @@
            return success(count);
        } catch (Exception ex) {
            return fail(ex.getMessage(), -1);
            return fail(ex, -1);
        }
    }
@@ -227,7 +235,7 @@
            return success(count);
        } catch (Exception ex) {
            return fail(ex.getMessage(), -1);
            return fail(ex, -1);
        }
    }
@@ -247,7 +255,7 @@
            return success(count);
        } catch (Exception ex) {
            return fail(ex.getMessage(), -1);
            return fail(ex, -1);
        }
    }
@@ -269,7 +277,7 @@
            return success(count);
        } catch (Exception ex) {
            return fail(ex.getMessage(), -1);
            return fail(ex, -1);
        }
    }
@@ -293,7 +301,7 @@
            return success(count);
        } catch (Exception ex) {
            return fail(ex.getMessage(), -1);
            return fail(ex, -1);
        }
    }
}