Commit 17d8d6ab authored by liukai's avatar liukai

应用

parent 931894db
...@@ -4,4 +4,8 @@ public interface AnalysisConstant { ...@@ -4,4 +4,8 @@ public interface AnalysisConstant {
interface exportOcpApiAuditName{ interface exportOcpApiAuditName{
final String OCP_API_AUDIT= "服务大事记导出数据"; final String OCP_API_AUDIT= "服务大事记导出数据";
} }
interface exportOcpTenantApiName{
final String OCP_TENANT_API = "应用大事记导出数据";
}
} }
package com.pms.ocp.controller; package com.pms.ocp.controller;
import com.pms.ocp.model.entity.OcpApiAudit; import com.pms.ocp.model.entity.*;
import com.pms.ocp.model.entity.OcpTenantAudit;
import com.pms.ocp.model.entity.OcpTenantBase;
import com.pms.ocp.model.vo.ResponseVO; import com.pms.ocp.model.vo.ResponseVO;
import com.pms.ocp.service.OcpApiAuditService; import com.pms.ocp.service.OcpApiTenantRelService;
import com.pms.ocp.service.OcpTenantAuditService; import com.pms.ocp.service.OcpTenantAuditService;
import com.pms.ocp.service.OcpTenantBaseService; import com.pms.ocp.service.OcpTenantBaseService;
import com.pms.ocp.service.OcpTenantSubsService;
import io.swagger.annotations.Api; 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;
...@@ -16,6 +15,8 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -16,6 +15,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
@Slf4j @Slf4j
...@@ -30,6 +31,13 @@ public class OcpTenantDetailsController { ...@@ -30,6 +31,13 @@ public class OcpTenantDetailsController {
@Autowired @Autowired
private OcpTenantAuditService ocpTenantAuditService; private OcpTenantAuditService ocpTenantAuditService;
@Autowired
private OcpTenantSubsService ocpTenantSubsService;
@Autowired
private OcpApiTenantRelService ocpApiTenantRelService;
@ApiOperation("应用基础信息-查询") @ApiOperation("应用基础信息-查询")
@PostMapping("/getotbList") @PostMapping("/getotbList")
public ResponseVO<List<OcpTenantBase>> getOtbList(@RequestBody OcpTenantBase ocpTenantBase){ public ResponseVO<List<OcpTenantBase>> getOtbList(@RequestBody OcpTenantBase ocpTenantBase){
...@@ -47,4 +55,27 @@ public class OcpTenantDetailsController { ...@@ -47,4 +55,27 @@ public class OcpTenantDetailsController {
public ResponseVO<List<OcpApiAudit>> getOtaListById(@RequestBody OcpTenantAudit ocpTenantAudit) { public ResponseVO<List<OcpApiAudit>> getOtaListById(@RequestBody OcpTenantAudit ocpTenantAudit) {
return ocpTenantAuditService.getOtaListById(ocpTenantAudit); return ocpTenantAuditService.getOtaListById(ocpTenantAudit);
} }
@ApiOperation("应用订阅记录-查询")
@PostMapping("/getOcpTenantList")
public ResponseVO<List<OcpTenantSubs>> getOcpTenantList(OcpTenantSubs ocpTenantSubs) {
return ocpTenantSubsService.getOcpTenantList(ocpTenantSubs);
}
@ApiOperation("应用与服务拓扑图-查询")
@PostMapping("/getOcpTenantApiList")
public ResponseVO<List<OcpApiTenantRel>> getOcpTenantApiList(@RequestBody OcpApiTenantRel ocpApiTenantRel) {
return ocpApiTenantRelService.getTenantApiList(ocpApiTenantRel);
}
@ApiOperation("应用大事记-导出")
@RequestMapping("/export")
public void exportExcel(@RequestBody(required = false)OcpTenantAudit ocpTenantAudit, HttpServletRequest request, HttpServletResponse response) {
ocpTenantAuditService.exportExcel(ocpTenantAudit,request,response);
}
@ApiOperation("应用大事记-查询详情-变更内容")
@PostMapping("/getocpTent")
public ResponseVO<List<OcpTenantAudit>> getOcpTenant(@RequestBody OcpTenantAudit ocpTenantAudit){
return ocpTenantAuditService.OtaById(ocpTenantAudit);
}
} }
...@@ -10,4 +10,6 @@ import java.util.List; ...@@ -10,4 +10,6 @@ import java.util.List;
public interface OcpApiTenantRelMapper extends BaseMapper<OcpApiTenantRel> { public interface OcpApiTenantRelMapper extends BaseMapper<OcpApiTenantRel> {
List<OcpApiTenantRel> getOatrList(OcpApiTenantRel ocpApiTenantRel); List<OcpApiTenantRel> getOatrList(OcpApiTenantRel ocpApiTenantRel);
List<OcpApiTenantRel> getTenantApiList(OcpApiTenantRel ocpApiTenantRel);
} }
...@@ -9,4 +9,6 @@ public interface OcpTenantAuditMapper extends BaseMapper<OcpTenantAudit> { ...@@ -9,4 +9,6 @@ public interface OcpTenantAuditMapper extends BaseMapper<OcpTenantAudit> {
List<OcpTenantAudit> getOtaList(OcpTenantAudit ocpTenantAudit); List<OcpTenantAudit> getOtaList(OcpTenantAudit ocpTenantAudit);
List<OcpTenantAudit> getOtaListById(OcpTenantAudit ocpTenantAudit); List<OcpTenantAudit> getOtaListById(OcpTenantAudit ocpTenantAudit);
List<OcpTenantAudit> OtaById(OcpTenantAudit ocpTenantAudit);
} }
...@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pms.ocp.model.entity.OcpTenantSubs; import com.pms.ocp.model.entity.OcpTenantSubs;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper @Mapper
public interface OcpTenantSubsMapper extends BaseMapper<OcpTenantSubs> { public interface OcpTenantSubsMapper extends BaseMapper<OcpTenantSubs> {
List<OcpTenantSubs> getOcpTenantList(OcpTenantSubs ocpTenantSubs);
} }
package com.pms.ocp.model.entity; package com.pms.ocp.model.entity;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
...@@ -25,66 +26,77 @@ public class OcpTenantAudit implements Serializable { ...@@ -25,66 +26,77 @@ public class OcpTenantAudit implements Serializable {
*/ */
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty("主键ID") @ApiModelProperty("主键ID")
@Excel(name = "主键ID",orderNum = "1")
private String objId; private String objId;
/** /**
* 应用code * 应用code
*/ */
@ApiModelProperty("应用code") @ApiModelProperty("应用code")
@Excel(name = "应用code",orderNum = "2")
private String tenantCode; private String tenantCode;
/** /**
* 操作状态0:新增,1:迭代;2,下线 * 操作状态0:新增,1:迭代;2,下线
*/ */
@ApiModelProperty("操作状态0:新增,1:迭代;2,下线") @ApiModelProperty("操作状态0:新增,1:迭代;2,下线")
@Excel(name = "操作状态0:新增,1:迭代;2,下线",orderNum = "3")
private Short operStatus; private Short operStatus;
/** /**
* 类型0:人工操作,1:流程管控,3:总部下发 * 类型0:人工操作,1:流程管控,3:总部下发
*/ */
@ApiModelProperty("类型0:人工操作,1:流程管控,3:总部下发") @ApiModelProperty("类型0:人工操作,1:流程管控,3:总部下发")
@Excel(name = "类型0:人工操作,1:流程管控,3:总部下发",orderNum = "4")
private Short auditType; private Short auditType;
/** /**
* 备注简述 * 备注简述
*/ */
@ApiModelProperty("备注简述") @ApiModelProperty("备注简述")
@Excel(name = "备注简述",orderNum = "5")
private String auditMessage; private String auditMessage;
/** /**
* 应用事记内容 * 应用事记内容
*/ */
@ApiModelProperty("应用事记内容") @ApiModelProperty("应用事记内容")
@Excel(name = "应用事记内容",orderNum = "6")
private String auditJson; private String auditJson;
/** /**
* 提交人id * 提交人id
*/ */
@ApiModelProperty("提交人id") @ApiModelProperty("提交人id")
@Excel(name = "提交人id",orderNum = "7")
private String auditUserId; private String auditUserId;
/** /**
* 提交人姓名 * 提交人姓名
*/ */
@ApiModelProperty("提交人姓名") @ApiModelProperty("提交人姓名")
@Excel(name = "提交人姓名",orderNum = "8")
private String auditUserName; private String auditUserName;
/** /**
* 创建时间 * 创建时间
*/ */
@ApiModelProperty("创建时间") @ApiModelProperty("创建时间")
@Excel(name = "创建时间",orderNum = "9")
private Date auditCtime; private Date auditCtime;
/** /**
* 应用版本(当前版本) * 应用版本(当前版本)
*/ */
@ApiModelProperty(" 应用版本(当前版本") @ApiModelProperty(" 应用版本(当前版本")
@Excel(name = " 应用版本(当前版本",orderNum = "10")
private String applyVersion; private String applyVersion;
/** /**
* 上一版本 * 上一版本
*/ */
@ApiModelProperty("上一版本") @ApiModelProperty("上一版本")
@Excel(name = " 上一版本",orderNum = "11")
private String perTenantVersion; private String perTenantVersion;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -256,16 +268,16 @@ public class OcpTenantAudit implements Serializable { ...@@ -256,16 +268,16 @@ public class OcpTenantAudit implements Serializable {
} }
OcpTenantAudit other = (OcpTenantAudit) that; OcpTenantAudit other = (OcpTenantAudit) that;
return (this.getObjId() == null ? other.getObjId() == null : this.getObjId().equals(other.getObjId())) return (this.getObjId() == null ? other.getObjId() == null : this.getObjId().equals(other.getObjId()))
&& (this.getTenantCode() == null ? other.getTenantCode() == null : this.getTenantCode().equals(other.getTenantCode())) && (this.getTenantCode() == null ? other.getTenantCode() == null : this.getTenantCode().equals(other.getTenantCode()))
&& (this.getOperStatus() == null ? other.getOperStatus() == null : this.getOperStatus().equals(other.getOperStatus())) && (this.getOperStatus() == null ? other.getOperStatus() == null : this.getOperStatus().equals(other.getOperStatus()))
&& (this.getAuditType() == null ? other.getAuditType() == null : this.getAuditType().equals(other.getAuditType())) && (this.getAuditType() == null ? other.getAuditType() == null : this.getAuditType().equals(other.getAuditType()))
&& (this.getAuditMessage() == null ? other.getAuditMessage() == null : this.getAuditMessage().equals(other.getAuditMessage())) && (this.getAuditMessage() == null ? other.getAuditMessage() == null : this.getAuditMessage().equals(other.getAuditMessage()))
&& (this.getAuditJson() == null ? other.getAuditJson() == null : this.getAuditJson().equals(other.getAuditJson())) && (this.getAuditJson() == null ? other.getAuditJson() == null : this.getAuditJson().equals(other.getAuditJson()))
&& (this.getAuditUserId() == null ? other.getAuditUserId() == null : this.getAuditUserId().equals(other.getAuditUserId())) && (this.getAuditUserId() == null ? other.getAuditUserId() == null : this.getAuditUserId().equals(other.getAuditUserId()))
&& (this.getAuditUserName() == null ? other.getAuditUserName() == null : this.getAuditUserName().equals(other.getAuditUserName())) && (this.getAuditUserName() == null ? other.getAuditUserName() == null : this.getAuditUserName().equals(other.getAuditUserName()))
&& (this.getAuditCtime() == null ? other.getAuditCtime() == null : this.getAuditCtime().equals(other.getAuditCtime())) && (this.getAuditCtime() == null ? other.getAuditCtime() == null : this.getAuditCtime().equals(other.getAuditCtime()))
&& (this.getApplyVersion() == null ? other.getApplyVersion() == null : this.getApplyVersion().equals(other.getApplyVersion())) && (this.getApplyVersion() == null ? other.getApplyVersion() == null : this.getApplyVersion().equals(other.getApplyVersion()))
&& (this.getPerTenantVersion() == null ? other.getPerTenantVersion() == null : this.getPerTenantVersion().equals(other.getPerTenantVersion())); && (this.getPerTenantVersion() == null ? other.getPerTenantVersion() == null : this.getPerTenantVersion().equals(other.getPerTenantVersion()));
} }
@Override @Override
......
...@@ -6,4 +6,6 @@ import com.pms.ocp.model.vo.ResponseVO; ...@@ -6,4 +6,6 @@ import com.pms.ocp.model.vo.ResponseVO;
public interface OcpApiTenantRelService { public interface OcpApiTenantRelService {
ResponseVO getOatrList(OcpApiTenantRel ocpApiTenantRel); ResponseVO getOatrList(OcpApiTenantRel ocpApiTenantRel);
ResponseVO getTenantApiList(OcpApiTenantRel ocpApiTenantRel);
} }
...@@ -3,8 +3,15 @@ package com.pms.ocp.service; ...@@ -3,8 +3,15 @@ package com.pms.ocp.service;
import com.pms.ocp.model.entity.OcpTenantAudit; import com.pms.ocp.model.entity.OcpTenantAudit;
import com.pms.ocp.model.vo.ResponseVO; import com.pms.ocp.model.vo.ResponseVO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public interface OcpTenantAuditService { public interface OcpTenantAuditService {
ResponseVO getOtaList(OcpTenantAudit ocpTenantAudit); ResponseVO getOtaList(OcpTenantAudit ocpTenantAudit);
ResponseVO getOtaListById(OcpTenantAudit ocpTenantAudit); ResponseVO getOtaListById(OcpTenantAudit ocpTenantAudit);
void exportExcel(OcpTenantAudit ocpTenantAudit, HttpServletRequest request, HttpServletResponse response);
ResponseVO OtaById(OcpTenantAudit ocpTenantAudit);
} }
...@@ -2,6 +2,8 @@ package com.pms.ocp.service; ...@@ -2,6 +2,8 @@ package com.pms.ocp.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.pms.ocp.model.entity.OcpTenantSubs; import com.pms.ocp.model.entity.OcpTenantSubs;
import com.pms.ocp.model.vo.ResponseVO;
public interface OcpTenantSubsService extends IService<OcpTenantSubs> { public interface OcpTenantSubsService extends IService<OcpTenantSubs> {
ResponseVO getOcpTenantList(OcpTenantSubs ocpTenantSubs);
} }
...@@ -22,4 +22,10 @@ public class OcpApiTenantRelServiceImpl extends ServiceImpl<OcpApiTenantRelMappe ...@@ -22,4 +22,10 @@ public class OcpApiTenantRelServiceImpl extends ServiceImpl<OcpApiTenantRelMappe
List<OcpApiTenantRel> oatrList = ocpApiTenantRelMapper.getOatrList(ocpApiTenantRel); List<OcpApiTenantRel> oatrList = ocpApiTenantRelMapper.getOatrList(ocpApiTenantRel);
return ResponseVO.ok(oatrList); return ResponseVO.ok(oatrList);
} }
@Override
public ResponseVO getTenantApiList(OcpApiTenantRel ocpApiTenantRel) {
List<OcpApiTenantRel> oatrList = ocpApiTenantRelMapper.getTenantApiList(ocpApiTenantRel);
return ResponseVO.ok(oatrList);
}
} }
package com.pms.ocp.service.impl; package com.pms.ocp.service.impl;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pms.ocp.common.constants.AnalysisConstant;
import com.pms.ocp.common.constants.ExportUtils;
import com.pms.ocp.mapper.OcpTenantAuditMapper; import com.pms.ocp.mapper.OcpTenantAuditMapper;
import com.pms.ocp.model.entity.OcpTenantAudit; import com.pms.ocp.model.entity.OcpTenantAudit;
import com.pms.ocp.model.vo.ResponseVO; import com.pms.ocp.model.vo.ResponseVO;
import com.pms.ocp.service.OcpTenantAuditService; import com.pms.ocp.service.OcpTenantAuditService;
import org.apache.poi.ss.usermodel.Workbook;
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 javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
@Service @Service
...@@ -26,4 +33,18 @@ public class OcpTenantAuditServiceImpl extends ServiceImpl<OcpTenantAuditMapper, ...@@ -26,4 +33,18 @@ public class OcpTenantAuditServiceImpl extends ServiceImpl<OcpTenantAuditMapper,
List<OcpTenantAudit> otaListById = ocpTenantAuditMapper.getOtaListById(ocpTenantAudit); List<OcpTenantAudit> otaListById = ocpTenantAuditMapper.getOtaListById(ocpTenantAudit);
return ResponseVO.ok(otaListById); return ResponseVO.ok(otaListById);
} }
@Override
public void exportExcel(OcpTenantAudit ocpTenantAudit, HttpServletRequest request, HttpServletResponse response) {
List<OcpTenantAudit> otaListById = ocpTenantAuditMapper.getOtaListById(ocpTenantAudit);
ExportParams param = new ExportParams(AnalysisConstant.exportOcpTenantApiName.OCP_TENANT_API,AnalysisConstant.exportOcpTenantApiName.OCP_TENANT_API);
Workbook workbook = ExcelExportUtil.exportExcel(param, OcpTenantAudit.class,otaListById);
ExportUtils.exportExcel(response, AnalysisConstant.exportOcpTenantApiName.OCP_TENANT_API,workbook);
}
@Override
public ResponseVO OtaById(OcpTenantAudit ocpTenantAudit) {
List<OcpTenantAudit> otaById = ocpTenantAuditMapper.OtaById(ocpTenantAudit);
return ResponseVO.ok(otaById);
}
} }
...@@ -3,10 +3,22 @@ package com.pms.ocp.service.impl; ...@@ -3,10 +3,22 @@ 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.mapper.OcpTenantSubsMapper; import com.pms.ocp.mapper.OcpTenantSubsMapper;
import com.pms.ocp.model.entity.OcpTenantSubs; import com.pms.ocp.model.entity.OcpTenantSubs;
import com.pms.ocp.model.vo.ResponseVO;
import com.pms.ocp.service.OcpTenantExtentService; import com.pms.ocp.service.OcpTenantExtentService;
import com.pms.ocp.service.OcpTenantSubsService; import com.pms.ocp.service.OcpTenantSubsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
@Service @Service
public class OcpTenantSubsServiceImpl extends ServiceImpl<OcpTenantSubsMapper, OcpTenantSubs> implements OcpTenantSubsService { public class OcpTenantSubsServiceImpl extends ServiceImpl<OcpTenantSubsMapper, OcpTenantSubs> implements OcpTenantSubsService {
} @Autowired
private OcpTenantSubsMapper ocpTenantSubsMapper;
@Override
public ResponseVO getOcpTenantList(OcpTenantSubs ocpTenantSubs) {
List<OcpTenantSubs> ocpTenantList = ocpTenantSubsMapper.getOcpTenantList(ocpTenantSubs);
return ResponseVO.ok(ocpTenantList);
}
}
\ No newline at end of file
...@@ -10,4 +10,12 @@ ...@@ -10,4 +10,12 @@
oa.tenant_code where oa.obj_id = #{objId} oa.tenant_code where oa.obj_id = #{objId}
</select> </select>
<select id="getTenantApiList" resultType="com.pms.ocp.model.entity.OcpApiTenantRel">
SELECT * from ocp_api_tenant_rel
oa LEFT JOIN ocp_api_base ab on
oa.api_code = ab.api_code INNER JOIN
ocp_tenant_base ot on ot.tenant_code =
oa.tenant_code where oa.tenant_code = #{tenantCode}
</select>
</mapper> </mapper>
...@@ -8,4 +8,11 @@ ...@@ -8,4 +8,11 @@
<select id="getOtaListById" resultType="com.pms.ocp.model.entity.OcpTenantAudit"> <select id="getOtaListById" resultType="com.pms.ocp.model.entity.OcpTenantAudit">
select * from ocp_tenant_audit where obj_id = #{objId} select * from ocp_tenant_audit where obj_id = #{objId}
</select> </select>
<select id="OtaById" 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.obj_id = #{objId}
</select>
</mapper> </mapper>
\ No newline at end of file
<?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.OcpTenantSubsMapper">
<select id="getOcpTenantList" resultType="com.pms.ocp.model.entity.OcpTenantSubs">
SELECT * from ocp_tenant_subs ots
left JOIN ocp_tenant_base otb on
ots.tenant_code = otb.tenant_code
</select>
</mapper>
\ No newline at end of file
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