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

Merge remote-tracking branch 'origin/master'

parents 4f1574ba 71129270
......@@ -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("删除服务")
......
......@@ -21,4 +21,9 @@ public interface OcpTenantBaseMapper extends BaseMapper<OcpTenantBase> {
* @return
*/
int queryCount(String appCode);
List<OcpTenantBase> selcctCodeList(String ocpTenantGroup);
int queryName(String appName);
}
......@@ -100,7 +100,8 @@ public class PmsApiMangageApi {
@ApiModelProperty("上级code")
private String apiGroupPcode;
@ApiModelProperty("服务类型")
private String professionalKind;
@ApiModelProperty("分层树层级 1中台层 2中心层 3 服务组层 4服务层 ")
private String apiGroupLevel;
......@@ -172,6 +173,14 @@ public class PmsApiMangageApi {
this.objIds = objIds;
}
public String getProfessionalKind() {
return professionalKind;
}
public void setProfessionalKind(String professionalKind) {
this.professionalKind = professionalKind;
}
public boolean getBoole() {
return boole;
}
......
......@@ -137,7 +137,8 @@ public class OcpApiBaseVo implements Serializable {
@ApiModelProperty("分层树层级 1中台层 2中心层 3 服务组层 4服务层 ")
private String apiGroupLevel;
@ApiModelProperty("所属专业; ts:输电,t:变电, dc:直流,ds配电,tc:技术,pl计划 im综合")
private String professionalKind;
//
@ApiModelProperty("图标种类tenant:应用图标api:服务图标")
private String iocnType;
......@@ -151,6 +152,30 @@ public class OcpApiBaseVo implements Serializable {
@ApiModelProperty("所属公司可能会根据公司分区")
private String companyCode;
public String getStartTime() {
return startTime;
}
public void setStartTime(String startTime) {
this.startTime = startTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public String getProfessionalKind() {
return professionalKind;
}
public void setProfessionalKind(String professionalKind) {
this.professionalKind = professionalKind;
}
public String getApiGroupCode() {
return apiGroupCode;
}
......
......@@ -51,8 +51,9 @@ public class AppRegisterServiceImpl implements AppRegisterService {
int count = ocpTenantBaseMapper.queryCount(appRegisterDTO.getAppCode());
int c = ocpTenantExtentMapper.queryCount(appRegisterDTO.getAppCode());
if (count != 0 || c != 0) {
return ResponseVO.error("应用编码有重复/应用扩展表编码有重复");
int nc = ocpTenantBaseMapper.queryName(appRegisterDTO.getAppName());
if (count != 0 || c != 0 || nc != 0) {
return ResponseVO.error("应用编码有重复/应用扩展表编码有重复/应用名称有重复");
}
OcpTenantIocn ocpTenantIocn = new OcpTenantIocn();
......
......@@ -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;
......@@ -41,6 +43,8 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper, OcpApiG
@Autowired
private OcpApiBaseMapper ocpApiBaseMapper;
/**
* 服务树分类
*
......@@ -83,7 +87,6 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper, OcpApiG
// Stream<OcpApiGroup> apiGroupStream1 = ocpApiGroupStream.filter(ocp -> ocp.getApiGroupName().equals(ocpApiGroup.getApiGroupName()));
List<OcpApiGroup> ocpApiGroups1 = mapper.selectGroupName(ocpApiGroup.getApiGroupName());
OcpApiGroup ocpApi = new OcpApiGroup();
if (ocpApiGroups1.size() == 0) {
ocpApi.setApiGroupPromotionType(ocpApiGroup.getApiGroupPromotionType());
......@@ -123,14 +126,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;
}
}
if (falg) {
ocpApiGroup.setApiGroupMtime(timestamp);
mapper.updateById(ocpApiGroup);
}
return falg;
}
......@@ -170,12 +175,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 +195,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);
}
}
......
......@@ -77,7 +77,7 @@ public class OcpTenantIocnServiceImpl extends ServiceImpl<OcpTenantIocnMapper, O
}
}*/
//pish
//
List<OcpTenantGroupIocnDto> lists = new ArrayList<>();
List<OcpTenantGroupIocnDto> groupIocnDtos = ocpTenantBaseMapper.selectAlls();
for (OcpTenantGroupIocnDto groupIocnDto : groupIocnDtos) {
......
......@@ -6,9 +6,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageInfo;
import com.pms.ocp.common.utils.RandomStringUtils;
import com.pms.ocp.mapper.OcpTenantBaseMapper;
import com.pms.ocp.mapper.TenantBasicManagementMapper;
import com.pms.ocp.mapper.TenantMapper;
import com.pms.ocp.model.dto.*;
import com.pms.ocp.model.entity.OcpTenantBase;
import com.pms.ocp.model.entity.OcpTenantGroup;
import com.pms.ocp.service.TenantService;
import org.apache.commons.lang3.StringUtils;
......@@ -32,6 +34,10 @@ public class TenantServiceImpl extends ServiceImpl<TenantMapper, OcpTenantGroup>
@Autowired
private TenantBasicManagementMapper tenantBasicMapper;
@Autowired
private OcpTenantBaseMapper ocpTenantBaseMapper;
/**
* 应用树分类管理
*
......@@ -64,6 +70,12 @@ public class TenantServiceImpl extends ServiceImpl<TenantMapper, OcpTenantGroup>
@Override
public OcpTenantGroup getTenanInster(TenanBaseDto tenanBaseDto) {
boolean falg = true;
if (StringUtils.isNotBlank(tenanBaseDto.getTenantGroupCode())) {
List<OcpTenantBase> ocpTenantBases = ocpTenantBaseMapper.selcctCodeList(tenanBaseDto.getTenantGroupCode());
if (ocpTenantBases.size() > 0) {
falg = false;
}
}
OcpTenantGroup group = new OcpTenantGroup();
String randomString = RandomStringUtils.getRandomString(6);
......@@ -105,8 +117,11 @@ public class TenantServiceImpl extends ServiceImpl<TenantMapper, OcpTenantGroup>
tenanBaseDto.setClassIfy(tenanBaseDto.getTenantGroupCode());
tenantMapper.insert(group);
}
return group;
}
/**
......@@ -121,15 +136,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;
}
}
if (falg) {
OcpTenantGroup ocpTenantGroup1 = new OcpTenantGroup();
ocpTenantGroup1.setTenantGroupMtime(timestamp);
tenantMapper.updateById(ocpTenantGroup);
}
return falg;
}
......@@ -176,18 +193,17 @@ public class TenantServiceImpl extends ServiceImpl<TenantMapper, OcpTenantGroup>
if (StringUtils.isBlank(keyword)) {
if (StringUtils.isBlank(lev) || "1".equals(lev)) {
LambdaQueryWrapper<OcpTenantGroup> eq = qw.eq(OcpTenantGroup::getTenantGroupCompanyCode, tenantGroupCompanyCode);
LambdaQueryWrapper<OcpTenantGroup> eq = qw.eq(OcpTenantGroup::getTenantGroupCompanyCode, tenantGroupCompanyCode).orderByDesc(OcpTenantGroup::getTenantGroupMtime);
tenantMapper.selectPage(page, eq);
} else if ("2".equals(lev) || "3".equals(lev)) {
LambdaQueryWrapper<OcpTenantGroup> eq = qw.or(wq -> wq.eq(OcpTenantGroup::getTenantGroupCompanyCode, tenantGroupCompanyCode))
.eq(OcpTenantGroup::getTenantGroupPcode, tenantGroupCode);
.eq(OcpTenantGroup::getTenantGroupPcode, tenantGroupCode).orderByDesc(OcpTenantGroup::getTenantGroupMtime);
tenantMapper.selectPage(page, eq);
}
} else if (!(StringUtils.isBlank(keyword))) {
LambdaQueryWrapper<OcpTenantGroup> ocpTenantGroupLambdaQueryWrapper = qw.and(c -> c.like(OcpTenantGroup::getTenantGroupCompanyCode, keyword))
.or().like(OcpTenantGroup::getTenantGroupName, keyword)
.or().like(OcpTenantGroup::getTenantGroupPcode, keyword)
.or().like(OcpTenantGroup::getTenantGroupUserName, keyword);
.orderByDesc(OcpTenantGroup::getTenantGroupMtime);
tenantMapper.selectPage(page, ocpTenantGroupLambdaQueryWrapper);
// OcpTenantGroup ocpTenantGroup1 = new OcpTenantGroup();
......@@ -204,6 +220,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;
......
......@@ -2,7 +2,7 @@ spring:
datasource:
driver-class-name: org.postgresql.Driver
username: postgres
password: 1234
password: root
type: com.zaxxer.hikari.HikariDataSource
# jdbc-url: jdbc:postgresql://192.168.43.20:33072/pms3?currentSchema=public&stringtype=unspecified&TimeZone=Asia/Shanghai&useAffectedRows=true
# jdbc-url: jdbc:postgresql://172.20.10.9:33072/pms3?currentSchema=public&stringtype=unspecified&TimeZone=Asia/Shanghai&useAffectedRows=true
......
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.pms.ocp.mapper.OcpTenantBaseMapper">
<select id="getOtbList" resultType="com.pms.ocp.model.entity.OcpTenantBase">
select *
from ocp_tenant_base otb
LEFT JOIN ocp_tenant_extent ote
on otb.tenant_code = ote.tenant_code
where otb.obj_id = #{objId}
</select>
<select id="updataIsDelect" resultType="com.pms.ocp.model.entity.OcpTenantBase">
UPDATE ocp_tenant_base
......@@ -32,4 +25,19 @@
where tenant_code = #{appCode}
</select>
<select id="queryName" resultType="java.lang.Integer">
select count(0)
from ocp_tenant_base
where tenant_name = #{appName}
</select>
<select id="selcctCodeList" resultType="java.lang.Integer">
select *
from ocp_tenant_base
where tenant_group_code = #{tenantGroupCode}
</select>
</mapper>
\ No newline at end of file
......@@ -69,10 +69,10 @@
<insert id="addPamm">
insert into ocp_api_base(obj_id,api_code,api_name,api_group_code,api_promotion,api_req,
api_resp,api_url,api_ctime,api_mtime,api_user_id,api_unit,owner_company_code,is_delete,
api_zone,api_layer,api_version,api_center_code,api_description,api_user_name)
api_zone,api_layer,api_version,api_center_code,api_description,api_user_name,professional_kind)
values (#{objId},#{apiCode},#{apiName},#{apiGroupCode},#{apiPromotion},#{apiReq},
#{apiResp},#{apiUrl},#{apiCtime},#{apiMtime},#{apiUserId},#{apiUnit},#{ownerCompanyCode},
#{isDelete},#{apiZone},#{apiLayer},#{apiVersion},#{apiCenterCode},#{apiDescription},#{apiUserName})
#{isDelete},#{apiZone},#{apiLayer},#{apiVersion},#{apiCenterCode},#{apiDescription},#{apiUserName},#{professionalKind})
</insert>
......
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