图例管理接口完善
This commit is contained in:
@ -54,7 +54,6 @@ public class GGroupsController extends BaseController
|
|||||||
{
|
{
|
||||||
super.startPage();
|
super.startPage();
|
||||||
List<GGroupSiteVo> list = gGroupsService.selectGGroupsListSites(gGroups);
|
List<GGroupSiteVo> list = gGroupsService.selectGGroupsListSites(gGroups);
|
||||||
list.forEach(System.err::println);
|
|
||||||
return super.getDataTable(list);
|
return super.getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ import com.fastbee.common.core.page.TableDataInfo;
|
|||||||
* @date 2024-10-08
|
* @date 2024-10-08
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/ggroup/legend")
|
@RequestMapping("/gis/legend")
|
||||||
@Api(tags = "图例")
|
@Api(tags = "图例")
|
||||||
public class GLegendController extends BaseController
|
public class GLegendController extends BaseController
|
||||||
{
|
{
|
||||||
|
@ -36,4 +36,9 @@ public class GLegend extends BaseEntity
|
|||||||
@ApiModelProperty("图标名称")
|
@ApiModelProperty("图标名称")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
/** 项目id */
|
||||||
|
@Excel(name = "项目id")
|
||||||
|
@ApiModelProperty("项目id")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.fastbee.ggroup.service.impl;
|
package com.fastbee.ggroup.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
@ -74,6 +75,7 @@ public class GSitesServiceImpl extends ServiceImpl<GSiteGroupsMapper,GSiteGroups
|
|||||||
gSites.setName(gGroupSiteDto.getName().trim());
|
gSites.setName(gGroupSiteDto.getName().trim());
|
||||||
gSites.setType(gGroupSiteDto.getType());
|
gSites.setType(gGroupSiteDto.getType());
|
||||||
gSites.setIcon(gGroupSiteDto.getIcon());
|
gSites.setIcon(gGroupSiteDto.getIcon());
|
||||||
|
gSites.setProjectId(gGroupSiteDto.getProjectId());
|
||||||
//根据名称判断是否存在该站点
|
//根据名称判断是否存在该站点
|
||||||
GSites gSites1 = gSitesMapper.selectOne(new LambdaQueryWrapper<GSites>()
|
GSites gSites1 = gSitesMapper.selectOne(new LambdaQueryWrapper<GSites>()
|
||||||
.select(GSites::getName, GSites::getId)
|
.select(GSites::getName, GSites::getId)
|
||||||
@ -97,11 +99,22 @@ public class GSitesServiceImpl extends ServiceImpl<GSiteGroupsMapper,GSiteGroups
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateGSites(GSitesEditDto gSitesEditDto) {
|
public int updateGSites(GSitesEditDto gSitesEditDto) {
|
||||||
|
//查修改前站点名称
|
||||||
|
GSites gSites = gSitesMapper.selectGSitesById(gSitesEditDto.getId());
|
||||||
|
if (Objects.isNull(gSites)) {
|
||||||
|
throw new ServiceException("修改站点不存在!");
|
||||||
|
}
|
||||||
|
//判断修改后是否和修改前一致
|
||||||
|
if(gSites.getName().trim().equals(gSitesEditDto.getName().trim())){
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
//不能有重复名字的站点
|
//不能有重复名字的站点
|
||||||
GSites gSites1 = gSitesMapper.selectOne(new LambdaQueryWrapper<GSites>()
|
GSites gSites1 = gSitesMapper.selectOne(new LambdaQueryWrapper<GSites>()
|
||||||
.select(GSites::getName, GSites::getId)
|
.select(GSites::getName, GSites::getId)
|
||||||
.eq(GSites::getName, gSitesEditDto.getName().trim()));
|
.eq(GSites::getName, gSitesEditDto.getName().trim()));
|
||||||
if (gSites1 != null) {
|
|
||||||
|
if (Objects.nonNull(gSites1)) {
|
||||||
throw new ServiceException("站点名称已存在!");
|
throw new ServiceException("站点名称已存在!");
|
||||||
}
|
}
|
||||||
GSites sites = new GSites();
|
GSites sites = new GSites();
|
||||||
@ -130,13 +143,12 @@ public class GSitesServiceImpl extends ServiceImpl<GSiteGroupsMapper,GSiteGroups
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public int deleteGSitesById(Long id) {
|
public int deleteGSitesById(Long id) {
|
||||||
GSiteGroups gSiteGroups = gSiteGroupsMapper.selectGSiteGroupsById(id);
|
GSiteGroups gSiteGroups = gSiteGroupsMapper.selectGSiteGroupsById(id);
|
||||||
if (gSiteGroups == null) {
|
if (Objects.isNull(gSiteGroups)) {
|
||||||
throw new ServiceException("站点不存在");
|
throw new ServiceException("站点不存在");
|
||||||
}
|
}
|
||||||
int deleted = gSitesMapper.deleteById(gSiteGroups.getSiteId());
|
// int deleted = gSitesMapper.deleteById(gSiteGroups.getSiteId());
|
||||||
//删除关系
|
//删除关系
|
||||||
int deleted1 = gSiteGroupsMapper.deleteById(id);
|
return gSiteGroupsMapper.deleteById(id);
|
||||||
return deleted == 1 && deleted1 == 1 ? 1 : 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user