Commit eb919a18 authored by zhaochengming's avatar zhaochengming

总部--bug修改

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