Commit a8905475 authored by 郭凡凡's avatar 郭凡凡

Merge remote-tracking branch 'origin/master'

parents ad30a304 873cefa5
...@@ -94,7 +94,7 @@ public class ModelBaseController { ...@@ -94,7 +94,7 @@ public class ModelBaseController {
*/ */
@ApiOperation("模型-查询列表") @ApiOperation("模型-查询列表")
@GetMapping("/get/model/getModeBaselList") @GetMapping("/get/model/getModeBaselList")
public ResponseVO getModeBaselList(@ApiParam(value = "所属级别") @RequestParam(value = "belongLevel", required = false) String belongLevel, public ResponseVO getModeBaselList(@ApiParam(value = "所属级别") @RequestParam(value = "belongLevel",defaultValue = "0") String belongLevel,
@ApiParam(value = "模型编码") @RequestParam(value = "modelCode", required = false) String modelCode, @ApiParam(value = "模型编码") @RequestParam(value = "modelCode", required = false) String modelCode,
@ApiParam(value = "当前页") @RequestParam(value = "currentPage") Integer currentPage, @ApiParam(value = "当前页") @RequestParam(value = "currentPage") Integer currentPage,
@ApiParam(value = "每页数量") @RequestParam(value = "pageSize") Integer pageSize, @ApiParam(value = "每页数量") @RequestParam(value = "pageSize") Integer pageSize,
......
...@@ -41,5 +41,5 @@ public interface OcpApiTreeMapper extends BaseMapper<OcpApiGroup> { ...@@ -41,5 +41,5 @@ public interface OcpApiTreeMapper extends BaseMapper<OcpApiGroup> {
OcpApiGroup selectCode(String code); OcpApiGroup selectCode(String code);
//根据code查询是否含有下级服务 //根据code查询是否含有下级服务
List<OcpApiGroup> selectGrpPcode(); List<OcpApiGroup> selectGroupPcode(String apiGroupCode);
} }
...@@ -119,13 +119,18 @@ public class ModelSubscribeServiceImpl implements ModelSubscribeService { ...@@ -119,13 +119,18 @@ public class ModelSubscribeServiceImpl implements ModelSubscribeService {
return ResponseVO.ok(result); return ResponseVO.ok(result);
} }
/**
* 合并list设置子类
* @param modelGroupList
* @param organList
* @param function
* @return
*/
private List<TreeNode> setChildren(List<TreeNode> modelGroupList, List<TreeNode> organList, BiFunction<TreeNode,TreeNode,Boolean> function) { private List<TreeNode> setChildren(List<TreeNode> modelGroupList, List<TreeNode> organList, BiFunction<TreeNode,TreeNode,Boolean> function) {
organList.forEach(org organList.forEach(org -> {
->{ modelGroupList.forEach(group -> {
modelGroupList.forEach(group->{ if (function.apply(org, group)) {
//org.getCompanyCode().equals(group.getCompanyCode() if (org.getChildren() == null) {
if (function.apply(org,group)){
if(org.getChildren() == null){
org.setChildren(new LinkedList<>()); org.setChildren(new LinkedList<>());
} }
org.getChildren().add(group); org.getChildren().add(group);
......
...@@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Stream; import java.util.stream.Stream;
...@@ -51,7 +52,13 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper, OcpApiG ...@@ -51,7 +52,13 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper, OcpApiG
if (!("".equals(apiGroupPromotionType)) && StringUtils.isBlank(apiGroupCode)) { if (!("".equals(apiGroupPromotionType)) && StringUtils.isBlank(apiGroupCode)) {
List<OcpApiGroup> ocpApiGroups = mapper.selectTwoApiGroups(apiGroupPromotionType); List<OcpApiGroup> ocpApiGroups = mapper.selectTwoApiGroups(apiGroupPromotionType);
return ocpApiGroups; List<OcpApiGroup> ocpApiGrouplist = new ArrayList<>();
for (OcpApiGroup ocpApiGroup : ocpApiGroups) {
if (StringUtils.isBlank(ocpApiGroup.getApiGroupPcode())){
ocpApiGrouplist.add(ocpApiGroup);
}
}
return ocpApiGrouplist;
} else if (!("".equals(apiGroupPromotionType)) && !(StringUtils.isBlank(apiGroupCode))) { } else if (!("".equals(apiGroupPromotionType)) && !(StringUtils.isBlank(apiGroupCode))) {
List<OcpApiGroup> ocpApiGroups = mapper.selectThreeApiGroupsList(apiGroupPromotionType, apiGroupCode); List<OcpApiGroup> ocpApiGroups = mapper.selectThreeApiGroupsList(apiGroupPromotionType, apiGroupCode);
return ocpApiGroups; return ocpApiGroups;
...@@ -138,7 +145,7 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper, OcpApiG ...@@ -138,7 +145,7 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper, OcpApiG
queryWrapper.eq(OcpApiGroup::getApiGroupPcode, ocpApiGroup.getApiGroupCode()); queryWrapper.eq(OcpApiGroup::getApiGroupPcode, ocpApiGroup.getApiGroupCode());
String objId = ocpApiGroup.getObjId(); String objId = ocpApiGroup.getObjId();
List<OcpApiGroup> list = mapper.selectGrpPcode(); List<OcpApiGroup> list = mapper.selectGroupPcode(ocpApiGroup.getApiGroupCode());
if (list.size() >= 1) { if (list.size() >= 1) {
flag = false; flag = false;
} }
...@@ -178,10 +185,17 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper, OcpApiG ...@@ -178,10 +185,17 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper, OcpApiG
} }
} else if (StringUtils.isNotBlank(pageGroupDto.getKeyword())) { } else if (StringUtils.isNotBlank(pageGroupDto.getKeyword())) {
if (StringUtils.isBlank(pageGroupDto.getApiGroupCode())){
LambdaQueryWrapper<OcpApiGroup> ocpTenantGroupLambdaQueryWrapper = qw.and(c -> c.like(OcpApiGroup::getApiGroupName, pageGroupDto.getKeyword()))
.and(c->c.eq(OcpApiGroup::getApiGroupPromotionType,pageGroupDto.getApiGroupPromotionType()));
mapper.selectPage(pageInfo, ocpTenantGroupLambdaQueryWrapper);
}else if (StringUtils.isNotBlank(pageGroupDto.getApiGroupCode())) {
LambdaQueryWrapper<OcpApiGroup> ocpTenantGroupLambdaQueryWrapper = qw.and(c -> c.like(OcpApiGroup::getApiGroupName, pageGroupDto.getKeyword())) LambdaQueryWrapper<OcpApiGroup> ocpTenantGroupLambdaQueryWrapper = qw.and(c -> c.like(OcpApiGroup::getApiGroupName, pageGroupDto.getKeyword()))
.and(c -> c.eq(OcpApiGroup::getApiGroupPcode, pageGroupDto.getApiGroupCode())); .and(c -> c.eq(OcpApiGroup::getApiGroupPcode, pageGroupDto.getApiGroupCode()));
mapper.selectPage(pageInfo, ocpTenantGroupLambdaQueryWrapper); mapper.selectPage(pageInfo, ocpTenantGroupLambdaQueryWrapper);
} }
}
return pageInfo; return pageInfo;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment