Merge branch 'main' of ssh://192.168.1.205:9922/cf_devdept2/cf_imes_server

This commit is contained in:
lym
2024-03-22 10:34:30 +08:00
7 changed files with 1140 additions and 0 deletions
@@ -1,5 +1,6 @@
package com.cf.imes.module.system.controller.admin.datasource; package com.cf.imes.module.system.controller.admin.datasource;
import io.swagger.v3.oas.annotations.media.Schema;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
@@ -79,6 +80,15 @@ public class DataSourceController {
return success(BeanUtils.toBean(pageResult, DataSourceRespVO.class)); return success(BeanUtils.toBean(pageResult, DataSourceRespVO.class));
} }
@GetMapping("/list")
@Operation(summary = "获得系统数据源列表")
@Parameter(name = "type", description = "类型", required = false)
@PreAuthorize("@ss.hasPermission('system:data-source:query')")
public CommonResult<List<DataSourceRespVO>> list( @RequestParam(value = "type", required = false) Integer type) {
List<DataSourceDO> list = dataSourceService.list(type);
return success(BeanUtils.toBean(list, DataSourceRespVO.class));
}
@GetMapping("/export-excel") @GetMapping("/export-excel")
@Operation(summary = "导出系统数据源 Excel") @Operation(summary = "导出系统数据源 Excel")
@PreAuthorize("@ss.hasPermission('system:data-source:export')") @PreAuthorize("@ss.hasPermission('system:data-source:export')")
@@ -77,6 +77,14 @@ public class LabelController {
return success(BeanUtils.toBean(pageResult, LabelRespVO.class)); return success(BeanUtils.toBean(pageResult, LabelRespVO.class));
} }
@GetMapping("list")
@Operation(summary = "获得标签列表")
@Parameter(name = "type", description = "类型", required = false, example = "1024")
@PreAuthorize("@ss.hasPermission('system:label:query')")
public CommonResult<List<LabelRespVO>> getLabel(@RequestParam("type") String type) {
return success(BeanUtils.toBean(labelService.list(type), LabelRespVO.class));
}
@GetMapping("/group-list") @GetMapping("/group-list")
@Operation(summary = "获得分组标签列表") @Operation(summary = "获得分组标签列表")
@PreAuthorize("@ss.hasPermission('system:label:query')") @PreAuthorize("@ss.hasPermission('system:label:query')")
@@ -53,4 +53,5 @@ public interface DataSourceService {
*/ */
PageResult<DataSourceDO> getDataSourcePage(DataSourcePageReqVO pageReqVO); PageResult<DataSourceDO> getDataSourcePage(DataSourcePageReqVO pageReqVO);
List<DataSourceDO> list(Integer type);
} }
@@ -1,5 +1,6 @@
package com.cf.imes.module.system.service.datasource; package com.cf.imes.module.system.service.datasource;
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@@ -69,4 +70,9 @@ public class DataSourceServiceImpl implements DataSourceService {
return dataSourceMapper.selectPage(pageReqVO); return dataSourceMapper.selectPage(pageReqVO);
} }
@Override
public List<DataSourceDO> list(Integer type) {
return dataSourceMapper.selectList(new LambdaQueryWrapperX<DataSourceDO>().eqIfPresent(DataSourceDO::getType, type));
}
} }
@@ -68,4 +68,6 @@ public interface LabelService {
List<LabelElementRespVO> getLabelElementListByLabelId(Long LabelId); List<LabelElementRespVO> getLabelElementListByLabelId(Long LabelId);
Map<String, List<LabelRespVO>> getGroupList(); Map<String, List<LabelRespVO>> getGroupList();
List<LabelDO> list(String type);
} }
@@ -239,6 +239,11 @@ public class LabelServiceImpl implements LabelService {
return LabelRespVOS.stream().collect(Collectors.groupingBy(e -> e.getType())); return LabelRespVOS.stream().collect(Collectors.groupingBy(e -> e.getType()));
} }
@Override
public List<LabelDO> list(String type) {
return LabelMapper.selectList(new LambdaQueryWrapperX<LabelDO>().eqIfPresent(LabelDO::getType, type));
}
private void createLabelElementList(Long LabelId, List<LabelElementDO> list) { private void createLabelElementList(Long LabelId, List<LabelElementDO> list) {
list.forEach(o -> o.setLabelId(LabelId)); list.forEach(o -> o.setLabelId(LabelId));
labelElementMapper.insertBatch(list); labelElementMapper.insertBatch(list);