From d8c0e22526e6662b41abd9330c18f2cc881183ef Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Mon, 19 Sep 2022 17:26:37 +0800
Subject: [PATCH] 添加遥感类型
---
src/main/java/org/springblade/common/config/BladeConfiguration.java | 1
src/main/java/org/springblade/modules/remoteType/dto/TypeDTO.java | 38 ++++
src/main/java/org/springblade/modules/remoteType/service/impl/TypeServiceImpl.java | 50 ++++++
src/main/java/org/springblade/modules/remoteType/mapper/TypeMapper.java | 46 +++++
src/main/java/org/springblade/modules/remoteType/service/ITypeService.java | 45 +++++
src/main/java/org/springblade/modules/remoteType/mapper/TypeMapper.xml | 38 ++++
src/main/java/org/springblade/modules/remoteType/vo/TypeVO.java | 34 ++++
src/main/java/org/springblade/modules/remoteType/controller/TypeController.java | 135 ++++++++++++++++
src/main/java/org/springblade/modules/remoteType/entity/Type.java | 52 ++++++
9 files changed, 439 insertions(+), 0 deletions(-)
diff --git a/src/main/java/org/springblade/common/config/BladeConfiguration.java b/src/main/java/org/springblade/common/config/BladeConfiguration.java
index c3e0ed7..ece6c47 100644
--- a/src/main/java/org/springblade/common/config/BladeConfiguration.java
+++ b/src/main/java/org/springblade/common/config/BladeConfiguration.java
@@ -68,6 +68,7 @@
secureRegistry.excludePathPatterns("/machining/machining/**");
secureRegistry.excludePathPatterns("/stockrecord/stockrecord/**");
secureRegistry.excludePathPatterns("/retrieval/retrieval/**");
+ secureRegistry.excludePathPatterns("/remoteType/type/**");
secureRegistry.excludePathPatterns("/blade-resource/oss/endpoint/**");
return secureRegistry;
}
diff --git a/src/main/java/org/springblade/modules/remoteType/controller/TypeController.java b/src/main/java/org/springblade/modules/remoteType/controller/TypeController.java
new file mode 100644
index 0000000..8f62855
--- /dev/null
+++ b/src/main/java/org/springblade/modules/remoteType/controller/TypeController.java
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.remoteType.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+
+import org.springblade.modules.remoteType.entity.Type;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestParam;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.modules.remoteType.vo.TypeVO;
+import org.springblade.modules.remoteType.service.ITypeService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 控制器
+ *
+ * @author BladeX
+ * @since 2022-09-19
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/remoteType/type")
+@Api(value = "", tags = "接口")
+public class TypeController extends BladeController {
+
+ private final ITypeService typeService;
+
+ /**
+ * 详情
+ */
+ @GetMapping("/detail")
+ @ApiOperationSupport(order = 1)
+ @ApiOperation(value = "详情", notes = "传入type")
+ public R<Type> detail(Type type) {
+ Type detail = typeService.getOne(Condition.getQueryWrapper(type));
+ return R.data(detail);
+ }
+
+ /**
+ * 分页
+ */
+ @GetMapping("/list")
+ @ApiOperationSupport(order = 2)
+ @ApiOperation(value = "分页", notes = "传入type")
+ public R<IPage<Type>> list(Type type, Query query) {
+ IPage<Type> pages = typeService.page(Condition.getPage(query), Condition.getQueryWrapper(type));
+ return R.data(pages);
+ }
+
+ /**
+ * 自定义分页
+ */
+ @GetMapping("/page")
+ @ApiOperationSupport(order = 3)
+ @ApiOperation(value = "分页", notes = "传入type")
+ public R<IPage<TypeVO>> page(TypeVO type, Query query) {
+ IPage<TypeVO> pages = typeService.selectTypePage(Condition.getPage(query), type);
+ return R.data(pages);
+ }
+
+ /**
+ * 新增
+ */
+ @PostMapping("/save")
+ @ApiOperationSupport(order = 4)
+ @ApiOperation(value = "新增", notes = "传入type")
+ public R save(@Valid @RequestBody Type type) {
+ return R.status(typeService.save(type));
+ }
+
+ /**
+ * 修改
+ */
+ @PostMapping("/update")
+ @ApiOperationSupport(order = 5)
+ @ApiOperation(value = "修改", notes = "传入type")
+ public R update(@Valid @RequestBody Type type) {
+ return R.status(typeService.updateById(type));
+ }
+
+ /**
+ * 新增或修改
+ */
+ @PostMapping("/submit")
+ @ApiOperationSupport(order = 6)
+ @ApiOperation(value = "新增或修改", notes = "传入type")
+ public R submit(@Valid @RequestBody Type type) {
+ return R.status(typeService.saveOrUpdate(type));
+ }
+
+
+ /**
+ * 删除
+ */
+ @PostMapping("/remove")
+ @ApiOperationSupport(order = 7)
+ @ApiOperation(value = "逻辑删除", notes = "传入ids")
+ public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+ return R.status(typeService.deleteLogic(Func.toLongList(ids)));
+ }
+
+ /**
+ * 获取遥感数据+类型数据
+ */
+ @PostMapping("/getRemoteDetailsList")
+ public R getRemoteDetailsList(){
+ return R.data(typeService.getRemoteDetailsList());
+ }
+
+}
diff --git a/src/main/java/org/springblade/modules/remoteType/dto/TypeDTO.java b/src/main/java/org/springblade/modules/remoteType/dto/TypeDTO.java
new file mode 100644
index 0000000..161b39d
--- /dev/null
+++ b/src/main/java/org/springblade/modules/remoteType/dto/TypeDTO.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.remoteType.dto;
+
+import org.springblade.modules.remote.entity.Remote;
+import org.springblade.modules.remoteType.entity.Type;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.List;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2022-09-19
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class TypeDTO extends Type {
+ private static final long serialVersionUID = 1L;
+
+ List<Remote> remoteList;
+}
diff --git a/src/main/java/org/springblade/modules/remoteType/entity/Type.java b/src/main/java/org/springblade/modules/remoteType/entity/Type.java
new file mode 100644
index 0000000..9d81858
--- /dev/null
+++ b/src/main/java/org/springblade/modules/remoteType/entity/Type.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.remoteType.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import org.springblade.core.mp.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2022-09-19
+ */
+@Data
+@TableName("sys_remote_type")
+@EqualsAndHashCode(callSuper = true)
+public class Type extends BaseEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 名称
+ */
+ private String name;
+ /**
+ * 经度
+ */
+ private String longitude;
+ /**
+ * 纬度
+ */
+ private String latitude;
+
+
+}
diff --git a/src/main/java/org/springblade/modules/remoteType/mapper/TypeMapper.java b/src/main/java/org/springblade/modules/remoteType/mapper/TypeMapper.java
new file mode 100644
index 0000000..d160887
--- /dev/null
+++ b/src/main/java/org/springblade/modules/remoteType/mapper/TypeMapper.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.remoteType.mapper;
+
+import org.springblade.modules.remote.dto.RemoteDTO;
+import org.springblade.modules.remoteType.dto.TypeDTO;
+import org.springblade.modules.remoteType.entity.Type;
+import org.springblade.modules.remoteType.vo.TypeVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * Mapper 接口
+ *
+ * @author BladeX
+ * @since 2022-09-19
+ */
+public interface TypeMapper extends BaseMapper<Type> {
+
+ /**
+ * 自定义分页
+ *
+ * @param page
+ * @param type
+ * @return
+ */
+ List<TypeVO> selectTypePage(IPage page, TypeVO type);
+
+ List<TypeDTO> getRemoteDetailsList();
+
+}
diff --git a/src/main/java/org/springblade/modules/remoteType/mapper/TypeMapper.xml b/src/main/java/org/springblade/modules/remoteType/mapper/TypeMapper.xml
new file mode 100644
index 0000000..44e0465
--- /dev/null
+++ b/src/main/java/org/springblade/modules/remoteType/mapper/TypeMapper.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.remoteType.mapper.TypeMapper">
+
+ <!-- 通用查询映射结果 -->
+ <resultMap id="typeResultMap" type="org.springblade.modules.remoteType.entity.Type">
+ <result column="id" property="id"/>
+ <result column="name" property="name"/>
+ <result column="longtitude" property="longtitude"/>
+ <result column="latitude" property="latitude"/>
+ </resultMap>
+
+
+ <select id="selectTypePage" resultMap="typeResultMap">
+ select * from sys_remote_type where is_deleted = 0
+ </select>
+
+ <resultMap id="typeDTO" type="org.springblade.modules.remoteType.dto.TypeDTO">
+ <id column="id" property="id" jdbcType="INTEGER"/>
+ <result column="name" property="name" jdbcType="VARCHAR"/>
+ <result column="longitude" property="longitude" jdbcType="VARCHAR"/>
+ <result column="latitude" property="latitude" jdbcType="VARCHAR"/>
+ <collection property="remoteList" javaType="java.util.List" ofType="org.springblade.modules.remote.entity.Remote">
+ <result column="rid" property="id"/>
+ <result column="re_name" property="reName"/>
+ <result column="re_url" property="reUrl"/>
+ </collection>
+ </resultMap>
+
+ <select id="getRemoteDetailsList" resultMap="typeDTO">
+ select t.id,t.name,t.longitude,t.latitude,r.id rid,r.re_name,r.re_url
+ FROM sys_remote_type t
+ LEFT JOIN sys_remote r ON r.type = t.id
+ WHERE r.is_deleted = 0
+ </select>
+
+
+</mapper>
diff --git a/src/main/java/org/springblade/modules/remoteType/service/ITypeService.java b/src/main/java/org/springblade/modules/remoteType/service/ITypeService.java
new file mode 100644
index 0000000..0202ecd
--- /dev/null
+++ b/src/main/java/org/springblade/modules/remoteType/service/ITypeService.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.remoteType.service;
+
+import org.springblade.modules.remoteType.dto.TypeDTO;
+import org.springblade.modules.remoteType.entity.Type;
+import org.springblade.modules.remoteType.vo.TypeVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
+
+/**
+ * 服务类
+ *
+ * @author BladeX
+ * @since 2022-09-19
+ */
+public interface ITypeService extends BaseService<Type> {
+
+ /**
+ * 自定义分页
+ *
+ * @param page
+ * @param type
+ * @return
+ */
+ IPage<TypeVO> selectTypePage(IPage<TypeVO> page, TypeVO type);
+
+ List<TypeDTO> getRemoteDetailsList();
+}
diff --git a/src/main/java/org/springblade/modules/remoteType/service/impl/TypeServiceImpl.java b/src/main/java/org/springblade/modules/remoteType/service/impl/TypeServiceImpl.java
new file mode 100644
index 0000000..2e2e0e4
--- /dev/null
+++ b/src/main/java/org/springblade/modules/remoteType/service/impl/TypeServiceImpl.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.remoteType.service.impl;
+
+import org.springblade.modules.remote.dto.RemoteDTO;
+import org.springblade.modules.remoteType.dto.TypeDTO;
+import org.springblade.modules.remoteType.entity.Type;
+import org.springblade.modules.remoteType.vo.TypeVO;
+import org.springblade.modules.remoteType.mapper.TypeMapper;
+import org.springblade.modules.remoteType.service.ITypeService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
+
+/**
+ * 服务实现类
+ *
+ * @author BladeX
+ * @since 2022-09-19
+ */
+@Service
+public class TypeServiceImpl extends BaseServiceImpl<TypeMapper, Type> implements ITypeService {
+
+ @Override
+ public IPage<TypeVO> selectTypePage(IPage<TypeVO> page, TypeVO type) {
+ return page.setRecords(baseMapper.selectTypePage(page, type));
+ }
+
+ @Override
+ public List<TypeDTO> getRemoteDetailsList() {
+ return baseMapper.getRemoteDetailsList();
+ }
+
+}
diff --git a/src/main/java/org/springblade/modules/remoteType/vo/TypeVO.java b/src/main/java/org/springblade/modules/remoteType/vo/TypeVO.java
new file mode 100644
index 0000000..39c4bd6
--- /dev/null
+++ b/src/main/java/org/springblade/modules/remoteType/vo/TypeVO.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.remoteType.vo;
+
+import org.springblade.modules.remoteType.entity.Type;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2022-09-19
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class TypeVO extends Type {
+ private static final long serialVersionUID = 1L;
+
+}
--
Gitblit v1.9.3