Commit 28eaa6e6 authored by 胡秀武's avatar 胡秀武

Merge remote-tracking branch 'origin/master'

parents 08e51347 582cba34
...@@ -194,18 +194,24 @@ public class ApiBasicManagementController { ...@@ -194,18 +194,24 @@ public class ApiBasicManagementController {
return apiBasicManagementService.getBaseByGroupCode(ApiBaseReq); return apiBasicManagementService.getBaseByGroupCode(ApiBaseReq);
} }
@ApiOperation("服务树一级") /* @ApiOperation("服务树一级")
@GetMapping("/apiBaseTree") @GetMapping("/apiBaseTree")
public ResponseVO<List<OcpApiGroup>> apiBaseTree(String apiGroupCompanyCode, Integer apiGroupPromotionType) { public ResponseVO<List<OcpApiGroup>> apiBaseTree(String apiGroupCompanyCode, Integer apiGroupPromotionType) {
List<OcpApiGroup> apiTreeGroupDtos = apiBasicManagementService.apiBaseTreeOther(apiGroupCompanyCode,null,apiGroupPromotionType); List<OcpApiGroup> apiTreeGroupDtos = apiBasicManagementService.apiBaseTreeOther(apiGroupCompanyCode,null,apiGroupPromotionType);
return ResponseVO.ok(apiTreeGroupDtos); return ResponseVO.ok(apiTreeGroupDtos);
} }*/
@ApiOperation("服务层级") @ApiOperation("服务分类层级")
@GetMapping("/apiBaseTreeOther") @GetMapping("/apiBaseTreeOther")
public ResponseVO<List<OcpApiGroup>> apiBaseTreeOther(String apiGroupCompanyCode, String apiGroupCode, Integer apiGroupPromotionType) { public ResponseVO<List<OcpApiGroup>> apiBaseTreeOther(String apiGroupCompanyCode, String apiGroupCode, Integer apiGroupPromotionType) {
List<OcpApiGroup> apiTreeGroupDtos = apiBasicManagementService.apiBaseTreeOther(apiGroupCompanyCode,apiGroupCode,apiGroupPromotionType); List<OcpApiGroup> apiTreeGroupDtos = apiBasicManagementService.apiBaseTreeOther(apiGroupCompanyCode,apiGroupCode,apiGroupPromotionType);
return ResponseVO.ok(apiTreeGroupDtos); return ResponseVO.ok(apiTreeGroupDtos);
} }
@ApiOperation("服务树列表")
@GetMapping("/apiBaseTreeList")
public ResponseVO<List<OcpApiBase>> apiBaseTreeList(String apiGroupCompanyCode, String apiGroupCode) {
List<OcpApiBase> apiBaseList = apiBasicManagementService.apiBaseTreeApiList(apiGroupCompanyCode, apiGroupCode);
return ResponseVO.ok(apiBaseList);
}
} }
...@@ -24,8 +24,8 @@ public class ApiDetailsController { ...@@ -24,8 +24,8 @@ public class ApiDetailsController {
@ApiOperation("服务库服务详情-查询") @ApiOperation("服务库服务详情-查询")
@GetMapping("/query") @GetMapping("/query")
public ResponseVO<OcpApiBase> getApiDetails(String objId) { public ResponseVO<OcpApiBase> getApiDetails(String code) {
return apiDetailsService.getApiDetails(objId); return apiDetailsService.getApiDetails(code);
} }
} }
...@@ -46,11 +46,11 @@ public class OcpApiDetailsController { ...@@ -46,11 +46,11 @@ public class OcpApiDetailsController {
return ocpApiAuditService.getOcpApiAuditList(ocpApiAudit); return ocpApiAuditService.getOcpApiAuditList(ocpApiAudit);
} }
@ApiOperation("服务大事记-查询详情") // @ApiOperation("服务大事记-查询详情")
@PostMapping("/getocpapidetails") // @PostMapping("/getocpapidetails")
public ResponseVO<List<OcpApiAudit>> getOcpApiDetails(@RequestBody OcpApiAudit ocpApiAudit){ // public ResponseVO<List<OcpApiAudit>> getOcpApiDetails(@RequestBody OcpApiAudit ocpApiAudit){
return ocpApiAuditService.sById(ocpApiAudit); // return ocpApiAuditService.sById(ocpApiAudit);
} // }
@ApiOperation("服务大事记-查询详情-变更内容") @ApiOperation("服务大事记-查询详情-变更内容")
@PostMapping("/getocpapi") @PostMapping("/getocpapi")
...@@ -58,6 +58,12 @@ public class OcpApiDetailsController { ...@@ -58,6 +58,12 @@ public class OcpApiDetailsController {
return ocpApiAuditService.OaaById(ocpApiAudit); return ocpApiAuditService.OaaById(ocpApiAudit);
} }
@ApiOperation("服务大事记-历史版本")
@PostMapping("/versionid")
public ResponseVO<List<OcpApiAudit>> versionId(@RequestBody OcpApiAudit ocpApiAudit){
return ocpApiAuditService.versionId(ocpApiAudit);
}
@ApiOperation("服务与应用拓扑图-查询") @ApiOperation("服务与应用拓扑图-查询")
@PostMapping("/getoatrlist") @PostMapping("/getoatrlist")
public ResponseVO<List<OcpApiTenantRel>> getOatrList(@RequestBody OcpApiTenantRel ocpApiTenantRel) { public ResponseVO<List<OcpApiTenantRel>> getOatrList(@RequestBody OcpApiTenantRel ocpApiTenantRel) {
......
...@@ -42,8 +42,8 @@ public class OcpApiTreeController { ...@@ -42,8 +42,8 @@ public class OcpApiTreeController {
@PostMapping("/instertree") @PostMapping("/instertree")
@ApiOperation("服务树分类--新增") @ApiOperation("服务树分类--新增")
public ResponseVO inseter(@RequestBody OcpApiGroupDtos ocpApiGroupDtos){ public ResponseVO inseter(@RequestBody OcpApiGroup ocpApiGroup){
boolean flag = service.insertTree(ocpApiGroupDtos); boolean flag = service.insertTree(ocpApiGroup);
if (flag){ if (flag){
return ResponseVO.ok(); return ResponseVO.ok();
} }
......
...@@ -10,13 +10,12 @@ import io.swagger.annotations.Api; ...@@ -10,13 +10,12 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.xml.transform.Result;
import java.util.List; import java.util.List;
@Slf4j @Slf4j
...@@ -50,11 +49,6 @@ public class OcpTenantDetailsController { ...@@ -50,11 +49,6 @@ public class OcpTenantDetailsController {
return ocpTenantAuditService.getOtaList(ocpTenantAudit); return ocpTenantAuditService.getOtaList(ocpTenantAudit);
} }
@ApiOperation("应用大事记-查询详情")
@PostMapping("/getotaListById")
public ResponseVO<List<OcpApiAudit>> getOtaListById(@RequestBody OcpTenantAudit ocpTenantAudit) {
return ocpTenantAuditService.getOtaListById(ocpTenantAudit);
}
@ApiOperation("应用订阅记录-查询") @ApiOperation("应用订阅记录-查询")
@PostMapping("/getOcpTenantList") @PostMapping("/getOcpTenantList")
...@@ -78,4 +72,12 @@ public class OcpTenantDetailsController { ...@@ -78,4 +72,12 @@ public class OcpTenantDetailsController {
public ResponseVO<List<OcpTenantAudit>> getOcpTenant(@RequestBody OcpTenantAudit ocpTenantAudit){ public ResponseVO<List<OcpTenantAudit>> getOcpTenant(@RequestBody OcpTenantAudit ocpTenantAudit){
return ocpTenantAuditService.OtaById(ocpTenantAudit); return ocpTenantAuditService.OtaById(ocpTenantAudit);
} }
@ApiOperation("应用大事记-查询详情-历史版本")
@PostMapping("/versionId")
public ResponseVO<List<OcpTenantAudit>> versionId(@RequestBody OcpTenantAudit ocpTenantAudit){
return ocpTenantAuditService.versionId(ocpTenantAudit);
}
} }
...@@ -11,6 +11,5 @@ import java.util.List; ...@@ -11,6 +11,5 @@ import java.util.List;
@Mapper @Mapper
public interface ApiDetailsMapper extends BaseMapper<OcpApiBase> { public interface ApiDetailsMapper extends BaseMapper<OcpApiBase> {
OcpApiBaseVo selectByCode(String code);
} }
...@@ -20,4 +20,6 @@ public interface OcpApiAuditMapper extends BaseMapper<OcpApiAudit> { ...@@ -20,4 +20,6 @@ public interface OcpApiAuditMapper extends BaseMapper<OcpApiAudit> {
List<OcpApiAudit> sById(OcpApiAudit ocpApiAudit); List<OcpApiAudit> sById(OcpApiAudit ocpApiAudit);
List<OcpApiAudit> versionId (OcpApiAudit ocpApiAudit);
} }
...@@ -32,5 +32,8 @@ public interface OcpApiTreeMapper extends BaseMapper<OcpApiGroup> { ...@@ -32,5 +32,8 @@ public interface OcpApiTreeMapper extends BaseMapper<OcpApiGroup> {
List<OcpApiGroup> selectThreeApiGroupsList(Long apiGroupPromotionType, String apiGroupCode); List<OcpApiGroup> selectThreeApiGroupsList(Long apiGroupPromotionType, String apiGroupCode);
List<OcpApiGroup> selectList(Long apiGroupPromotionType, String apiGroupCode,Long apiGroupLevel); List<OcpApiGroup> selectLists(Long apiGroupPromotionType, String apiGroupCode,Long apiGroupLevel);
//code重复问题
List<OcpApiGroup> selectGroupCode();
} }
...@@ -11,4 +11,6 @@ public interface OcpTenantAuditMapper extends BaseMapper<OcpTenantAudit> { ...@@ -11,4 +11,6 @@ public interface OcpTenantAuditMapper extends BaseMapper<OcpTenantAudit> {
List<OcpTenantAudit> getOtaListById(OcpTenantAudit ocpTenantAudit); List<OcpTenantAudit> getOtaListById(OcpTenantAudit ocpTenantAudit);
List<OcpTenantAudit> OtaById(OcpTenantAudit ocpTenantAudit); List<OcpTenantAudit> OtaById(OcpTenantAudit ocpTenantAudit);
List<OcpTenantAudit> versionId(OcpTenantAudit ocpTenantAudit);
} }
...@@ -16,6 +16,7 @@ import java.util.List; ...@@ -16,6 +16,7 @@ import java.util.List;
@TableName("ocp_api_group") @TableName("ocp_api_group")
@ApiModel("服务分类表") @ApiModel("服务分类表")
public class OcpApiGroup { public class OcpApiGroup {
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty("主键ID") @ApiModelProperty("主键ID")
private String objId; private String objId;
......
...@@ -12,10 +12,10 @@ import java.util.List; ...@@ -12,10 +12,10 @@ import java.util.List;
public interface ApiDetailsService{ public interface ApiDetailsService{
/** /**
* *
* @param objId * @param code
* @return * @return
*/ */
ResponseVO getApiDetails(String objId); ResponseVO getApiDetails(String code);
} }
...@@ -18,4 +18,6 @@ public interface OcpApiAuditService extends IService<OcpApiAudit> { ...@@ -18,4 +18,6 @@ public interface OcpApiAuditService extends IService<OcpApiAudit> {
ResponseVO sById(OcpApiAudit ocpApiAudit); ResponseVO sById(OcpApiAudit ocpApiAudit);
void exportExcel(OcpApiAudit ocpApiAudit, HttpServletRequest request, HttpServletResponse response); void exportExcel(OcpApiAudit ocpApiAudit, HttpServletRequest request, HttpServletResponse response);
ResponseVO versionId(OcpApiAudit ocpApiAudit);
} }
...@@ -21,7 +21,7 @@ public interface OcpApiTreeService extends IService<OcpApiGroup> { ...@@ -21,7 +21,7 @@ public interface OcpApiTreeService extends IService<OcpApiGroup> {
/** /**
* 新增服务分类 * 新增服务分类
*/ */
boolean insertTree(OcpApiGroupDtos ocpApiGroupDtos); boolean insertTree(OcpApiGroup ocpApiGroup);
/* /*
......
...@@ -16,4 +16,6 @@ public interface OcpTenantAuditService extends IService<OcpTenantAudit> { ...@@ -16,4 +16,6 @@ public interface OcpTenantAuditService extends IService<OcpTenantAudit> {
void exportExcel(OcpTenantAudit ocpTenantAudit, HttpServletRequest request, HttpServletResponse response); void exportExcel(OcpTenantAudit ocpTenantAudit, HttpServletRequest request, HttpServletResponse response);
ResponseVO OtaById(OcpTenantAudit ocpTenantAudit); ResponseVO OtaById(OcpTenantAudit ocpTenantAudit);
ResponseVO versionId(OcpTenantAudit ocpTenantAudit);
} }
...@@ -6,4 +6,7 @@ import com.pms.ocp.model.vo.ResponseVO; ...@@ -6,4 +6,7 @@ import com.pms.ocp.model.vo.ResponseVO;
public interface OcpTenantBaseService extends IService<OcpTenantBase> { public interface OcpTenantBaseService extends IService<OcpTenantBase> {
ResponseVO getOtbList(OcpTenantBase ocpTenantBase); ResponseVO getOtbList(OcpTenantBase ocpTenantBase);
} }
...@@ -192,7 +192,7 @@ public class ApiBasicManagementServiceImpl extends ServiceImpl<ApiBasicManagemen ...@@ -192,7 +192,7 @@ public class ApiBasicManagementServiceImpl extends ServiceImpl<ApiBasicManagemen
@Override @Override
public ResponseVO<PageInfo<OcpApiBaseVo>> getBaseByGroupCode(ApiBaseDto apiBaseReq) { public ResponseVO<PageInfo<OcpApiBaseVo>> getBaseByGroupCode(ApiBaseDto apiBaseReq) {
if (apiBaseReq.getPageNum() == null || apiBaseReq.getPageSize() == null) { if (apiBaseReq.getPageNum() == null || apiBaseReq.getPageSize() == null) {
ResponseVO.error("分页参数不能为空"); return ResponseVO.error("分页参数不能为空");
} }
apiGroupCode.add(apiBaseReq.getApiGroupCode()); apiGroupCode.add(apiBaseReq.getApiGroupCode());
setGroupIdValue(apiBaseReq.getApiGroupCompanyCode() ,apiBaseReq.getApiGroupCode(),apiBaseReq.getApiPromotion()); setGroupIdValue(apiBaseReq.getApiGroupCompanyCode() ,apiBaseReq.getApiGroupCode(),apiBaseReq.getApiPromotion());
......
...@@ -38,8 +38,8 @@ public class ApiDetailsServiceImpl implements ApiDetailsService { ...@@ -38,8 +38,8 @@ public class ApiDetailsServiceImpl implements ApiDetailsService {
@Override @Override
public ResponseVO getApiDetails(String objId) { public ResponseVO getApiDetails(String code) {
OcpApiBase ocpApiBase = apiDetailsMapper.selectById(objId); OcpApiBaseVo ocpApiBase = apiDetailsMapper.selectByCode(code);
return ResponseVO.ok(ocpApiBase); return ResponseVO.ok(ocpApiBase);
} }
......
...@@ -58,5 +58,11 @@ public class OcpApiAuditServiceImpl extends ServiceImpl<OcpApiAuditMapper,OcpApi ...@@ -58,5 +58,11 @@ public class OcpApiAuditServiceImpl extends ServiceImpl<OcpApiAuditMapper,OcpApi
ExportUtils.exportExcel(response, AnalysisConstant.exportOcpApiAuditName.OCP_API_AUDIT,workbook); ExportUtils.exportExcel(response, AnalysisConstant.exportOcpApiAuditName.OCP_API_AUDIT,workbook);
} }
@Override
public ResponseVO versionId(OcpApiAudit ocpApiAudit) {
List<OcpApiAudit> ocpApiAuditList = ocpApiAuditMapper.versionId(ocpApiAudit);
return ResponseVO.ok(ocpApiAuditList);
}
} }
...@@ -62,30 +62,19 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper,OcpApiGr ...@@ -62,30 +62,19 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper,OcpApiGr
/** /**
* 新增服务分类 * 新增服务分类
* *
* @param ocpApiGroupDtos * @param
*/ */
@Override @Override
public boolean insertTree(OcpApiGroupDtos ocpApiGroupDtos) { public boolean insertTree(OcpApiGroup ocpApiGroup) {
Timestamp timestamp = new Timestamp(System.currentTimeMillis()); Timestamp timestamp = new Timestamp(System.currentTimeMillis());
String code = RandomStringUtils.getRandomString(6); String code = RandomStringUtils.getRandomString(6);
boolean flag = true; boolean flag = true;
List<OcpApiGroup> ocpApiGroups = mapper.selectList(null); ocpApiGroup.setObjId("");
for (OcpApiGroup ocpApiGroup : ocpApiGroups) { ocpApiGroup.setApiGroupMtime(timestamp);
if (ocpApiGroup.getApiGroupCode().equals(ocpApiGroupDtos.getApiGroupCode())) { ocpApiGroup.setApiGroupCtime(timestamp);
flag = false; ocpApiGroup.setApiGroupPcode(ocpApiGroup.getApiGroupCode());
break; ocpApiGroup.setApiGroupCode(code);
} mapper.insert(ocpApiGroup);
}
if (flag == true) {
OcpApiGroup ocpApiGroup1 = new OcpApiGroup();
ocpApiGroup1.setObjId("");
ocpApiGroup1.setApiGroupMtime(timestamp);
ocpApiGroup1.setApiGroupCtime(timestamp);
BeanUtils.copyProperties(ocpApiGroupDtos, ocpApiGroup1);
ocpApiGroup1.setApiGroupCode(code);
mapper.insert(ocpApiGroup1);
}
return flag; return flag;
} }
...@@ -150,8 +139,11 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper,OcpApiGr ...@@ -150,8 +139,11 @@ public class OcpApiTreeServiceImpl extends ServiceImpl<OcpApiTreeMapper,OcpApiGr
if (StringUtils.isBlank(pageGroupDto.getApiGroupCode())){ if (StringUtils.isBlank(pageGroupDto.getApiGroupCode())){
List<OcpApiGroup> ocpApiGroups = mapper.selectTwoApiGroups(pageGroupDto.getApiGroupPromotionType()); List<OcpApiGroup> ocpApiGroups = mapper.selectTwoApiGroups(pageGroupDto.getApiGroupPromotionType());
pageInfo.setRecords(ocpApiGroups); pageInfo.setRecords(ocpApiGroups);
LambdaQueryWrapper<OcpApiGroup> lambdaQueryWrapper = new LambdaQueryWrapper();
lambdaQueryWrapper.eq(OcpApiGroup::getApiGroupPromotionType,pageGroupDto.getApiGroupPromotionType());
mapper.selectPage(pageInfo,lambdaQueryWrapper);
}else if (!(StringUtils.isBlank(pageGroupDto.getApiGroupCode()))){ }else if (!(StringUtils.isBlank(pageGroupDto.getApiGroupCode()))){
List<OcpApiGroup> ocpApiGroups = mapper.selectList(pageGroupDto.getApiGroupPromotionType(),pageGroupDto.getApiGroupCode(),pageGroupDto.getApiGroupLevel()); List<OcpApiGroup> ocpApiGroups = mapper.selectLists(pageGroupDto.getApiGroupPromotionType(),pageGroupDto.getApiGroupCode(),pageGroupDto.getApiGroupLevel());
LambdaQueryWrapper<OcpApiGroup> lwq = new LambdaQueryWrapper<>(); LambdaQueryWrapper<OcpApiGroup> lwq = new LambdaQueryWrapper<>();
pageInfo.setRecords(ocpApiGroups); pageInfo.setRecords(ocpApiGroups);
mapper.selectPage(pageInfo, lwq); mapper.selectPage(pageInfo, lwq);
......
...@@ -41,7 +41,7 @@ public class OcpTenantAuditServiceImpl extends ServiceImpl<OcpTenantAuditMapper, ...@@ -41,7 +41,7 @@ public class OcpTenantAuditServiceImpl extends ServiceImpl<OcpTenantAuditMapper,
@Override @Override
public void exportExcel(OcpTenantAudit ocpTenantAudit, HttpServletRequest request, HttpServletResponse response) { public void exportExcel(OcpTenantAudit ocpTenantAudit, HttpServletRequest request, HttpServletResponse response) {
List<OcpTenantAudit> otaListById = ocpTenantAuditMapper.getOtaListById(ocpTenantAudit); List<OcpTenantAudit> otaListById = ocpTenantAuditMapper.versionId(ocpTenantAudit);
ExportParams param = new ExportParams(AnalysisConstant.exportOcpTenantApiName.OCP_TENANT_API,AnalysisConstant.exportOcpTenantApiName.OCP_TENANT_API); ExportParams param = new ExportParams(AnalysisConstant.exportOcpTenantApiName.OCP_TENANT_API,AnalysisConstant.exportOcpTenantApiName.OCP_TENANT_API);
Workbook workbook = ExcelExportUtil.exportExcel(param, OcpTenantAudit.class,otaListById); Workbook workbook = ExcelExportUtil.exportExcel(param, OcpTenantAudit.class,otaListById);
ExportUtils.exportExcel(response, AnalysisConstant.exportOcpTenantApiName.OCP_TENANT_API,workbook); ExportUtils.exportExcel(response, AnalysisConstant.exportOcpTenantApiName.OCP_TENANT_API,workbook);
...@@ -52,4 +52,12 @@ public class OcpTenantAuditServiceImpl extends ServiceImpl<OcpTenantAuditMapper, ...@@ -52,4 +52,12 @@ public class OcpTenantAuditServiceImpl extends ServiceImpl<OcpTenantAuditMapper,
List<OcpTenantAudit> oatrList = ocpTenantAuditMapper.OtaById(ocpTenantAudit); List<OcpTenantAudit> oatrList = ocpTenantAuditMapper.OtaById(ocpTenantAudit);
return ResponseVO.ok(oatrList); return ResponseVO.ok(oatrList);
} }
@Override
public ResponseVO versionId(OcpTenantAudit ocpTenantAudit) {
List<OcpTenantAudit> ocpTenantAudits = ocpTenantAuditMapper.versionId(ocpTenantAudit);
return ResponseVO.ok(ocpTenantAudits);
}
} }
package com.pms.ocp.service.impl; package com.pms.ocp.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pms.ocp.common.constants.*;
import com.pms.ocp.common.exception.ServiceException;
import com.pms.ocp.mapper.OcpTenantBaseMapper; import com.pms.ocp.mapper.OcpTenantBaseMapper;
import com.pms.ocp.model.entity.OcpTenantBase; import com.pms.ocp.model.entity.OcpTenantBase;
import com.pms.ocp.model.vo.ResponseVO; import com.pms.ocp.model.vo.ResponseVO;
...@@ -8,10 +10,16 @@ import com.pms.ocp.service.OcpTenantBaseService; ...@@ -8,10 +10,16 @@ import com.pms.ocp.service.OcpTenantBaseService;
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.util.LinkedList;
import java.util.List; import java.util.List;
@Service @Service
public class OcpTenantBaseServiceImpl extends ServiceImpl<OcpTenantBaseMapper,OcpTenantBase> implements OcpTenantBaseService { public class OcpTenantBaseServiceImpl extends ServiceImpl<OcpTenantBaseMapper,OcpTenantBase> implements OcpTenantBaseService {
@Autowired @Autowired
private OcpTenantBaseMapper ocpTenantBaseMapper; private OcpTenantBaseMapper ocpTenantBaseMapper;
@Override @Override
...@@ -19,4 +27,9 @@ public class OcpTenantBaseServiceImpl extends ServiceImpl<OcpTenantBaseMapper,Oc ...@@ -19,4 +27,9 @@ public class OcpTenantBaseServiceImpl extends ServiceImpl<OcpTenantBaseMapper,Oc
List<OcpTenantBase> otbList = ocpTenantBaseMapper.getOtbList(ocpTenantBase); List<OcpTenantBase> otbList = ocpTenantBaseMapper.getOtbList(ocpTenantBase);
return ResponseVO.ok(otbList); return ResponseVO.ok(otbList);
} }
} }
...@@ -86,13 +86,10 @@ public class TenantServiceImpl extends ServiceImpl<TenantMapper, OcpTenantGroup> ...@@ -86,13 +86,10 @@ public class TenantServiceImpl extends ServiceImpl<TenantMapper, OcpTenantGroup>
ocpTenantGroup.setTenantGroupVersion("1.0"); ocpTenantGroup.setTenantGroupVersion("1.0");
} }
OcpTenantBase ocpTenantBase = new OcpTenantBase();
BeanUtils.copyProperties(tenanBaseDto,ocpTenantBase);
if ("null".equals(tenanBaseDto.getTenantGroupCode())){ if ("null".equals(tenanBaseDto.getTenantGroupCode())){
group.setTenantGroupCode(randomString); group.setTenantGroupCode(randomString);
} }
tenantMapper.insert(tenanBaseDto); tenantMapper.insert(tenanBaseDto);
tenantBasicMapper.insert(ocpTenantBase);
return falg; return falg;
} }
......
...@@ -2,6 +2,16 @@ ...@@ -2,6 +2,16 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.pms.ocp.mapper.ApiDetailsMapper"> <mapper namespace="com.pms.ocp.mapper.ApiDetailsMapper">
<select id="oneTenantGroup" resultType="com.pms.ocp.model.vo.OcpApiBaseVo">
select
oab.obj_id,oab.api_code,oae.api_code,oab.api_name,oae.cluster_name,
oae.space_name,oab.api_url,oae.api_state ,oab.api_unit ,oab.api_ctime from ocp_api_base oab
LEFT JOIN ocp_api_extent oae
on oab.api_code = oae.api_code
where oab.is_delete = 0
<if test="code !=null and code!=''">
and oab.api_group_code = #{code}
</if>
</select>
</mapper> </mapper>
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
select * from ocp_api_audit oaa select * from ocp_api_audit oaa
LEFT JOIN ocp_api_base oab LEFT JOIN ocp_api_base oab
on oaa.api_code = oab.api_code on oaa.api_code = oab.api_code
where oaa.obj_id = #{objId} where oaa.api_code = #{apiCode}
</select> </select>
<select id="getOcpApiSubsList" resultType="com.pms.ocp.model.entity.OcpApiAudit"> <select id="getOcpApiSubsList" resultType="com.pms.ocp.model.entity.OcpApiAudit">
...@@ -16,4 +16,12 @@ ...@@ -16,4 +16,12 @@
<select id="sById" resultType="com.pms.ocp.model.entity.OcpApiAudit"> <select id="sById" resultType="com.pms.ocp.model.entity.OcpApiAudit">
select * from ocp_api_audit where obj_id = #{objId} select * from ocp_api_audit where obj_id = #{objId}
</select> </select>
<select id="versionId" resultType="com.pms.ocp.model.entity.OcpApiAudit">
select * from ocp_api_audit oaa
LEFT JOIN ocp_api_base oab
on oaa.api_code = oab.api_code
where oaa.api_code = #{apiCode}
</select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.pms.ocp.mapper.OcpApiTreeMapper"> <mapper namespace="com.pms.ocp.mapper.OcpApiTreeMapper">
<!-- 一级树--> <!-- 一级树-->
<select id="selectApiGroups" resultType="com.pms.ocp.model.entity.OcpApiGroup"> <select id="selectApiGroups" resultType="com.pms.ocp.model.entity.OcpApiGroup">
SELECT * FROM (select *,ROW_NUMBER() over(partition by api_group_promotion_type) as rn from ocp_api_group) as u where u.rn= 1; SELECT * FROM (select *,ROW_NUMBER() over(partition by api_group_promotion_type) as rn from ocp_api_group) as u where u.rn= 1;
</select> </select>
<!-- 级树--> <!-- 级树-->
<select id="selectTwoApiGroups" resultType="com.pms.ocp.model.entity.OcpApiGroup"> <select id="selectTwoApiGroups" resultType="com.pms.ocp.model.entity.OcpApiGroup">
SELECT * FROM ocp_api_group WHERE api_group_promotion_type = #{apiGroupPromotionType}; SELECT * FROM ocp_api_group WHERE api_group_promotion_type = #{apiGroupPromotionType} and api_group_level = '1';
</select> </select>
<!--级--> <!--级-->
<select id="selectThreeApiGroupsList" resultType="com.pms.ocp.model.entity.OcpApiGroup"> <select id="selectThreeApiGroupsList" resultType="com.pms.ocp.model.entity.OcpApiGroup">
SELECT * FROM ocp_api_group WHERE api_group_promotion_type = #{apiGroupPromotionType} and api_group_pcode = #{apiGroupCode}; SELECT * FROM ocp_api_group WHERE api_group_promotion_type = #{apiGroupPromotionType} and api_group_pcode = #{apiGroupCode};
</select> </select>
<!--服务树 -查询-->
<select id="selectLists" resultType="com.pms.ocp.model.entity.OcpApiGroup">
SELECT * FROM ocp_api_group WHERE api_group_promotion_type = #{apiGroupPromotionType} and api_group_pcode = #{apiGroupCode} and api_group_level = #{apiGroupLevel};
</select>
<!-- code值重复问题 -->
<select id="selectGroupCode" resultType="com.pms.ocp.model.entity.OcpApiGroup">
SELECT api_group_code FROM ocp_api_group;
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -13,6 +13,13 @@ ...@@ -13,6 +13,13 @@
select * from ocp_tenant_audit ota select * from ocp_tenant_audit ota
LEFT JOIN ocp_tenant_base otb LEFT JOIN ocp_tenant_base otb
on ota.tenant_code = otb.tenant_code on ota.tenant_code = otb.tenant_code
where ota.obj_id = #{objId} where ota.tenant_code = #{tenantCode}
</select>
<select id="versionId" resultType="com.pms.ocp.model.entity.OcpTenantAudit">
select * from ocp_tenant_audit ota
LEFT JOIN ocp_tenant_base otb
on ota.tenant_code = otb.tenant_code
where ota.tenant_code = #{tenantCode}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -26,5 +26,51 @@ ...@@ -26,5 +26,51 @@
SELECT * FROM ocp_tenant_group WHERE tenant_group_company_code = #{tenantGroupCompanyCode} and tenant_group_level = '1' ; SELECT * FROM ocp_tenant_group WHERE tenant_group_company_code = #{tenantGroupCompanyCode} and tenant_group_level = '1' ;
</select> </select>
<!-- 模糊查询-->
<select id="queryLike" resultType="com.pms.ocp.model.entity.OcpTenantGroup">
select * from ocp_tenant_group
<where>
<if test="keyword !=null and keyword != '' ">
and tenant_group_code like CONCAT('%', #{keyword}::text,'%')
</if>
<if test="keyword !=null and keyword != '' ">
and tenant_group_name like CONCAT('%', #{keyword}::text,'%')
</if>
<if test="keyword !=null and keyword != '' ">
and tenant_group_company_code like CONCAT('%', #{keyword}::text,'%')
</if>
<if test="keyword !=null and keyword != '' ">
and tenant_group_pcode like CONCAT('%', #{keyword}::text,'%')
</if>
<if test="keyword !=null and keyword != '' ">
and tenant_type like CONCAT('%', #{keyword}::text,'%')
</if>
<if test="keyword !=null and keyword != '' ">
and tenant_group_version like CONCAT('%', #{keyword}::text,'%')
</if>
<if test="keyword !=null and keyword != '' ">
and tenant_group_order_no like CONCAT('%', #{keyword}::text,'%')
</if>
<if test="keyword !=null and keyword != '' ">
and tenant_group_user_id like CONCAT('%', #{keyword}::text,'%')
</if>
<if test="keyword !=null and keyword != '' ">
and tenant_group_user_name like CONCAT('%', #{keyword}::text,'%')
</if>
<if test="keyword !=null and keyword != '' ">
and tenant_group_ctime like CONCAT('%', #{keyword}::text,'%')
</if>
<if test="keyword !=null and keyword != '' ">
and tenant_group_mtime like CONCAT('%', #{keyword}::text,'%')
</if>
<if test="keyword !=null and keyword != '' ">
and is_delete like CONCAT('%', #{keyword}::text,'%')
</if>
<if test="keyword !=null and keyword != '' ">
and tenant_group_level like CONCAT('%', #{keyword}::text,'%')
</if>
</where>
</select>
</mapper> </mapper>
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