Commit eb919a18 authored by zhaochengming's avatar zhaochengming

总部--bug修改

parent c94e43da
...@@ -77,7 +77,7 @@ public class OcpApiTreeController { ...@@ -77,7 +77,7 @@ public class OcpApiTreeController {
if (flag){ if (flag){
return ResponseVO.ok(); return ResponseVO.ok();
} }
return ResponseVO.error("您输入的服务编码重复,请重新输入"); return ResponseVO.error("您输入的服务名称重复,请重新输入");
} }
@PostMapping("/deletetree") @PostMapping("/deletetree")
@ApiOperation("服务树分类--删除") @ApiOperation("服务树分类--删除")
......
...@@ -68,7 +68,7 @@ public class OcpTenantController { ...@@ -68,7 +68,7 @@ public class OcpTenantController {
if (falg){ if (falg){
return ResponseVO.ok("修改成功!"); return ResponseVO.ok("修改成功!");
} }
return ResponseVO.error("应用code已经存在!"); return ResponseVO.error("应用名称已经存在!");
} }
@PostMapping("/tenantdelete") @PostMapping("/tenantdelete")
@ApiModelProperty("删除服务") @ApiModelProperty("删除服务")
......
...@@ -16,12 +16,14 @@ import com.pms.ocp.model.entity.OcpTenantGroup; ...@@ -16,12 +16,14 @@ import com.pms.ocp.model.entity.OcpTenantGroup;
import com.pms.ocp.service.OcpApiTreeService; import com.pms.ocp.service.OcpApiTreeService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.javassist.runtime.Desc;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; 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.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.stream.Stream; import java.util.stream.Stream;
...@@ -123,14 +125,16 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper, OcpApiG ...@@ -123,14 +125,16 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper, OcpApiG
boolean falg = true; boolean falg = true;
List<OcpApiGroup> ocpApiGroups = mapper.selectList(null); List<OcpApiGroup> ocpApiGroups = mapper.selectList(null);
for (OcpApiGroup apiGroup : ocpApiGroups) { for (OcpApiGroup apiGroup : ocpApiGroups) {
String code = apiGroup.getApiGroupCode(); String name = apiGroup.getApiGroupName();
if (code == ocpApiGroup.getApiGroupCode()) { if (name.equals(ocpApiGroup.getApiGroupName())) {
falg = false; falg = false;
break; break;
} }
} }
ocpApiGroup.setApiGroupMtime(timestamp); if (falg) {
mapper.updateById(ocpApiGroup); ocpApiGroup.setApiGroupMtime(timestamp);
mapper.updateById(ocpApiGroup);
}
return falg; return falg;
} }
...@@ -170,12 +174,13 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper, OcpApiG ...@@ -170,12 +174,13 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper, OcpApiG
LambdaQueryWrapper<OcpApiGroup> qw = new LambdaQueryWrapper<>(); LambdaQueryWrapper<OcpApiGroup> qw = new LambdaQueryWrapper<>();
if (StringUtils.isBlank(pageGroupDto.getKeyword())) { if (StringUtils.isBlank(pageGroupDto.getKeyword())) {
if (StringUtils.isBlank(pageGroupDto.getApiGroupCode())) { if (StringUtils.isBlank(pageGroupDto.getApiGroupCode())) {
qw.eq(OcpApiGroup::getApiGroupPromotionType, pageGroupDto.getApiGroupPromotionType()); qw.eq(OcpApiGroup::getApiGroupPromotionType, pageGroupDto.getApiGroupPromotionType()).orderByDesc(OcpApiGroup::getApiGroupMtime);
mapper.selectPage(pageInfo, qw); mapper.selectPage(pageInfo, qw);
} else if (!(StringUtils.isNotBlank(pageGroupDto.getApiGroupPcode()))) { } else if (!(StringUtils.isNotBlank(pageGroupDto.getApiGroupPcode()))) {
List<OcpApiGroup> ocpApiGroups = mapper.selectLists(pageGroupDto.getApiGroupPromotionType(), pageGroupDto.getApiGroupCode()); List<OcpApiGroup> ocpApiGroups = mapper.selectLists(pageGroupDto.getApiGroupPromotionType(), pageGroupDto.getApiGroupCode());
qw.eq(OcpApiGroup::getApiGroupPromotionType, pageGroupDto.getApiGroupPromotionType()).and(c -> c.eq(OcpApiGroup::getApiGroupPcode, pageGroupDto.getApiGroupCode())); qw.eq(OcpApiGroup::getApiGroupPromotionType, pageGroupDto.getApiGroupPromotionType()).and(c -> c.eq(OcpApiGroup::getApiGroupPcode, pageGroupDto.getApiGroupCode())).orderByDesc(OcpApiGroup::getApiGroupMtime);
pageInfo.setRecords(ocpApiGroups); pageInfo.setRecords(ocpApiGroups);
mapper.selectPage(pageInfo, qw); mapper.selectPage(pageInfo, qw);
List<OcpApiGroup> records = pageInfo.getRecords(); List<OcpApiGroup> records = pageInfo.getRecords();
...@@ -189,12 +194,12 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper, OcpApiG ...@@ -189,12 +194,12 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper, OcpApiG
} else if (StringUtils.isNotBlank(pageGroupDto.getKeyword())) { } else if (StringUtils.isNotBlank(pageGroupDto.getKeyword())) {
if (StringUtils.isBlank(pageGroupDto.getApiGroupCode())){ if (StringUtils.isBlank(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::getApiGroupPromotionType,pageGroupDto.getApiGroupPromotionType())); .and(c->c.eq(OcpApiGroup::getApiGroupPromotionType,pageGroupDto.getApiGroupPromotionType())).orderByDesc(OcpApiGroup::getApiGroupMtime);
mapper.selectPage(pageInfo, ocpTenantGroupLambdaQueryWrapper); mapper.selectPage(pageInfo, ocpTenantGroupLambdaQueryWrapper);
}else if (StringUtils.isNotBlank(pageGroupDto.getApiGroupCode())) { }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())).orderByDesc(OcpApiGroup::getApiGroupMtime);
mapper.selectPage(pageInfo, ocpTenantGroupLambdaQueryWrapper); mapper.selectPage(pageInfo, ocpTenantGroupLambdaQueryWrapper);
} }
} }
......
...@@ -121,15 +121,17 @@ public class TenantServiceImpl extends ServiceImpl<TenantMapper, OcpTenantGroup> ...@@ -121,15 +121,17 @@ public class TenantServiceImpl extends ServiceImpl<TenantMapper, OcpTenantGroup>
boolean falg = true; boolean falg = true;
List<OcpTenantGroup> ocpTenantGroupList = tenantMapper.selectList(null); List<OcpTenantGroup> ocpTenantGroupList = tenantMapper.selectList(null);
for (OcpTenantGroup ocpApiGroup : ocpTenantGroupList) { for (OcpTenantGroup ocpApiGroup : ocpTenantGroupList) {
String code = ocpTenantGroup.getTenantGroupCode(); String name = ocpTenantGroup.getTenantGroupName();
if (code == ocpApiGroup.getTenantGroupCode()) { if (name.equals(ocpApiGroup.getTenantGroupName())) {
falg = false; falg = false;
break; break;
} }
} }
OcpTenantGroup ocpTenantGroup1 = new OcpTenantGroup(); if (falg) {
ocpTenantGroup1.setTenantGroupMtime(timestamp); OcpTenantGroup ocpTenantGroup1 = new OcpTenantGroup();
tenantMapper.updateById(ocpTenantGroup); ocpTenantGroup1.setTenantGroupMtime(timestamp);
tenantMapper.updateById(ocpTenantGroup);
}
return falg; return falg;
} }
...@@ -204,6 +206,21 @@ public class TenantServiceImpl extends ServiceImpl<TenantMapper, OcpTenantGroup> ...@@ -204,6 +206,21 @@ public class TenantServiceImpl extends ServiceImpl<TenantMapper, OcpTenantGroup>
record.setClassIfy(ocpTenantGroup1.getTenantGroupName()); record.setClassIfy(ocpTenantGroup1.getTenantGroupName());
} }
} }
if (StringUtils.isBlank(tenantGroupCode)){
List<OcpTenantGroup> records = page.getRecords();
for (OcpTenantGroup record : records) {
record.setClassIfy(record.getTenantGroupName());
}
}
if (StringUtils.isNotBlank(tenantGroupCode)) {
OcpTenantGroup ocpTenantGroup1 = tenantMapper.selectGroupName(tenantGroupCode);
String tenantGroupName = ocpTenantGroup1.getTenantGroupName();
List<OcpTenantGroup> records = page.getRecords();
for (OcpTenantGroup record : records) {
record.setClassIfy(tenantGroupName);
}
}
return page; return page;
......
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