| | |
| | | import com.moon.server.helper.StringHelper; |
| | | import io.swagger.annotations.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | |
| | | import java.net.URLDecoder; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 元数据 |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "数据管理\\信息管理") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/meta") |
| | | public class MetaController extends BaseController { |
| | | @Autowired |
| | |
| | | @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 = "sensorType", value = "传感器类型", dataType = "Integer", paramType = "query", example = "0"), |
| | | @ApiImplicitParam(name = "mataType", value = "元数据类型", dataType = "Integer", paramType = "query", example = "0"), |
| | | @ApiImplicitParam(name = "startDate", value = "开始日期", dataType = "Date", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "endDate", value = "结束日期", dataType = "Date", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "wkt", value = "WKT字符串", dataType = "String", paramType = "query", example = "gAPpDbZ53XfoQfvT8dj/uhBWX5os8kBJQ1LrNvH3VX7byFQdUJMPiEr8Fkj0q2i1pw+L8KFrvR0MLXq2xaO21nlQQXmEPofJxpDQZwEWUIFZsToXo1kLRD3t6WQezxWB8YTzXHM20Ba73x/ZuuezVhOFOq1U8HKf1dXQdv7gBzEB6fWMmFDc3FuH8GDDHv3LfT86Gio9VgMO6ohlrUdf3ZKtTHeLSuzGF4t0RZuX97YBNo25IIzpeTfRTXBxfdxA"), |
| | | @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<MetaEntity>> selectByPageAndCount(String depcode, String dircode, Integer verid, String name, Integer pageSize, Integer pageIndex) { |
| | | public ResponseMsg<List<MetaEntity>> selectByPageAndCount(String depcode, String dircode, Integer verid, String name, Integer sensorType, Integer mataType, @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date startDate, @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endDate, String wkt, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("每页页数或分页数小于1", null); |
| | | } |
| | | if (startDate != null && endDate != null && startDate.getTime() > endDate.getTime()) { |
| | | Date tmp = startDate; |
| | | startDate = endDate; |
| | | endDate = tmp; |
| | | } |
| | | wkt = metaService.getGeometryFilter(wkt); |
| | | |
| | | int count = metaService.selectCount(depcode, dircode, verid, name); |
| | | int count = metaService.selectCount(depcode, dircode, verid, name, sensorType, mataType, startDate, endDate, wkt); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<MetaEntity> rs = metaService.selectByPage(depcode, dircode, verid, name, pageSize, pageSize * (pageIndex - 1)); |
| | | List<MetaEntity> rs = metaService.selectByPage(depcode, dircode, verid, name, sensorType, mataType, startDate, endDate, wkt, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "根据GUID查询GDB") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "guid", value = "GUID", dataType = "String", paramType = "query", example = "d58e66d9606a4b85e7c8ab43b3db0b55") |
| | | }) |
| | | @GetMapping(value = "/selectGdbByGuid") |
| | | public ResponseMsg<Object> selectGdbByGuid(String guid) { |
| | | try { |
| | | if (StringHelper.isEmpty(guid)) { |
| | | return fail("文件GUID值不能为空", null); |
| | | } |
| | | |
| | | List<MetaEntity> rs = metaService.selectGdbByGuid(guid); |
| | | |
| | | return success(null == rs ? 0 : rs.size(), rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "根据父ID分页查询并返回记录数") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "metaid", value = "父ID", dataType = "String", paramType = "query", example = "0"), |