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

Merge remote-tracking branch 'origin/master'

parents ad30a304 873cefa5
......@@ -94,7 +94,7 @@ public class ModelBaseController {
*/
@ApiOperation("模型-查询列表")
@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 = "currentPage") Integer currentPage,
@ApiParam(value = "每页数量") @RequestParam(value = "pageSize") Integer pageSize,
......
......@@ -41,5 +41,5 @@ public interface OcpApiTreeMapper extends BaseMapper<OcpApiGroup> {
OcpApiGroup selectCode(String code);
//根据code查询是否含有下级服务
List<OcpApiGroup> selectGrpPcode();
List<OcpApiGroup> selectGroupPcode(String apiGroupCode);
}
......@@ -119,13 +119,18 @@ public class ModelSubscribeServiceImpl implements ModelSubscribeService {
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) {
organList.forEach(org
->{
modelGroupList.forEach(group->{
//org.getCompanyCode().equals(group.getCompanyCode()
if (function.apply(org,group)){
if(org.getChildren() == null){
organList.forEach(org -> {
modelGroupList.forEach(group -> {
if (function.apply(org, group)) {
if (org.getChildren() == null) {
org.setChildren(new LinkedList<>());
}
org.getChildren().add(group);
......
......@@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;
......@@ -51,7 +52,13 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper, OcpApiG
if (!("".equals(apiGroupPromotionType)) && StringUtils.isBlank(apiGroupCode)) {
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))) {
List<OcpApiGroup> ocpApiGroups = mapper.selectThreeApiGroupsList(apiGroupPromotionType, apiGroupCode);
return ocpApiGroups;
......@@ -138,7 +145,7 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper, OcpApiG
queryWrapper.eq(OcpApiGroup::getApiGroupPcode, ocpApiGroup.getApiGroupCode());
String objId = ocpApiGroup.getObjId();
List<OcpApiGroup> list = mapper.selectGrpPcode();
List<OcpApiGroup> list = mapper.selectGroupPcode(ocpApiGroup.getApiGroupCode());
if (list.size() >= 1) {
flag = false;
}
......@@ -178,9 +185,16 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper, OcpApiG
}
} else if (StringUtils.isNotBlank(pageGroupDto.getKeyword())) {
LambdaQueryWrapper<OcpApiGroup> ocpTenantGroupLambdaQueryWrapper = qw.and(c -> c.like(OcpApiGroup::getApiGroupName, pageGroupDto.getKeyword()))
.and(c -> c.eq(OcpApiGroup::getApiGroupPcode, pageGroupDto.getApiGroupCode()));
mapper.selectPage(pageInfo, ocpTenantGroupLambdaQueryWrapper);
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()))
.and(c -> c.eq(OcpApiGroup::getApiGroupPcode, pageGroupDto.getApiGroupCode()));
mapper.selectPage(pageInfo, ocpTenantGroupLambdaQueryWrapper);
}
}
......
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