代码注释补充,冗余删除,mapper找不到报错解决等

This commit is contained in:
mi9688
2024-10-22 11:06:15 +08:00
parent 655e22579c
commit 135a5e295d
22 changed files with 266 additions and 418 deletions

View File

@ -10,20 +10,17 @@ import com.fastbee.ggroup.enums.GroupTagEnum;
import com.fastbee.ggroup.service.IGGroupsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
import static java.util.stream.Collectors.toList;
/**
* 组Controller
*
* @author kerwincui
* @date 2024-09-27
* @date 2024-09-27
*/
@RestController
@RequestMapping("/gis/groups")
@ -31,8 +28,10 @@ import static java.util.stream.Collectors.toList;
@PreAuthorize("@ss.hasPermi('ggroup:groups')")
public class GGroupsController extends BaseController
{
@Autowired
private IGGroupsService gGroupsService;
private final IGGroupsService gGroupsService;
public GGroupsController(IGGroupsService gGroupsService) {
this.gGroupsService = gGroupsService;
}
/**
* 查询组树状结构列表
@ -43,6 +42,7 @@ public class GGroupsController extends BaseController
{
return success(gGroupsService.selectGGroupsList(gGroups));
}
/**
* 查询组带叶子节点树状列表
*/
@ -52,7 +52,6 @@ public class GGroupsController extends BaseController
return success(gGroupsService.selectGGroupsAndSitesList(gGroups));
}
/**
* 查询组下面的直属站点
*/
@ -65,23 +64,19 @@ public class GGroupsController extends BaseController
return super.getDataTable(list);
}
/**
* 获取组的标签(类别)
*/
@GetMapping("/list-label")
@ApiOperation("获取组的标签(类别)")
public AjaxResult listLabel() {
// 使用传统的方式将枚举转换为列表
List<Map<String, Object>> labelList = new ArrayList<>();
for (GroupTagEnum tag : GroupTagEnum.values()) {
Map<String, Object> map = new HashMap<>();
map.put("code", tag.getCode());
map.put("value", tag.getDescription());
labelList.add(map);
}
return AjaxResult.success(labelList);
}
@ -93,7 +88,7 @@ public class GGroupsController extends BaseController
public void export(HttpServletResponse response, GGroups gGroups)
{
List<GGroups> list = gGroupsService.selectGGroupsList(gGroups);
ExcelUtil<GGroups> util = new ExcelUtil<GGroups>(GGroups.class);
ExcelUtil<GGroups> util = new ExcelUtil<>(GGroups.class);
util.exportExcel(response, list, "组数据");
}

View File

@ -6,13 +6,10 @@ 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;
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;
@ -33,7 +30,7 @@ import javax.servlet.http.HttpServletResponse;
* 图例Controller
*
* @author kerwincui
* @date 2024-10-08
* &#064;date 2024-10-08
*/
@RestController
@RequestMapping("/gis/legend")
@ -41,14 +38,18 @@ import javax.servlet.http.HttpServletResponse;
@PreAuthorize("@ss.hasPermi('ggroup:legend')")
public class GLegendController extends BaseController
{
@Autowired
private IGLegendService gLegendService;
/**
* 查询/搜索图例列表
*/
@GetMapping("/list")
@ApiOperation("查询图例列表")
private final IGLegendService gLegendService;
public GLegendController(IGLegendService gLegendService) {
this.gLegendService = gLegendService;
}
/**
* 查询/搜索图例列表
*/
@GetMapping("/list")
@ApiOperation("查询图例列表")
public TableDataInfo list(GLegend gLegend)
{
startPage();
@ -64,7 +65,7 @@ public class GLegendController extends BaseController
public void export(HttpServletResponse response, GLegend gLegend)
{
List<GLegend> list = gLegendService.selectGLegendList(gLegend);
ExcelUtil<GLegend> util = new ExcelUtil<GLegend>(GLegend.class);
ExcelUtil<GLegend> util = new ExcelUtil<>(GLegend.class);
util.exportExcel(response, list, "图例数据");
}
@ -113,12 +114,12 @@ public class GLegendController extends BaseController
*/
@GetMapping("/category-list")
@ApiOperation("获取图例按照类别划分列表")
public AjaxResult listByCategory(GLegend gLegend){
public AjaxResult listByCategory(){
return success(gLegendService.getLegendListByCategory());
}
/**
*获取图例的类别列表
* 获取图例的类别列表
*/
@GetMapping(value = "/category/list")
@ApiOperation("获取图例的类别列表")
@ -133,6 +134,4 @@ public class GLegendController extends BaseController
return AjaxResult.success(labelList);
}
}

View File

@ -6,7 +6,6 @@ import javax.servlet.http.HttpServletResponse;
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;
@ -15,10 +14,8 @@ 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.GSiteInfo;
import com.fastbee.ggroup.service.IGSiteInfoService;
import com.fastbee.common.utils.poi.ExcelUtil;
@ -28,7 +25,7 @@ import com.fastbee.common.core.page.TableDataInfo;
* 站点基础信息Controller
*
* @author kerwincui
* @date 2024-10-10
* &#064;date 2024-10-10
*/
@RestController
@RequestMapping("/gis/site/info")
@ -36,14 +33,18 @@ import com.fastbee.common.core.page.TableDataInfo;
@Api(tags = "站点基础信息")
public class GSiteInfoController extends BaseController
{
@Autowired
private IGSiteInfoService gSiteInfoService;
/**
* 查询站点基础信息列表
*/
@GetMapping("/list")
@ApiOperation("查询站点基础信息列表")
private final IGSiteInfoService gSiteInfoService;
public GSiteInfoController(IGSiteInfoService gSiteInfoService) {
this.gSiteInfoService = gSiteInfoService;
}
/**
* 查询站点基础信息列表
*/
@GetMapping("/list")
@ApiOperation("查询站点基础信息列表")
public TableDataInfo list(GSiteInfo gSiteInfo)
{
startPage();
@ -59,7 +60,7 @@ public class GSiteInfoController extends BaseController
public void export(HttpServletResponse response, GSiteInfo gSiteInfo)
{
List<GSiteInfo> list = gSiteInfoService.selectGSiteInfoList(gSiteInfo);
ExcelUtil<GSiteInfo> util = new ExcelUtil<GSiteInfo>(GSiteInfo.class);
ExcelUtil<GSiteInfo> util = new ExcelUtil<>(GSiteInfo.class);
util.exportExcel(response, list, "站点基础信息数据");
}

View File

@ -1,8 +1,8 @@
package com.fastbee.data.controller.gis;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.fastbee.common.utils.poi.ExcelUtil;
import com.fastbee.ggroup.domain.dto.GGroupSiteDto;
import com.fastbee.ggroup.domain.dto.GGroupSiteRelateDto;
import com.fastbee.ggroup.domain.dto.GSitesEditDto;
@ -10,7 +10,6 @@ import com.fastbee.ggroup.domain.dto.GSitesSelectDto;
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;
@ -19,20 +18,19 @@ 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.GSites;
import com.fastbee.ggroup.service.IGSitesService;
import com.fastbee.common.utils.poi.ExcelUtil;
import com.fastbee.common.core.page.TableDataInfo;
import javax.servlet.http.HttpServletResponse;
/**
* 站点Controller
*
* @author kerwincui
* @date 2024-09-29
* &#064;date 2024-09-29
*/
@RestController
@RequestMapping("/gis/sites")
@ -40,44 +38,47 @@ import com.fastbee.common.core.page.TableDataInfo;
@PreAuthorize("@ss.hasPermi('ggroup:groups')")
public class GSitesController extends BaseController
{
@Autowired
private IGSitesService gSitesService;
/**
* 查询/搜索站点列表
*/
private final IGSitesService gSitesService;
@GetMapping("/list")
@ApiOperation("查询站点列表")
public GSitesController(IGSitesService gSitesService) {
this.gSitesService = gSitesService;
}
/**
* 查询/搜索站点列表
*/
@GetMapping("/list")
@ApiOperation("查询站点列表")
public TableDataInfo list(GSitesSelectDto gSites)
{
startPage();
List<?> list = gSitesService.selectGSitesList(gSites);
List<GSites> list = gSitesService.selectGSitesList(gSites);
return getDataTable(list);
}
/**
* 站点关联组
*/
@PostMapping("/relate")
@ApiOperation("站点关联组")
public AjaxResult relate(@RequestBody GGroupSiteRelateDto gGroupSiteRelateDto){
return toAjax(gSitesService.relateGroup(gGroupSiteRelateDto));
}
// /**
// * 导出站点列表
// */
// @ApiOperation("导出站点列表")
// @PreAuthorize("@ss.hasPermi('ggroup:sites:export')")
// @PostMapping("/export")
// public void export(HttpServletResponse response, GSitesSelectDto gSites)
// {
// List<GSites> list = gSitesService.selectGSitesList(gSites);
// ExcelUtil<GSites> util = new ExcelUtil<GSites>(GSites.class);
// util.exportExcel(response, list, "站点数据");
// }
/**
* 导出站点列表
*/
@ApiOperation("导出站点列表")
@PreAuthorize("@ss.hasPermi('ggroup:sites:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, GSitesSelectDto gSites)
{
List<GSites> list = gSitesService.selectGSitesList(gSites);
ExcelUtil<GSites> util = new ExcelUtil<>(GSites.class);
util.exportExcel(response, list, "站点数据");
}
/**
* 获取站点详细信息
@ -120,7 +121,7 @@ public class GSitesController extends BaseController
/**
* 删除站点
* 批量删除站点
*/
@DeleteMapping("/batch/{ids}")
@ApiOperation("删除站点")

View File

@ -12,7 +12,6 @@ import com.fastbee.project.service.IProjectService;
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;
@ -29,18 +28,22 @@ import com.fastbee.common.core.page.TableDataInfo;
* 项目Controller
*
* @author kerwincui
* @date 2024-09-26
* &#064;date 2024-09-26
*/
@RestController
@RequestMapping("/project")
@Api(tags = "项目")
public class ProjectController extends BaseController
{
@Autowired
private IProjectService projectService;
private final IProjectService projectService;
public ProjectController(IProjectService projectService) {
this.projectService = projectService;
}
/**
* 查询项目列表
* 查询/搜索项目列表
*/
@PreAuthorize("@ss.hasPermi('iot:project:list')")
@GetMapping("/list")
@ -53,9 +56,8 @@ public class ProjectController extends BaseController
}
/**
* 获取项目信息
* 获取管理员所管理的项目id以及子项目id列表
*/
// @PreAuthorize("@ss.hasPermi('iot:project:query')")
@GetMapping("/info/{userId}")
@ApiOperation("获取项目信息")
public AjaxResult getProjectInfo(@PathVariable("userId") Long userId){