13693261870
8 天以前 b8d62de41ff7e1e0549061308aa11f68cf881ed9
se-system/src/main/java/com/terra/system/controller/data/MetaController.java
@@ -26,8 +26,13 @@
import com.terra.system.service.sys.DepService;
import com.terra.system.service.sys.DownlogService;
import com.terra.system.service.sys.TokenService;
import io.swagger.annotations.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@@ -42,7 +47,7 @@
 * 元数据
 * @author WWW
 */
@Api(tags = "数据管理\\信息管理")
@Tag(name = "数据管理\\信息管理")
@RestController
@RequestMapping("/meta")
public class MetaController extends BaseController {
@@ -71,14 +76,14 @@
    CadService cadService;
    @SysLog()
    @ApiOperation(value = "分页查询并返回记录数")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "depcode", value = "单位编码", dataType = "String", paramType = "query", example = "00"),
            @ApiImplicitParam(name = "dircode", value = "目录编码", dataType = "String", paramType = "query", example = "00"),
            @ApiImplicitParam(name = "verid", value = "版本ID", dataType = "Integer", paramType = "query", example = "0"),
            @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")
    @Operation(summary = "分页查询并返回记录数")
    @Parameters({
            @Parameter(name = "depcode", description = "单位编码", in = ParameterIn.QUERY, example = "00"),
            @Parameter(name = "dircode", description = "目录编码", in = ParameterIn.QUERY, example = "00"),
            @Parameter(name = "verid", description = "版本ID", in = ParameterIn.QUERY, example = "0"),
            @Parameter(name = "name", description = "名称", in = ParameterIn.QUERY, example = ""),
            @Parameter(name = "pageSize", description = "每页条数", in = ParameterIn.QUERY, example = "10"),
            @Parameter(name = "pageIndex", description = "分页数(从1开始)", in = ParameterIn.QUERY, example = "1")
    })
    @GetMapping(value = "/selectByPageAndCount")
    public ResponseMsg<List<MetaEntity>> selectByPageAndCount(String depcode, String dircode, Integer verid, String name, Integer pageSize, Integer pageIndex) {
@@ -101,9 +106,9 @@
    }
    @SysLog()
    @ApiOperation(value = "根据GUID查询GDB")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "guid", value = "GUID", dataType = "String", paramType = "query", example = "d58e66d9606a4b85e7c8ab43b3db0b55")
    @Operation(summary = "根据GUID查询GDB")
    @Parameters({
            @Parameter(name = "guid", description = "GUID", in = ParameterIn.QUERY, example = "d58e66d9606a4b85e7c8ab43b3db0b55")
    })
    @GetMapping(value = "/selectGdbByGuid")
    public ResponseMsg<Object> selectGdbByGuid(String guid) {
@@ -121,12 +126,12 @@
    }
    @SysLog()
    @ApiOperation(value = "根据父ID分页查询并返回记录数")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "metaid", value = "父ID", dataType = "String", paramType = "query", example = "0"),
            @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")
    @Operation(summary = "根据父ID分页查询并返回记录数")
    @Parameters({
            @Parameter(name = "metaid", description = "父ID", in = ParameterIn.QUERY, example = "0"),
            @Parameter(name = "name", description = "名称", in = ParameterIn.QUERY, example = ""),
            @Parameter(name = "pageSize", description = "每页条数", in = ParameterIn.QUERY, example = "10"),
            @Parameter(name = "pageIndex", description = "分页数(从1开始)", in = ParameterIn.QUERY, example = "1")
    })
    @GetMapping(value = "/selectPageAndCountByPid")
    public ResponseMsg<List<MetaEntity>> selectPageAndCountByPid(Integer metaid, String name, Integer pageSize, Integer pageIndex) {
@@ -152,9 +157,9 @@
    }
    @SysLog()
    @ApiOperation(value = "根据目录ID查询版本列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dirid", value = "目录ID", dataType = "Integer", paramType = "query")
    @Operation(summary = "根据目录ID查询版本列表")
    @Parameters({
            @Parameter(name = "dirid", description = "目录ID", in = ParameterIn.QUERY)
    })
    @GetMapping(value = "/selectVerByDirid")
    public ResponseMsg<List<VerEntity>> selectVerByDirid(Integer dirid) {
@@ -175,9 +180,9 @@
    }
    @SysLog()
    @ApiOperation(value = "根据ID查询")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "ID", dataType = "int", paramType = "query", example = "1")
    @Operation(summary = "根据ID查询")
    @Parameters({
            @Parameter(name = "id", description = "ID", in = ParameterIn.QUERY, example = "1")
    })
    @GetMapping(value = "/selectById")
    public ResponseMsg<MetaEntity> selectById(int id) {
@@ -191,11 +196,11 @@
    }
    @SysLog()
    @ApiOperation(value = "查询表中数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "元数据ID", dataType = "Integer", paramType = "query", example = "115"),
            @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1"),
            @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10")
    @Operation(summary = "查询表中数据")
    @Parameters({
            @Parameter(name = "id", description = "元数据ID", in = ParameterIn.QUERY, example = "115"),
            @Parameter(name = "pageIndex", description = "分页数(从1开始)", in = ParameterIn.QUERY, example = "1"),
            @Parameter(name = "pageSize", description = "每页条数", in = ParameterIn.QUERY, example = "10")
    })
    @GetMapping(value = "/selectDbData")
    public ResponseMsg<Object> selectDbData(Integer id, Integer pageIndex, Integer pageSize) {
@@ -230,10 +235,10 @@
    }
    @SysLog()
    @ApiOperation(value = "查询字段信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ns", value = "名称空间", dataType = "String", paramType = "query", example = "bd"),
            @ApiImplicitParam(name = "tab", value = "表名", dataType = "String", paramType = "query", example = "dlg25wAanp")
    @Operation(summary = "查询字段信息")
    @Parameters({
            @Parameter(name = "ns", description = "名称空间", in = ParameterIn.QUERY, example = "bd"),
            @Parameter(name = "tab", description = "表名", in = ParameterIn.QUERY, example = "dlg25wAanp")
    })
    @GetMapping(value = "/selectTabFields")
    public ResponseMsg<List<DictEntity>> selectTabFields(String ns, String tab) {
@@ -251,10 +256,10 @@
    }
    @SysLog()
    @ApiOperation(value = "查询Dwg转换")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "元数据ID", dataType = "int", paramType = "query", example = "7715"),
            @ApiImplicitParam(name = "isAttach", value = "是否为附件", dataType = "Boolean", paramType = "query", example = "false")
    @Operation(summary = "查询Dwg转换")
    @Parameters({
            @Parameter(name = "id", description = "元数据ID", in = ParameterIn.QUERY, example = "7715"),
            @Parameter(name = "isAttach", description = "是否为附件", in = ParameterIn.QUERY, example = "false")
    })
    @GetMapping(value = "/selectConvertToDwg")
    public ResponseMsg<Object> selectConvertToDwg(int id, Boolean isAttach) {
@@ -268,9 +273,9 @@
    }
    @SysLog()
    @ApiOperation(value = "插入一条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "entity", value = "实体类", dataType = "MetaEntity", paramType = "body")
    @Operation(summary = "插入一条")
    @Parameters({
            @Parameter(name = "entity", description = "实体类")
    })
    @PostMapping(value = "/insert", produces = "application/json; charset=UTF-8")
    public ResponseMsg<Integer> insert(@RequestBody MetaEntity entity, HttpServletRequest req) {
@@ -290,9 +295,9 @@
    }
    @SysLog()
    @ApiOperation(value = "插入多条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "list", value = "实体类集合", dataType = "MetaEntity", paramType = "body")
    @Operation(summary = "插入多条")
    @Parameters({
            @Parameter(name = "list", description = "实体类集合")
    })
    @PostMapping(value = "/inserts", produces = "application/json; charset=UTF-8")
    public ResponseMsg<Integer> inserts(@RequestBody List<MetaEntity> list, HttpServletRequest req) {
@@ -313,9 +318,9 @@
    }
    @SysLog()
    @ApiOperation(value = "删除多条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ids", value = "ID数组", dataType = "Integer", paramType = "query", allowMultiple = true, example = "1")
    @Operation(summary = "删除多条")
    @Parameters({
            @Parameter(name = "ids", description = "ID数组", in = ParameterIn.QUERY, schema = @Schema(type = "array"), example = "1")
    })
    @GetMapping(value = "/deletes")
    public ResponseMsg<Integer> deletes(@RequestParam List<Integer> ids) {
@@ -333,9 +338,9 @@
    }
    @SysLog()
    @ApiOperation(value = "更新一条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "entity", value = "实体类", dataType = "MetaEntity", paramType = "body")
    @Operation(summary = "更新一条")
    @Parameters({
            @Parameter(name = "entity", description = "实体类")
    })
    @ResponseBody
    @PostMapping(value = "/update", produces = "application/json; charset=UTF-8")
@@ -355,9 +360,9 @@
    }
    @SysLog()
    @ApiOperation(value = "更新多条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "list", value = "实体类集合", dataType = "MetaEntity", paramType = "body")
    @Operation(summary = "更新多条")
    @Parameters({
            @Parameter(name = "list", description = "实体类集合")
    })
    @ResponseBody
    @PostMapping(value = "/updates", produces = "application/json; charset=UTF-8")
@@ -379,11 +384,11 @@
    }
    @SysLog()
    @ApiOperation(value = "分页查询下载文件")
    @ApiImplicitParams({
            @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")
    @Operation(summary = "分页查询下载文件")
    @Parameters({
            @Parameter(name = "name", description = "名称", in = ParameterIn.QUERY, example = ""),
            @Parameter(name = "pageSize", description = "每页条数", in = ParameterIn.QUERY, example = "10"),
            @Parameter(name = "pageIndex", description = "分页数(从1开始)", in = ParameterIn.QUERY, example = "1")
    })
    @GetMapping(value = "/selectPageCountForDownload")
    public ResponseMsg<List<DownloadEntity>> selectPageCountForDownload(String name, Integer pageSize, Integer pageIndex, HttpServletRequest req) {
@@ -410,9 +415,9 @@
    }
    @SysLog()
    @ApiOperation(value = "查询元数据中溢出的单位ID")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "reqEntity", value = "请求下载实体", dataType = "DownloadReqEntity", paramType = "body")
    @Operation(summary = "查询元数据中溢出的单位ID")
    @Parameters({
            @Parameter(name = "reqEntity", description = "请求下载实体")
    })
    @ResponseBody
    @PostMapping(value = "/selectMetaOverflowDep")
@@ -436,9 +441,9 @@
    }
    @SysLog()
    @ApiOperation(value = "根据单位编码数组查询单位")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "codes", value = "单位编码数组", dataType = "String", paramType = "query", allowMultiple = true, example = "00,0001")
    @Operation(summary = "根据单位编码数组查询单位")
    @Parameters({
            @Parameter(name = "codes", description = "单位编码数组", in = ParameterIn.QUERY, schema = @Schema(type = "array"), example = "00,0001")
    })
    @GetMapping(value = "/selectDepsByCodes")
    public ResponseMsg<Object> selectDepsByCodes(String[] codes) {
@@ -456,9 +461,9 @@
    }
    @SysLog()
    @ApiOperation(value = "请求元数据下载")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dr", value = "请求下载实体类", dataType = "DownloadReqEntity", paramType = "body")
    @Operation(summary = "请求元数据下载")
    @Parameters({
            @Parameter(name = "dr", description = "请求下载实体类")
    })
    @ResponseBody
    @PostMapping(value = "/downloadReq")
@@ -487,10 +492,10 @@
    }
    @SysLog()
    @ApiOperation(value = "查询下载文件")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "guid", value = "文件GUID", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "pwd", value = "密码", dataType = "String", paramType = "query")
    @Operation(summary = "查询下载文件")
    @Parameters({
            @Parameter(name = "guid", description = "文件GUID", in = ParameterIn.QUERY),
            @Parameter(name = "pwd", description = "密码", in = ParameterIn.QUERY)
    })
    @GetMapping(value = "/selectDownloadFile")
    public ResponseMsg<Boolean> selectDownloadFile(String guid, String pwd) {
@@ -525,10 +530,10 @@
    }
    @SysLog()
    @ApiOperation(value = "下载文件")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "guid", value = "文件GUID", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "pwd", value = "密码", dataType = "String", paramType = "query")
    @Operation(summary = "下载文件")
    @Parameters({
            @Parameter(name = "guid", description = "文件GUID", in = ParameterIn.QUERY),
            @Parameter(name = "pwd", description = "密码", in = ParameterIn.QUERY)
    })
    @ResponseBody
    @GetMapping(value = "/downloadFile")
@@ -566,9 +571,9 @@
    }
    @SysLog()
    @ApiOperation(value = "查看文件")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "guid", value = "附件Guid", dataType = "String", paramType = "body")
    @Operation(summary = "查看文件")
    @Parameters({
            @Parameter(name = "guid", description = "附件Guid")
    })
    @GetMapping(value = "/downloadForView")
    public void downloadForView(String guid, HttpServletResponse res) {