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; } src/main/java/org/springblade/modules/remoteType/controller/TypeController.java
New file @@ -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()); } } src/main/java/org/springblade/modules/remoteType/dto/TypeDTO.java
New file @@ -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; } src/main/java/org/springblade/modules/remoteType/entity/Type.java
New file @@ -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; } src/main/java/org/springblade/modules/remoteType/mapper/TypeMapper.java
New file @@ -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(); } src/main/java/org/springblade/modules/remoteType/mapper/TypeMapper.xml
New file @@ -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> src/main/java/org/springblade/modules/remoteType/service/ITypeService.java
New file @@ -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(); } src/main/java/org/springblade/modules/remoteType/service/impl/TypeServiceImpl.java
New file @@ -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(); } } src/main/java/org/springblade/modules/remoteType/vo/TypeVO.java
New file @@ -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; }