新增图例接口添加查重逻辑,添加站点接口修改json文件校验逻辑等,其他修改等

This commit is contained in:
mi9688
2024-10-15 16:46:38 +08:00
parent 29a8d107b4
commit d5fa35e6dd
22 changed files with 163 additions and 574 deletions

View File

@ -1,10 +1,14 @@
package com.fastbee.data.controller.gis;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fastbee.common.utils.poi.ExcelUtil;
import com.fastbee.ggroup.domain.dto.GLegendUpdateDto;
import com.fastbee.ggroup.domain.dto.GLegendDto;
import com.fastbee.ggroup.enums.SiteTypeCategoryEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
@ -48,7 +52,7 @@ public class GLegendController extends BaseController
public TableDataInfo list(GLegend gLegend)
{
startPage();
List<GLegendDto> list = gLegendService.selectGLegendList(gLegend);
List<GLegend> list = gLegendService.selectGLegendList(gLegend);
return getDataTable(list);
}
@ -60,8 +64,8 @@ public class GLegendController extends BaseController
@PostMapping("/export")
public void export(HttpServletResponse response, GLegend gLegend)
{
List<GLegendDto> list = gLegendService.selectGLegendList(gLegend);
ExcelUtil<GLegendDto> util = new ExcelUtil<GLegendDto>(GLegendDto.class);
List<GLegend> list = gLegendService.selectGLegendList(gLegend);
ExcelUtil<GLegend> util = new ExcelUtil<GLegend>(GLegend.class);
util.exportExcel(response, list, "图例数据");
}
@ -93,7 +97,7 @@ public class GLegendController extends BaseController
@PreAuthorize("@ss.hasPermi('ggroup:legend:edit')")
@PutMapping
@ApiOperation("修改图例")
public AjaxResult edit(@RequestBody GLegendUpdateDto gLegend)
public AjaxResult edit(@RequestBody GLegend gLegend)
{
return toAjax(gLegendService.updateGLegend(gLegend));
}
@ -119,7 +123,22 @@ public class GLegendController extends BaseController
return success(gLegendService.getLegendListByCategory());
}
/**
*获取图例的类别列表
*/
@PreAuthorize("@ss.hasPermi('ggroup:type:category')")
@GetMapping(value = "/category/list")
@ApiOperation("获取图例的类别列表")
public AjaxResult typeList()
{
List<Map<String, Object>> labelList = new ArrayList<>();
for (SiteTypeCategoryEnum categoryEnum : SiteTypeCategoryEnum.values()) {
Map<String, Object> map = new HashMap<>();
map.put("name", categoryEnum.getName());
labelList.add(map);
}
return AjaxResult.success(labelList);
}

View File

@ -1,90 +0,0 @@
package com.fastbee.data.controller.gis;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import com.fastbee.ggroup.enums.GroupTagEnum;
import com.fastbee.ggroup.enums.SiteTypeCategoryEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.fastbee.common.annotation.Log;
import com.fastbee.common.core.controller.BaseController;
import com.fastbee.common.core.domain.AjaxResult;
import com.fastbee.common.enums.BusinessType;
import com.fastbee.ggroup.domain.GLegendType;
import com.fastbee.ggroup.service.IGLegendTypeService;
import com.fastbee.common.utils.poi.ExcelUtil;
import com.fastbee.common.core.page.TableDataInfo;
/**
* 图例类型Controller
*
* @author kerwincui
* @date 2024-10-09
*/
@RestController
@RequestMapping("/gis/legend/type")
@Api(tags = "图例类型")
public class GLegendTypeController extends BaseController
{
@Autowired
private IGLegendTypeService gLegendTypeService;
/**
* 查询图例类型列表
*/
@PreAuthorize("@ss.hasPermi('ggroup:type:list')")
@GetMapping("/list")
@ApiOperation("查询图例类型列表")
public TableDataInfo list(GLegendType gLegendType)
{
startPage();
List<GLegendType> list = gLegendTypeService.selectGLegendTypeList(gLegendType);
return getDataTable(list);
}
/**
* 获取图例类型详细信息
*/
@PreAuthorize("@ss.hasPermi('ggroup:type:info')")
@GetMapping(value = "/{id}")
@ApiOperation("获取图例类型详细信息")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(gLegendTypeService.selectGLegendTypeById(id));
}
/**
*获取图例的类别列表
*/
@PreAuthorize("@ss.hasPermi('ggroup:type:category')")
@GetMapping(value = "/category/list")
@ApiOperation("获取图例的类别列表")
public AjaxResult typeList()
{
List<Map<String, Object>> labelList = new ArrayList<>();
for (SiteTypeCategoryEnum categoryEnum : SiteTypeCategoryEnum.values()) {
Map<String, Object> map = new HashMap<>();
map.put("name", categoryEnum.getName());
labelList.add(map);
}
return AjaxResult.success(labelList);
}
}