diff --git a/operation-control-platform.iml b/operation-control-platform.iml index dea2777f8256cd17cf45cc62d055b77b712c2ff2..5f7ca8d71b7b14ee026bb8ced3ba5b6f60e14800 100644 --- a/operation-control-platform.iml +++ b/operation-control-platform.iml @@ -1,18 +1,23 @@ + + + + + + - - - - - + + diff --git a/src/main/java/com/pms/ocp/common/constants/AnalysisConstant.java b/src/main/java/com/pms/ocp/common/constants/AnalysisConstant.java new file mode 100644 index 0000000000000000000000000000000000000000..e9352fd727294902aac49c9baf08a19cbe0108aa --- /dev/null +++ b/src/main/java/com/pms/ocp/common/constants/AnalysisConstant.java @@ -0,0 +1,7 @@ +package com.pms.ocp.common.constants; + +public interface AnalysisConstant { + interface exportOcpApiAuditName{ + final String OCP_API_AUDIT= "服务大事记导出数据"; + } +} diff --git a/src/main/java/com/pms/ocp/common/constants/Constant.java b/src/main/java/com/pms/ocp/common/constants/Constant.java new file mode 100644 index 0000000000000000000000000000000000000000..95cb75152fa088c250b139be2d8ba3740226aa42 --- /dev/null +++ b/src/main/java/com/pms/ocp/common/constants/Constant.java @@ -0,0 +1,728 @@ +package com.pms.ocp.common.constants; + +import java.math.BigDecimal; + +public interface Constant { + + /** + * 系统参数 + */ + interface SYSTEM { + /** + * 系统名称 + */ + String NAME = "全口径房地资源管理系统"; + } + + /** + * 异常类常量值 + */ + interface Exception { + String ERRORSQL = "Error SQL"; + + /** + * 巡店接口返回 + */ + String ERROR = "error"; + } + + /** + * excel 参数 + */ + interface ExcelConfig { + /** + * excel缓存 + */ + String EXCEL_KEY_PREFIX = "excel:cache:%s"; + } + + + /** + * 常用列名 + */ + interface ColumnName { + String IS_DEL = "is_del"; + } + + + /** + * 返回结果 success:成功,fail:业务返回的失败,error:非业务异常失败 + */ + interface ReqResult { + /** + * 成功 + */ + String SUCCESS = "success"; + /** + * 失败 + */ + String FAIL = "fail"; + /** + * 异常 + */ + String ERROR = "error"; + } + + /** + * 常用数值 + */ + interface Number { + Integer MINUS_ZERO = -1; + Integer TWENTY = 20; + Integer THIRTY = 30; + Integer ZERO = 0; + Integer ONE = 1; + Integer TWO = 2; + Integer THREE = 3; + Integer FOUR = 4; + Integer FIVE = 5; + Integer SIX = 6; + Integer SEVEN = 7; + Integer EIGHT = 8; + Integer NINE = 9; + Integer TEN = 10; + Integer TWENTYFOUR = 24; + Integer TWENTYFIVE = 25; + Integer TWENTYSIX = 26; + Integer THIRTYTWO = 32; + Integer THIRTYTHREE = 33; + Integer THIRTYFOUR = 34; + Integer THIRTYSIX = 36; + Integer FOURTY = 40; + Integer FORTYTWO = 42; + Integer LENGTH = 3; + Integer NINETYNINE = 99; + Integer ONEHUNDRED = 100; + Integer ONETHOUSAND = 1000; + Integer TENTHOUSAND = 10000; + Integer TENMILLION = 10000000; + Integer ELEVEN = 11; + Long ZEROL = 0L; + Long ONEL = 1L; + Long COMPANY = 2L; + Long BUSINESS = 3L; + Long ONETHOUSANDL = 1000L; + Byte ONEB = 1; + Byte TWOB = 2; + Byte THREEB = 3; + Byte ANTI_INITLIZED = 0; + Byte INITLIZED = 1; + Double ZBXS = 0.01; + BigDecimal ZEROB = new BigDecimal(0); + BigDecimal ONEHUNDREDB = new BigDecimal(100); + BigDecimal TENTHOUSANDB = new BigDecimal(10000); + } + + /** + * 当前环境 dev:开发, test:测试, prod:生产 + */ + interface ProfileActive { + /** + * 开发环境 + */ + String DEV = "dev"; + /** + * 测试环境 + */ + String TEST = "test"; + /** + * 私人测试文件 + */ + String TEST_ONE ="test1"; + /** + * 生产环境 + */ + String PROD = "prod"; + /** + * 联调环境 + */ + String LIANTIAO = "liantiao"; + /** + * 本机 + */ + String HOST = "host"; + /** + * 南瑞部门提测 + */ + String TESTNARI = "testnari"; + } + + /** + * Service缓存value + */ + interface RedisCache { + /** + * Redis key 分隔符(@Cacheable自动生成的分隔符) + */ + String redisSeparator = "::"; + /** + * 设置累计访问redis key + */ + String CUMULATIVE_NUMBER = "cumulativeNumber"; + + /** + * 在线人数 + */ + String ONLINE_NUMBER= "onlineNumber"; + } + + /** + * 系统配置 + */ + interface SysConfig { + /** + * 同步锁自动超时时间(单位:秒) + */ + long REDIS_LOCK_TIMEOUT = 20; + /** + * 凭证操作同步锁自动释放时间(单位:秒) + */ + long VOUCHER_LOCK_TIMEOUT = 60; + /** + * 结账操作锁自动释放时间(单位:秒) + **/ + long SETTLE_ACCOUNT_LOCK_TIMEOUT = 60 * 20; + /** + * 结账后是否允许修改现金流量 + **/ + byte SETTLE_ALLOW_EDIT_CASH_FLOW = 1; + /** + * 记录超时接口阈值 + **/ + long LONG_TIME_THRESHOLD = 1000; + /** + * 预警耗时日志打印 + **/ + String LONG_OUT_TIME_LOG = "接口预警:接口:{} 耗时:{}毫秒"; + /** + * 预警耗时日志打印 + **/ + String LONG_TIME_LOG = "接口耗时:接口:{} 耗时:{}毫秒"; + } + + + /** + * 常用字符 + */ + interface Character { + String ENTITY = "'entity"; + String TXT = ".txt"; + String BRACKETS = "("; + String GROUP_CODE = "0000"; + String QUESTION = "?"; + String EQUALS = "="; + String AND = "&"; + String COLON = ":"; + String ASTERISK = "*"; + String POINT = "."; + String COMMA = ","; + String BRACKET_LEFT_B = "{"; + String BRACKET_RIGHT_B = "}"; + String ZERO = "00"; + String ONE = "001"; + String String_ZERO = "0"; + String String_ZEROB = "0.00"; + String NULL_VALUE = ""; + String UNDER_LINE = "_"; + String MIDDLE_LINE = "-"; + String MIDDLE_WAVE = "~"; + String VIRGULE = "/"; + Byte FAIL = 0; + Byte SUCCESS = 1; + Byte IS_REFERENCE = 2; + String Percent = "%"; + String UTF8 = "utf-8"; + String HASH_SIGN = "#"; + String COMMA_SINGLE_QUOTE_SEPERATOR = "','"; + String DOUBLE_COMMA = ",,"; + String ON = "ON"; + String OFF = "OFF"; + String TIP_FLAG = "tipFlag"; + String ALIAS_R = "r"; + String ZEROZRRO = "0.00"; + String AllCOUNT = "AllCount"; + String FILE = "class"; + String STRINGONE = "1"; + String STRINGTWO = "2"; + String STRINGTHREE = "3"; + String STRINGFOUR = "4"; + String STRINGFIVE = "5"; + String land = "land"; + String build = "build"; + String NO = "否"; + String YES = "是"; + String NOHAVA = "无"; + String GB2312 = "gb2312"; + String text2312 = "text/plain;charset=gb2312"; + String QUERYAFTERMODIFICATION= "QueryAfterModification"; + String APPLICATION_PATH_IN_NACOS= "applicationPathInNacos"; + String IP_VERIFY = "^((25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]?\\d)\\.){3}(25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]?\\d)$"; + String COMPUTER_NAME = "COMPUTERNAME"; + String DIMENSIONENTITY_PATH = "com.sgcc.nari.common.entity.requestEntity.DimensionEntity"; + String RETURNVALUE = "returnValue"; + String PARAMETER_VALUE = "parameterValue"; + + } + + + /** + * 是否 + */ + interface Is { + Byte YES = 1; + Byte NO = 0; + Integer NO_INT = 0; + Integer YES_INT = 1; + } + + /** + * FTP + */ + interface ftpCode { + /** + * word后缀 + */ + String FORMATSUFFIX = ".docx"; + /** + * 报告前缀名称 + */ + String REPORTNAME = "全口径房地资源报告"; + /** + * 报告前缀名称 + */ + String REPORTSHORTNAME = "realLandResourceReport"; + /** + * 模板地址 + */ + String MOULDPATH = "mouldPath"; + /** + * 模板名称 + */ + String MOULDNAME = "mouldName"; + /** + * 简称 + */ + String SHORTNAME = "shortName"; + } + + /** + * 正则表达式常量 + */ + interface RegExp { + /** + * 括号,包括大括号和小括号 + */ + String BRACKETS = "\\{|\\}|\\(|\\)"; + /** + * 不可见字符 + */ + String INVISIBLE = "\\s"; + /** + * 运算符 加减乘除 + */ + String OPERATOR = "\\+|\\-|\\*|\\/"; + /** + * 数字,包括整形和浮点型 + */ + String NUMBER = "'(\\d|\\.)+'"; + /** + * 逗号开头或结尾 + */ + String COMMA_START_OR_END = "^,|,$"; + /** + * 井号左括号 + */ + String HASH_SIGN_BRACKET_LEFT = "#\\{"; + /** + * 右括号 + */ + String BRACKET_RIGHT = "\\}"; + /** + * #{内容},占位符内容 + */ + String PLACE_HOLDER_CONTENT = "#\\{([^}])*\\}"; + /** + * #{参数map. + */ + String PLACE_HOLDER_PARAM_MAP = "#\\{paramMap."; + /** + * 井号或者大括号 + */ + String HASH_SIGN_BRACKETS = "#|\\{|\\}"; + /** + * 空请求体 + */ + String EMPTY_REQUEST_BODY = "\\{\\s+\\}"; + } + + /** + * 中文转换 + */ + interface STRINGNAME { + /** + * 全部 + */ + String ALL = "全部"; + } + + /** + * 登陆参数 + */ + interface LOGUSED { + /** + * 操作系统名称 + */ + String OPERATING_SYSTEM = "os.name"; + /** + * 操作系统架构 + */ + String OPERATING_SYSTEM_FRAMEWORK = "os.arch"; + /** + * 登陆token标识 + */ + String AUTHORIZATION = "authorization"; + + /** + * ticket + */ + String TICKET = "ticket"; + + /** + * token + */ + String TOKEN = "token"; + } + + /** + * 加密用 + */ + interface cipher { + /** + * 前台sm2加密key + */ + String DECRYPT = "encryptData"; + } + + + /** + * 所属分类 + */ + interface Category { + /** + * 规划用途 + */ + String PLANPURPOSE = "规划用途"; + + /** + * 土地性质 + */ + + String LANDCHARACTER = "土地性质"; + /** + * 土地使用权类型 + */ + String LANDUSETYPECODE = "土地使用权类型"; + + /** + * 行政区域 + */ + String ORGANIZATION = "行政区域"; + + /** + * 来源 + */ + String SOURCE = "来源"; + + /** + * 投资来源 + */ + String INVESTRESOURCE = "投资来源"; + + + /** + * 房产分类 + */ + String BUILDTYPE = "房产分类"; + + /** + * 无证原因 + */ + String NOLICENSEREASON = "无证原因"; + + /** + * 单位级别 + */ + String UNITLEVELCODE = "单位级别"; + + /** + * 业务类型 + */ + String BUSINESSTYPE = "业务类型"; + } + + /** + * 单位级别 + */ + interface unitLevelCode { + //总部 + String HEADQUARTERS_LEVEL = "1"; + + //分部 + String SUBSECTION_LEVEL = "2"; + + //省 + String PROVINCE_LEVEL = "3"; + + //市 + String CITY_LEVEL = "4"; + + //县 + String COUNTY_LEVEL = "5"; + + } + + /** + * 请求方式 + */ + interface METHOD { + //REQUEST + String GET = "GET"; + //POST + String POST = "POST"; + } + + /** + * 字段类型 + */ + interface CATEGORYTYPE { + /** + * 土地规划用途 + */ + String PLANPURPOSE = "规划用途"; + + /** + * 土地性质 + */ + String LANDCHARACTER = "土地性质"; + + /** + * 土地使用权类型 + */ + String LANDUSETYPE = "土地使用权类型"; + + /** + * 无证原因 + */ + String NOLICENSEREASON = "无证原因"; + + /** + * 来源 + */ + String SOURCE = "来源"; + + /** + * 投资来源 + */ + String INVESTSOURCE = "投资来源"; + + /** + * 房产分类 + */ + String REALESTATETYPE = "房产分类"; + + /** + * 行政区域 + */ + String AREA = "行政区域"; + } + + /** + * 日志操作类型 + */ + interface LOGHANDLETYPE { + + /** + * 查看 + */ + String SELECT = "查看"; + + /** + * 添加 + */ + String INSERT = "新增"; + + /** + * 删除 + */ + String DELETE = "删除"; + + /** + * 修改 + */ + String UPDATE = "修改"; + } + + /** + * 图片上传下载 + */ + interface pictureConstant { + /** + * 排序 + */ + String SORT = "[^0-9]"; + /** + * "redisKey", + */ + String REDISKEY = "redisKey"; + /** + * line.separator + */ + String LINE_SEPARATOR= "line.separator"; + /** + * 校验图片格式正则 + */ + + String PICTURE_FORMAT = "^(.+?)\\.(png|jpg|gif|jpeg|bmp|PNG|JPG|GIF|JPEG|BMP)$"; + /** + * 正则 + */ + String PICREGEX = ".*[`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。,、?\\\\]+.*"; + /** + * JPG + */ + String JPG = "JPG"; + /** + * JEPG + */ + String JPEG = "JPEG"; + /** + * PNG + */ + String PNG = "PNG"; + /** + * GIF + */ + String GIF = "GIF"; + /** + * BMP + */ + String BMP = "BMP"; + /** + * 行号 + */ + String LINENUMBER = "行号:"; + String HP = "http://"; + + } + + /** + * 日志监控参数 + */ + interface MONITOR { + /** + * 审计人员角色 + */ + String AUDITROLE = "审计人员"; + + /** + * 审计日志 + */ + String AUDITLOG = "审计日志"; + + /** + * 系统维护 + */ + String SYSTEMMAINTAIN = "系统维护人员"; + + /** + * 系统服务 + */ + String SYSTEMSERVICE = "系统服务"; + + /** + * 系统告警 + */ + String SYSTEMWARNING = "系统告警"; + } + + /** + * 消息类型 + */ + interface NOTIFICATION_MESSAGE_TYPE { + /** + * PC + */ + int PC = Number.ZERO; + + /** + * 邮件 + */ + int MAIL = Number.ONE; + + /** + * 短信 + */ + int TEXT_MESSAGE = Number.TWO; + + /** + * 微信 + */ + int WECHAT = Number.THREE; + + /** + * 其它 + */ + int OTHER = Number.FOUR; + } + + /** + * 消息类型 + */ + interface NOTIFICATION_BUSINESS_TYPE { + /** + * 消息 + */ + int MESSAGE = 1; + + /** + * 告警 + */ + int WARNING = 2; + } + + /** + * 告警标题 + */ + interface WARNING_HEAD { + /** + * 日志容量告警 + */ + String AUDIT_SIZE_WARNING_HEAD = "日志容量告警"; + + /** + * 审计日志 + */ + String TABLE_NAME = "审计日志"; + + } + + /** + * 告警内容 + */ + interface WARNING_CONTENT { + /** + * 日志容量告警 + */ + String AUDIT_SIZE_WARNING_CONTENT = "当前日志容量已经超过监控阈值,监控阈值为 %s MB,当前实际产生容量为 %s MB,请尽快处理!"; + } + + /** + * ISC邮件信息配置 + */ + interface ISCEMAIL { + /** + * ISC邮件信息配置 + */ + String SENDEMAIL = "qkjfdzyxt@isc.com"; + } +} diff --git a/src/main/java/com/pms/ocp/common/constants/ExportUtils.java b/src/main/java/com/pms/ocp/common/constants/ExportUtils.java new file mode 100644 index 0000000000000000000000000000000000000000..88931382a7a4e23e93d575657e187d07fe8ab7c8 --- /dev/null +++ b/src/main/java/com/pms/ocp/common/constants/ExportUtils.java @@ -0,0 +1,148 @@ +package com.pms.ocp.common.constants; + + +import org.apache.poi.ss.usermodel.Workbook; + +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.URLEncoder; +import java.util.Locale; +import java.util.regex.Pattern; + +public class ExportUtils { + + /** + * 校验Header Manipulation + * @param header 参数 + * @return 数据 + */ + public static String headerManipulation(String header) { + if(StringUtils.isNullOrEmpty(header)){ + return header; + } + String regex = "[`~!@#$%^&*()\\+\\=\\{}|:\"?><【】\\/r\\/n]"; + Pattern pattern = Pattern.compile(regex); + pattern.matcher(header).replaceAll("").trim(); + return header; + } + + /** + * 流导出文件至浏览器 + * + * @param response + * @param in + * @param fileName + */ + public static void exportWorld(HttpServletResponse response, InputStream in, String fileName) { + OutputStream out = null; + try { + response.reset(); + String fileHeaderName = URLEncoder.encode(fileName, Constant.Character.UTF8); + response.setHeader("Content-Disposition", "attachment;filename=" + headerManipulation(fileHeaderName)); + response.setContentType("application/msword;charset=UTF-8"); + response.setHeader("Access-Control-Expose-Headers", "Content-Disposition"); + response.setHeader("Access-Control-Allow-Origin", "*"); + out = response.getOutputStream(); + //定义缓存 + byte[] buffer = new byte[1024]; + int i; + while ((i = in.read(buffer)) != Constant.Number.MINUS_ZERO) { + out.write(buffer, Constant.Number.ZERO, i); + } + out.flush(); + } catch (IOException e) { + e.printStackTrace(); + throw new ServiceException(com.pms.ocp.common.constants.ResultCodee.INTERNAL_SERVER_ERROR); + } finally { + if (out != null){ + try { + out.close(); + } catch (IOException e) { + e.printStackTrace(); + } + ; + } + if (in != null) { + try { + in.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } + + /** + * Workbook导出浏览器 + * 文件导出添加跨域 Access-Control-Allow-Origin + * @param response + * @param fileName + * @param workbook + */ + public static void exportExcel(HttpServletResponse response, String fileName, Workbook workbook) { + try { + response.reset(); + String fileHeaderName = URLEncoder.encode(fileName, Constant.Character.UTF8); + response.setHeader("Content-Disposition", "attachment;filename=" + headerManipulation(fileHeaderName)); + response.setHeader("Access-Control-Expose-Headers", "Content-Disposition"); + response.setHeader("Access-Control-Allow-Origin", "*"); + response.setContentType("application/vnd.ms-excel;charset=UTF-8"); + ServletOutputStream outputStream = response.getOutputStream(); + workbook.write(outputStream); + } catch (IOException e) { + e.printStackTrace(); + throw new ServiceException(com.pms.ocp.common.constants.ResultCodee.INTERNAL_SERVER_ERROR); + } + } + + /** + * 图片导出 + * + * @param response + * @param in + * @param fileName + */ + public static void exportPic(HttpServletResponse response, InputStream in, String fileName) { + try { + if (in != null) { + response.reset(); + String fileHeaderName = URLEncoder.encode(fileName, Constant.Character.UTF8); + String fileExtensionName = fileName.substring(fileName.lastIndexOf(".") + 1).toUpperCase(Locale.ENGLISH); + switch (fileExtensionName) { + case "JEPG": + case "JPG": + response.setContentType("image/jepg;charset=UTF-8"); + break; + case "PNG": + response.setContentType("image/png;charset=UTF-8"); + break; + case "BMP": + response.setContentType("application/x-bmp;charset=UTF-8"); + break; + default: + response.setContentType("application/octet-stream;charset=UTF-8"); + break; + + } + response.setHeader("Content-Disposition", "attachment;filename=" + headerManipulation(fileHeaderName)); + response.setHeader("Access-Control-Expose-Headers", "Content-Disposition"); + response.setHeader("Access-Control-Allow-Origin", "*"); + byte[] buffer = new byte[1024]; + OutputStream out = response.getOutputStream(); + int i; + while ((i = in.read(buffer)) != -1) { + out.write(buffer, 0, i); + } + out.flush(); + out.close(); + in.close(); + } + } catch (IOException e) { + e.printStackTrace(); + throw new ServiceException(ResultCodee.INTERNAL_SERVER_ERROR); + } + } +} diff --git a/src/main/java/com/pms/ocp/common/constants/ResultCodee.java b/src/main/java/com/pms/ocp/common/constants/ResultCodee.java new file mode 100644 index 0000000000000000000000000000000000000000..605dec1e541a73ffcfb28051f1846c8a775ccbd6 --- /dev/null +++ b/src/main/java/com/pms/ocp/common/constants/ResultCodee.java @@ -0,0 +1,173 @@ +package com.pms.ocp.common.constants; + +/** + * 异常枚举类 + */ +public enum ResultCodee { + /* ============================ 通用错误码 ========================== **/ + /** + * 禁止访问 303 + **/ + PARAMS_NOT(303, "缺少参数"), + + /** + * 存在错误参数 304 + */ + PARAMS_NOT_RIGHT(304, "存在错误参数"), + + /** + * 存在错误测试数据 305 + */ + DATA_ERROR(305, "存在错误测试数据"), + + /** + * 存在错误测试数据 305 + */ + SERVER_ERROR(306, "服务异常"), + /** + * 校验失败 307 + **/ + VERIFICATION_FAIL(307, "校验失败"), + + /** + * 错误请求 400 + **/ + BAD_REQUEST(400, "错误请求"), + + /** + * 未经授权 401 + **/ + UNAUTHORIZED(401, "未经授权"), + + /** + * 禁止访问 403 + **/ + FORBIDDEN(403, "禁止访问"), + /** + * 连接超时 + **/ + TIME_OUT(408, "连接超时"), + /** + * Feign连接错误 + **/ + FEIGN_CONNECT_ERROR(409, "feignClient 连接错误:%s"), + /** + * Feign连接错误 + **/ + BAD_REQUEST_METHOD(410, "不合法的请求方式"), + /** + * 操作异常 500 + **/ + INTERNAL_SERVER_ERROR(500, "操作异常"), + /** + * SQL异常 + **/ + SQL_ERROR_EXCEPTION(501, "SQL执行异常!"), + /** + * 操作失败 + **/ + OPERATION_FAILURE(507, "操作失败"), + /** + * 日期格式处理异常 + **/ + DATE_FORMAT_EXCEPTION(508, "日期格式处理异常"), + /** + * 项目启动文件异常 + */ + SYSTEM_PROFILE_EXCEPTION(509, "错误的项目启动文件"), + + /* ============================ 业务/错误码 start========================== **/ + /* ===========================后台系统======================== **/ + RECORD_NOT_EXIST(10001, "相关记录不存在!"), + SYS_USER_INVALID(10002, "用户登录已过期!"), + PERMISSION_NOT(10003, "无访问权限!"), + ACCOUNT_NOT(10004, "账号异常!"), + SHIRO_ERROR(10005, "鉴权/授权过程出错!"), + MENU_EXIST(10006, "菜单定义已存在!"), + ROLE_EXIST(10007, "角色定义已存在!"), + CODE_EXIST(10008, "编码已存在!"), + NAME_EXIST(10009, "名称已存在!"), + USER_ORGANIZATION_LEVEL_ERROR(10023, "用户组织机构关联层级有误!"), + USER_ORGANIZATION_INFO_ERROR(10024,"用户组织机构信息有误!"), + TOKEN_INVALID(9997, "登录失效,请重新登录!"), + /* ============================ 文件处理 错误码 ========================== **/ + FILE_NOT_EXISTS(21001, "文件不存在"), + FILE_MUST_IS_EXCEL(21002, "文件类型必须是excel"), + UPLOAD_EXCEPTION(21003, "上传过程出现异常"), + EXCEL_RULE_NOT_EXISTS(21004, "excel校验规则不存在"), + EXCEL_TEMPLATE_NOT_EXISTS(21005, "excel模板不存在"), + EXCEL_TEMPLATE_NOT_CORRECT(21009, "excel模板不对,请重新下载"), + EXCEL_DATA_NOT_EXISTS(21006, "excle数据不存在"), + EXCEL_NOT_CORRECT(21007, "excel不正确"), + EXCEL_PARSE_CORRECT(21010,"excel解析错误"), + CURRENT_MONTH_NOT_EXISTS(21008, "当前年月数据不存在"), + BATCH_NOT_NEED(21009, "无需批量操作!"), + CELL_IS_NULL(21010, "值不能为空"), + CELL_FORMAT_ERROR(21011, "值格式不正确"), + CELL_MIN_LENGTH_ERROR(21012, "值小于最小长度"), + CELL_MAX_LENGTH_ERROR(21013, "值大于最大长度"), + CELL_REGULAR_ERROR(21014, "值正则验证不通过"), + CELL_OPTION_ERROR(21015, "值不在选项集范围内"), + ROW_DUPLICATE_ERROR(21016, "行重复性校验未通过"), + CELL_DATE_FORMAT_ERROR(21017,"日期范围格式不正确"), + + DATA_MISSING_UNITS(21018, "数据缺少单位级别编码"), + PICTURE_NAME_ILLEGAL(21019, "图片名称不合法,请重新上传"), + FILE_MUST_IS_PIC(21020, "图片格式不合法,请重新上传!"), + NAME_CONFLICT(21021, "该组织机构下名称重复,请修改名称!"), + ENCRYPT_ERROR_CODE(21022, "解密失败"), + + /* ===========================JoyhrError======================== **/ + SIGN_ERROR(80001,"签名验证错误!"), + METHOD_ERROR(80002,"方法不存在!"), + /* ===========================CrmHookError======================== **/ + CRM_MEMBER_FOUND_ERROR(81001,"会员信息已存在"), + CRM_MEMBER_NOT_FOUND_ERROR(81002,"会员信息不存在"), + + /* =============主系统更改Error ================= **/ + MASTER_DATA_RELY_ERROR(90001,"切换系统与中台数据存在数据不匹配"), + + RELY_DATA_NOT_MATCH_BASE(90002,"切换系统依赖数据与中台数据存在不匹配数据"), + + BUS_DATA_NOT_MATCH_BASE(90003,"切换系统业务数据与中台数据存在不匹配数据"), + + DATA_MAPPING_NOT_MATCH_BASE(90004,"切换系统数据映射中数据与中台数据存在不匹配数据"), + + /* =============中台大平台系统 ================= **/ + LOGIN_TIME_OUT(130001,"登录失效或未登录,请重新登录"), + VERFICATION_CODE_ERROR(130002,"验证码不正确"), + NO_USER(130003,"用户不存在"), + PASSWORD_ERROR(130004,"密码不正确"), + MOBILE_USED(130005,"该手机号码已被注册"), + BANK_ACCOUNT_USED(130006,"该银行账号已被使用"), + OPEN_GOODS_FAIL(130009,"开通失败,请重新开通或联系相关人员"), + PROBATION_GOODS_FAIL(130010,"试用失败,请重新试用或联系相关人员"), + END_GOODS_FAIL(130011,"停用失败,请重新停用或联系相关人员"), + FIND_ORDER_LIST_FAIL(130012,"查询订单列表失败,请重新查询或联系相关人员"), + FIND_BILL_FAIL(130013,"查询账单列表失败,请重新查询或联系相关人员"), + FIND_SIX_MONTH_BILL(130014,"查询近6个月消费失败"), + FIND_MONTH_GOODS(130015,"查询该月份消费情况失败"), + /* =============数据维护 ================= **/ + TOTAL_SYNC_RECORD_EXITS(110001,"已执行过全量同步!"), + TOTAL_SYNC_RECORD_NOT_EXITS(110002,"还没执行全量同步!"); + + public final int statusCode; + public String msg; + + ResultCodee(int statusCode, String msg) { + this.statusCode = statusCode; + this.msg = msg; + } + + public int getStatusCode() { + return statusCode; + } + + public String getMessage() { + return msg; + } + + public void setMessage(String msg) { + this.msg = msg; + } +} diff --git a/src/main/java/com/pms/ocp/common/constants/ServiceException.java b/src/main/java/com/pms/ocp/common/constants/ServiceException.java new file mode 100644 index 0000000000000000000000000000000000000000..febd9a2cee0c5fe0e7a90f5adbd6005d13671c23 --- /dev/null +++ b/src/main/java/com/pms/ocp/common/constants/ServiceException.java @@ -0,0 +1,36 @@ +package com.pms.ocp.common.constants; + +public class ServiceException extends RuntimeException { + private static final long serialVersionUID = -6914996666319154848L; + /** + * 状态编码 + */ + public final int statusCode; + /** + * message信息 + */ + public final String msg; + /** + * 数据对象 + */ + public Object data; + + public ServiceException(String message, ResultCodee resultCode) { + super(message); + this.statusCode = resultCode.statusCode; + this.msg = message; + } + + public ServiceException(String message, ResultCodee resultCode, Object data) { + this(message, resultCode); + this.data = data; + } + + public ServiceException(ResultCodee resultCode) { + this(resultCode.msg, resultCode); + } + + public ServiceException(ResultCodee resultCode, Object data) { + this(resultCode.msg, resultCode, data); + } +} diff --git a/src/main/java/com/pms/ocp/common/constants/StringUtils.java b/src/main/java/com/pms/ocp/common/constants/StringUtils.java new file mode 100644 index 0000000000000000000000000000000000000000..e5bacea15e061ea2a28770f574b234fb2585eee8 --- /dev/null +++ b/src/main/java/com/pms/ocp/common/constants/StringUtils.java @@ -0,0 +1,1377 @@ +package com.pms.ocp.common.constants; + +import java.io.UnsupportedEncodingException; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + + +public class StringUtils { + + /** + * 常量3 + */ + private static final int INT3 = 3; + /** + * 常量4 + */ + private static final int INT4 = 4; + /** + * 常量16 + */ + private static final int INT16 = 16; + /** + * 常量0x4e00 + */ + private static final int INT0X4E00 = 0x4e00; + /** + * 常量0x9fa5 + */ + private static final int INT0X9FA5 = 0x9fa5; + /** + * 常量0xf900 + */ + private static final int INT0XF900 = 0xf900; + /** + * 常量0xfa2d + */ + private static final int INT0XFA2D = 0xfa2d; + + public static final String SLASH = getSlash(); + + public static final String BACKSLASH = getBackslash(); + + public static final String URL_SLASH = getURLSlash(); + + public static final String BASE64_TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + + private static final int[] wi = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2, 1}; + + private static final int[] vi = {1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2}; + + private static int[] ai = new int[18]; + + public StringUtils(){ + } + + /** + * getSlash + * @return 返回“/” + */ + public static String getSlash() + { + return "/"; + } + + /** + * @return 返回“\\” + */ + public static String getBackslash() + { + return "\\"; + } + + /** + * @return 返回“//” + */ + public static String getURLSlash() + { + return "//"; + } + + /** + * @return 返回网页的空符号“ ” + */ + public static String getHTMLBlank() + { + return " "; + } + + /** + * 判断两个字符串是否值相等 + * + * @param a + * 设置第一个字符串 + * @param b + * 设置第二个字符串 + * @return boolean 返回比较的结果 + */ + public static boolean compare(String a, String b) { + if (isEmpty(a) && isEmpty(b)) + return true; + if (!isEmpty(a) && !isEmpty(b)) + return a.equals(b); + else + return false; + } + + /** + * 判断两个字符串是否值相等,忽略大小写 + * @param a + * 设置第一个字符串 + * @param b + * 设置第二个字符串 + * @return boolean 返回比较的结果 + */ + public static boolean compareIgnoreCase(String a, String b) + { + if (isEmpty(a) && isEmpty(b)) + return true; + if (!isEmpty(a) && !isEmpty(b)) + return a.equalsIgnoreCase(b); + else + return false; + } + + /** + * 复制字符串中从开始到指定的位置 + * + * @param src + * 设置字符串 + * @param len + * 指定复制到某个位置 + * @return String 返回结果 + */ + public static String copy(String src, int len) + { + if (src == null) + return null; + if (src.length() > len) + return len <= 0 ? null : src.substring(0, len); + else + return src; + } + + /** + * 删除字符串中指定的一段字符串内容 + * + * @param src + * 设置原字符串 + * @param delStr + * 设置需要删除的字符串 + * @return String 返回结果 + */ + public static String delete(String src, String delStr) + { + if (isEmpty(src) || isEmpty(delStr)) + return src; + StringBuffer buffer = new StringBuffer(src); + for (int index = src.length(); (index = src.lastIndexOf(delStr, index)) >= 0; index -= delStr.length()) + buffer.delete(index, index + delStr.length()); + + return buffer.toString(); + } + + /** + * 将指定的字符和位置插入到原字符串中 + * + * @param src + * 设置原字符串 + * @param anotherStr + * 设置需要插入的字符串 + * @param offset + * 位置 + * @return String 返回结果 + */ + public static String insert(String src, String anotherStr, int offset) + { + if (isEmpty(src) || isEmpty(anotherStr)) + return src; + StringBuffer buffer = new StringBuffer(src); + if (offset >= 0 && offset <= src.length()) + buffer.insert(offset, anotherStr); + return buffer.toString(); + } + + /** + * 追加指定的字符串到原字符串中 + * + * @param src + * 设置原字符串 + * @param appendStr + * 设置需要追加的字符串 + * @return String 返回结果 + */ + public static String append(String src, String appendStr) + { + if (isEmpty(src) || isEmpty(appendStr)) + { + return src; + } + else + { + StringBuffer buffer = new StringBuffer(src); + buffer.append(appendStr); + return buffer.toString(); + } + } + + /** + * 根据参数替换字符串内容功能 + * + * @param src + * 设置原字符串 + * @param oldStr + * 指定替换字符串 + * @param newStr + * 将要替换的内容 + * @param isCaseSensitive + * 是否区分大小写 + * @return String 返回结果 + */ + public static String replace(String src, String oldStr, String newStr, boolean isCaseSensitive) + { + if (isEmpty(src) || isEmpty(oldStr) || newStr == null) + return src; + String s = isCaseSensitive ? src : src.toLowerCase(); + String o = isCaseSensitive ? oldStr : oldStr.toLowerCase(); + StringBuffer buffer = new StringBuffer(src); + for (int index = s.length(); (index = s.lastIndexOf(o, index)) >= 0; index -= o.length()) + buffer.replace(index, index + o.length(), newStr); + + return buffer.toString(); + } + + /** + * 根据参数替换字符串内容功能,可指定位置 + * + * @param src + * 设置原字符串 + * @param oldStr + * 指定替换字符串 + * @param newStr + * 将要替换的内容 + * @param isCaseSensitive + * 是否区分大小写 + * @param index + * 指定位置 + * @return String 返回结果 + */ + public static String replace(String src, String oldStr, String newStr, boolean isCaseSensitive, int index) + { + if (src == null || src.length() == 0 || oldStr == null || oldStr.length() == 0 || index <= 0) + return src; + if (newStr == null) + newStr = ""; + String s = isCaseSensitive ? src : src.toLowerCase(); + String o = isCaseSensitive ? oldStr : oldStr.toLowerCase(); + StringBuffer buffer = new StringBuffer(src); + int length = o.length(); + int pos; + for (pos = s.indexOf(o, 0); pos >= 0; pos = s.indexOf(o, pos + length)) + if (--index == 0) + break; + + if (pos >= 0 && index == 0) + buffer.replace(pos, pos + length, newStr); + return buffer.toString(); + } + + /** + * 获取指定符号分割的字符串数组 + * + * @param str + * 设置原字符串 + * @param delimiter + * 设置分割符号 + * @return String[] 返回字符串数组 + */ + public static String[] split(String str, String delimiter) + { + ArrayList array = new ArrayList(); + int index = 0; + int begin = 0; + String result[] = new String[0]; + if (isEmpty(str)) + return result; + do + { + index = str.indexOf(delimiter, begin); + if (index == begin) + { + if (index >= 0) + array.add(""); + begin += delimiter.length(); + continue; + } + if (index <= begin) + break; + int end = index; + array.add(str.substring(begin, end)); + begin = index + delimiter.length(); + } while (true); + if (begin >= 0 && begin < str.length()) + array.add(str.substring(begin)); + if (str.endsWith(delimiter)) + array.add(""); + if (array.size() > 0) + { + result = new String[array.size()]; + array.toArray(result); + } + return result; + } + + /** + * 获取指定符号分割的字符串数组,非空 + * + * @param str + * 设置原字符串 + * @param delimiter + * 设置分割符号 + * @return String[] 返回字符串数组 + */ + public static String[] splitWithoutEmpty(String str, String delimiter) + { + ArrayList array = new ArrayList(); + int index = 0; + int begin = 0; + String result[] = new String[0]; + if (isEmpty(str)) + return new String[0]; + do + { + index = str.indexOf(delimiter, begin); + if (index == begin) + { + if (index > 0) + array.add(""); + begin += delimiter.length(); + continue; + } + if (index <= begin) + break; + int end = index; + array.add(str.substring(begin, end)); + begin = index + delimiter.length(); + } while (true); + if (begin >= 0 && begin < str.length()) + array.add(str.substring(begin)); + if (array.size() > 0) + { + result = new String[array.size()]; + array.toArray(result); + } + return result; + } + + /** + * 将指定字符串内容反转 + * + * @param str + * 设置原字符串 + * @return String 返回字符串 + */ + public static String reverse(String str) + { + if (isEmpty(str)) + { + return str; + } + else + { + StringBuffer buffer = new StringBuffer(str); + buffer.reverse(); + return buffer.toString(); + } + } + + /** + * 给传入的字符串前后加双引号 + * + * @param str + * 设置原字符串 + * @return String 返回结果 + */ + public static String quote(String str) + { + if (isEmpty(str)) + return "\"\""; + StringBuffer buffer = new StringBuffer(str); + if (!str.startsWith("\"")) + buffer.insert(0, "\""); + if (!str.endsWith("\"")) + buffer.append("\""); + return buffer.toString(); + } + + /** + * 去除字符串中的双引号 + * + * @param str + * 设置原字符串 + * @return String 返回结果 + */ + public static String extractQuotedStr(String str) + { + if (isEmpty(str)) + return str; + StringBuffer buffer = new StringBuffer(str); + int index = str.length(); + while (buffer.charAt(buffer.length() - 1) == '"') + { + buffer.deleteCharAt(buffer.length() - 1); + index = buffer.length(); + if (index <= 0) + break; + } + if (buffer.length() == 0) + return ""; + while (buffer.charAt(0) == '"') + { + buffer.deleteCharAt(0); + index = buffer.length(); + if (index <= 0) + break; + } + return buffer.toString(); + } + + /** + * 截取字符串中到指定的字符的内容,从左边开始 + * + * @param str + * 设置原字符串 + * @param c + * 设置指定字符 + * @return String 返回结果 + */ + public static String strChar(String str, char c) + { + if (str == null || str.length() == 0) + return null; + for (int i = 0; i < str.length(); i++) + if (str.charAt(i) == c) + return str.substring(i); + + return null; + } + + /** + * 截取字符串中到指定的字符的内容,从右边开始 + * + * @param str + * 设置原字符串 + * @param c + * 设置指定字符 + * @return String 返回结果 + */ + public static String strRChar(String str, char c) + { + if (str == null || str.length() == 0) + return null; + for (int i = str.length() - 1; i >= 0; i--) + if (str.charAt(i) == c) + return str.substring(i); + + return null; + } + + /** + * 将Object对象数组转成字符串数组 + * + * @param array + * 设置Object对象数组 + * @return String[] 返回结果 + */ + public static String[] toArray(Object array[]) + { + if (array == null || array.length == 0) + return null; + String result[] = new String[array.length]; + for (int i = 0; i < array.length; i++) + if (array[i] != null) + result[i] = array[i].toString(); + + return result; + } + + /** + * 将Vector对象数组元素转成字符串数组 + * + * @param list + * 设置Vector对象数组 + * @return String[] 返回结果 + */ + public static String[] toArray(Vector list) + { + if (list == null || list.size() == 0) + return null; + String result[] = new String[list.size()]; + for (int i = 0; i < list.size(); i++) + { + Object obj = list.get(i); + if (obj != null) + result[i] = list.get(i).toString(); + } + + return result; + } + + /** + * 将字符串数组复制到LIST中 + * + * @param array + * 设置字符串数组 + * @param list + * 设置LIST集合对象 + * @param index + * 设置复制到LIST位置 + * @return List 返回结果 + */ + public static List copyToList(String array[], List list, int index) + { + if (array == null || array.length == 0) + return list; + if (list == null || index < 0) + return list; + for (int i = 0; i < array.length; i++) + if (list.size() <= i + index) + list.add(index + i, array[i]); + else + list.set(index + i, array[i]); + + return list; + } + + /** + * 判断字符串数组是否包含指定字符串 + * + * @param array + * 设置字符串数组 + * @param str + * 设置批量字符串 + * @return boolean 返回结果 + */ + public static boolean contains(Object array[], String str) + { + if (array == null || array.length == 0) + return false; + if (str == null) + return false; + for (int i = 0; i < array.length; i++) + { + Object obj = array[i]; + if (obj != null && str.equals(obj.toString())) + return true; + } + + return false; + } + + /** + * 获取字符串数组包含指定字符串的位置 + * + * @param array + * 设置字符串数组 + * @param str + * 设置批量字符串 + * @return int 返回结果 + */ + public static int indexOf(Object array[], String str) + { + if (array == null || array.length == 0) + return -1; + if (str == null) + return -1; + for (int i = 0; i < array.length; i++) + { + Object obj = array[i]; + if (obj != null && str.equals(obj.toString())) + return i; + } + + return -1; + } + + /** + * 验证是否为电子邮件格式 + * + * @param theEmail + * 设置电子邮件地址字符串 + * @return boolean 返回是否合法 + */ + public static boolean isValidEmail(String theEmail) + { + boolean cbool = false; + try + { + String check = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$"; + Pattern regex = Pattern.compile(check); + Matcher matcher = regex.matcher(theEmail); + boolean isMatched = matcher.matches(); + if (isMatched) + { + cbool = true; + } + + } + catch (Exception e) + { + e.printStackTrace(); + return cbool; + } + return cbool; + } + + /** + * 去除字符串左边空格 + * + * @param str + * 设置原字符串 + * @return String 返回结果 + */ + public static String trimLeft(String str) + { + if (str == null) + return null; + int length = str.length(); + if (length == 0) + return ""; + StringBuffer buffer = new StringBuffer(str); + int index; + for (index = 0; index < length && buffer.charAt(index) == ' '; index++) + ; + if (index == length) + return ""; + else + return buffer.substring(index); + } + + /** + * 去除字符串右边空格 + * + * @param str + * 设置原字符串 + * @return String 返回结果 + */ + public static String trimRight(String str) + { + if (str == null) + return null; + int length = str.length(); + if (length == 0) + return ""; + StringBuffer buffer = new StringBuffer(str); + int index; + for (index = length - 1; index >= 0 && buffer.charAt(index) == ' '; index--) + ; + if (index < 0 && buffer.charAt(0) == ' ') + return ""; + else + return buffer.substring(0, index + 1); + } + + /** + * 去除字符串两边空格 + * + * @param str + * 设置原字符串 + * @return String 返回结果 + */ + public static String trimAll(String str) + { + return str.trim(); + } + + /** + * 去除字符串NULL + * + * @param str + * 设置原字符串 + * @return String 如果为NULL返回空字符串,否则返回原字符串,去除null字符串 + */ + public static String removeNull(String str) + { + if(str == null){ + return ""; + } + return str.replace("null", ""); + } + + /** + * 去除对象NULL + * + * @param str + * 设置原字符串 + * @return String 如果为NULL返回空字符串,否则返回原字符串 + */ + public static String removeNull(Object str) + { + return str != null ? str.toString() : ""; + } + + /** + * 实现判断字符串是否在数组中存在 + * + * @param strs + * 设置字符串数组 + * @param str + * 设置要查找的字符串 + * @param caseSensitive + * 设置是否区分大小写 + * @return boolean 返回结果 + */ + public static boolean strInArray(String strs[], String str, boolean caseSensitive) + { + if (strs != null && strs.length > 0) + { + for (int i = 0; i < strs.length; i++) + { + if (caseSensitive) + { + if (strs[i].equals(str)) + return true; + } + else + { + if (strs[i].equalsIgnoreCase(str)) + return true; + } + } + } + + return false; + } + + /** + * 验证身份证的合法性 + * + * @param idcard + * 设置身份证字符串 + * @return boolean 返回结果 + */ + public static boolean idCardVerify(String idcard) + { + if (idcard.length() == 15) + { + idcard = idCardUptoeighteen(idcard); + } + if (idcard.length() != 18) + { + return false; + } + String verify = idcard.substring(17, 18); + if (verify.equals(getIdCardVerify(idcard))) + { + return true; + } + return false; + } + + /** + * 获得身份证的合法性 + * + * @param eightcardid + * 设置身份证字符串 + * @return String 返回结果 + */ + public static String getIdCardVerify(String eightcardid) + { + int remaining = 0; + if (eightcardid.length() == 18) + { + eightcardid = eightcardid.substring(0, 17); + } + if (eightcardid.length() == 17) + { + int sum = 0; + for (int i = 0; i < 17; i++) + { + String k = eightcardid.substring(i, i + 1); + ai[i] = Integer.parseInt(k); + } + for (int i = 0; i < 17; i++) + { + sum = sum + wi[i] * ai[i]; + } + remaining = sum % 11; + } + return remaining == 2 ? "X" : String.valueOf(vi[remaining]); + } + + /** + * 获得身份证15转18位 + * + * @param fifteencardid + * 设置身份证字符串 + * @return String 返回结果 + */ + public static String idCardUptoeighteen(String fifteencardid) + { + if (fifteencardid.length() != 15) + return null; + String eightcardid = fifteencardid.substring(0, 6); + eightcardid = eightcardid + "19"; + eightcardid = eightcardid + fifteencardid.substring(6, 15); + eightcardid = eightcardid + getIdCardVerify(eightcardid); + return eightcardid; + } + + /** + * 验证电话号码合法格式,格式为02584555112 + * + * @param phoneCode + * 设置电话号码字符串 + * @return boolean 返回结果 + */ + public static boolean isPhoneNum(String phoneCode) + { + Pattern p = Pattern.compile("[0][1-9]{2,3}[1-9]{6,8}"); + Matcher m = p.matcher(phoneCode); + boolean b = m.matches(); + return b; + } + + /** + * 验证手机号码合法格式,格式为13984555112 + * + * @param phoneCode + * 设置手机号码字符串 + * @return boolean 返回结果 + */ + public static boolean isMobilePhoneNum(String phoneCode) + { + Pattern p = Pattern.compile("^0{0,1}(13[0-9]|15[0-9]|18[0-9])[0-9]{8}"); + Matcher m = p.matcher(phoneCode); + boolean b = m.matches(); + return b; + } + + /** + * 字符数组转换为字符串,用逗号隔开 + * + * @param str + * @return String + */ + public static String arrayToString(final String[] str) + { + if (str == null) + return ""; + StringBuffer rStr = new StringBuffer(""); + for (int i = 0; i < str.length; i++) + { + rStr.append(str[i]); + rStr.append(","); + } + // 截取逗号 + if (rStr.toString().length() > 0) + { + rStr.setLength(rStr.length() - 1); + } + return rStr.toString(); + } + + /** + * 字符数组转换为字符串,用逗号隔开 + * + * @param str + * @param beginIndex + * @param length + * @return String + */ + public static String arrayToString(final String[] str, int beginIndex, int length) + { + if (str == null || beginIndex > str.length - 1) + return ""; + StringBuffer rStr = new StringBuffer(""); + + int condition = beginIndex + length - 1; + + if(condition > str.length - 1) + { + condition = str.length - 1; + } + rStr.append("'"); + for (int i = beginIndex; i < condition; i++) + { + rStr.append(str[i]).append("','"); + } + rStr.append(str[condition]).append("'"); + + return rStr.toString(); + } + + /** + * 字符数组转换为字符串,用逗号隔开 + * + * @param str + * @param beginIndex + * @param length + * @return String + */ + public static String arrayToIntegerString(final String[] str, int beginIndex, int length) + { + if (str == null || beginIndex > str.length - 1) + { + return ""; + } + + StringBuffer rStr = new StringBuffer(""); + + int condition = beginIndex + length - 1; + + if(condition > str.length - 1) + { + condition = str.length - 1; + } + + for (int i = beginIndex; i < condition; i++) + { + rStr.append(str[i]); + rStr.append(","); + } + rStr.append(str[condition]); + + return rStr.toString(); + } + /** + * 判定一个对象是否为null or empty + * + * @param o + * 对象 + * @return true or false + */ + public static boolean isNullOrEmpty(Object o) { + return o == null || String.valueOf(o).trim().length() == 0 + || "null".equals(String.valueOf(o).trim()); + } + + /** + * 根据分隔符将字符串分开,并加上"'"输出(12,23,234 to '12','23','234') + * + * @param s + * @param spiltter + * 分隔符 + * @return String + */ + public static String formatString(String s, String spiltter) + { + if (StringUtils.isEmpty(s)) + return ""; + StringBuffer result = new StringBuffer(); + String[] temp = s.split(spiltter); + for (String str : temp) + { + if (str.trim().length() > 0) + result.append(spiltter).append("'").append(str).append("'"); + } + + return result.length() > 0 ? result.substring(1) : result.toString(); + } + + /** + * 格式化字符串(12,23,234 to '12','23','234') + * + * @param s + * @return String + */ + public static String formatString(String s) + { + return formatString(s, ","); + } + + /** + * 生成messageID + * + * @return String + */ + public static String createMessageId() + { + Calendar calendar = Calendar.getInstance(); + return calendar.getTimeInMillis() + ""; + } + + /** + * 判断集合Collection是否为空 + * @param collection + * @return boolean + */ + public static boolean isNullOrEmpty(Collection collection) { + return collection == null || collection.size() == 0; + } + + /** + * 格式化Object + * @param o + * @return String + */ + public static String valueOf(Object o) { + return StringUtils.isNullOrEmpty(o) ? "" : o.toString(); + } + + /** + * valueOf + * @param o + * @param changevalue + * @return String + */ + public static String valueOf(Object o,String changevalue) + { + return StringUtils.isNullOrEmpty(o) ?changevalue:o.toString(); + } + + /** + * 判断一个字符串是否有值,空格也不算有值 + * @param str + * @return boolean + */ + public static boolean availableStr(String str){ + if(str!=null && !"".equals(str) && !"null".equals(str)){ + String avaStr = str.trim(); + return (avaStr!=null && !"".equals(avaStr) && !"null".equals(avaStr)); + }else{ + return false; + } + } + + /** + * 截取子字符串 + * @param str 需要截取的字符串 + * @param len 截取的位数 + * @return String 返回的子字符串 + */ + public static String getSubString(String str, int len) { + if (isEmpty(str)) { + return ""; + } + if (0 >= len) { + return str; + } + final int byteLength = getByteLength(str); + + if (byteLength < len) { + return str; + } + StringBuffer sb = new StringBuffer(str); + sb.setLength(len); + + while (getByteLength(sb.toString()) > len) { + sb.deleteCharAt(sb.length() - 1); + } + return sb.toString(); + } + + /** + * 得到字节长度 + * @param str 需要得到长度的字符串 + * @return 返回字节的长度 + */ + public static int getByteLength(String str) { + int len = 0; + if (isEmpty(str)) { + return len; + } + try { + len = str.getBytes("UTF-8").length; + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } + return len; + } + + /** + * 判断字符串是否为空 + * @param obj 字符串 + * @return true:空 false:非空 + */ + public static boolean isEmpty(Object obj) { + String str = obj + ""; + if (null == str || 0 == str.length()||"null".equals(str)||"".equals(str)) { + return true; + } + return false; + } + + /** + * 把字符串中的双引号和反斜杠替换为画面能够识别的字符串 + * @param inStr + * @return outStr + */ + public static String escapeSpecialChar(String inStr){ + if (null == inStr || "null".equals(inStr) || "".equals(inStr)) { + return ""; + } + String outStr = ""; + //替换双引号 + String srcStr1 = "\""; + String destStr1 = "\\\\\""; + //替换反斜杠 + String srcStr2 = "\\\\"; + String destStr2 = "\\\\\\\\"; + outStr = inStr.replaceAll(srcStr2, destStr2); + outStr = outStr.replaceAll(srcStr1, destStr1); + return outStr; + + } + + /** + * 将String中的xml格式的Excel的关键字转义 + * @param str + * @return String + */ + public static String encodeExcelXmlStr(String str){ + if(isEmpty(str)){ + return str; + } + return str.replaceAll("&", "&") + .replaceAll("<", "<") + .replaceAll(">", ">") + .replaceAll("\"",""" ) + .replaceAll("\r\n"," ") + .replaceAll("\n"," "); + } + + + /** + *判断输入字符串是否为整型数据 + * @param str 字符串 + * @return boolean + */ + public static boolean isInteger(String str) { + if(availableStr(str)) { + try { + Integer.parseInt(str); + return true; + }catch(NumberFormatException e) { + return false; + } + } + return false; + } + + /** + *判断输入字符串是否为长整型数据 + * @param str 字符串 + * @return boolean + */ + public static boolean isLong(String str) { + if(availableStr(str)) { + try { + Long.parseLong(str); + return true; + }catch(NumberFormatException e) { + return false; + } + } + return false; + } + + /** + *判断输入字符串是否为单精度浮点型数据 + * @param str 字符串 + * @return boolean + */ + public static boolean isFloat(String str) { + if(availableStr(str)) { + try { + Float.parseFloat(str); + return true; + }catch(NumberFormatException e) { + return false; + } + } + return false; + } + + + /** + * 判断字符是否为汉字(汉字标点不为汉字字符) + * @param oneChar + * @return boolean + */ + public static boolean isChineseWithoutPunctuation(char oneChar){ + if((oneChar >= INT0X4E00 && oneChar <= INT0X9FA5) + ||(oneChar >= INT0XF900 && oneChar <=INT0XFA2D)){ + return true; + } + return false; + } + + /** + * 判断字符是否为汉字(汉字标点为汉字字符) + * @param oneChar + * @return boolean + */ + public static boolean isChineseWithPunctuation(char oneChar) { + Character.UnicodeBlock ub = Character.UnicodeBlock.of(oneChar); + if (ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS + || ub == Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS + || ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A + || ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B + || ub == Character.UnicodeBlock.CJK_SYMBOLS_AND_PUNCTUATION + || ub == Character.UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS + || ub == Character.UnicodeBlock.GENERAL_PUNCTUATION) { + return true; + } + return false; + } + + + /** + * 把ip地址格式化为:000.000.000.000 + * @param ip + * @return 返回规格ip + */ + public static String strfullip(String ip){ + StringBuffer buff = new StringBuffer(); + buff.append(""); + String strzero = "000"; + int ilen = 0; + if(ip != null){ + String[] arrip = ip.split("\\."); + if(arrip.length == INT4){ + for(int i = 0; i < INT4; i++){ + if (i==0){ + ilen = arrip[i].length(); + if(ilen < INT3){ + buff.append(strzero.substring(0,INT3-ilen)).append(arrip[i]); + }else{ + buff.append(arrip[i]); + } + }else{ + ilen = arrip[i].length(); + if(ilen < INT3){ + buff.append(".").append(strzero.substring(0,INT3-ilen)).append(arrip[i]); + }else{ + buff.append(".").append(arrip[i]); + } + } + } + } + } + return buff.toString(); + } + + /** + * 根据传入的字符串和编码取得对应的编码的字符串,主要用于前后台参数传递场景,防止出现乱码 + * @param str + * @param charSet + * @return String + */ + public static String getStringByCharset(String str, String charSet){ + if (isEmpty(str)||isEmpty(charSet)) { + return null; + } + try { + return String.valueOf(str.getBytes(charSet)); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } + } + + /** + * 根据源字符串和编码取得字符串,并获取处理后的字符串长度 + * @param str + * @param charSet + * @return int + */ + public static int getStringByLength(String str, String charSet){ + str = getStringByCharset(str,charSet); + if(availableStr(str)){ + return str.length(); + }else{ + return 0; + } + } + + /** + * 将容易引起xss漏洞的半角字符直接替换成全角字符 + * @param s 原始字符串 + * @return 替换危险字符之后的字符串 + */ + public static String xssEncode(String s) { + if (s == null || "".equals(s)) { + return s; + } + StringBuilder sb = new StringBuilder(s.length() + INT16); + for (int i = 0; i < s.length(); i++) { + char c = s.charAt(i); + switch (c) { + case '>': + sb.append('>');// 全角大于号 + break; + case '<': + sb.append('<');// 全角小于号 + break; +// case '\'': +// sb.append('‘');// 全角单引号 +// break; +// case '\"': +// sb.append('“');// 全角双引号 +// break; +// case '&': +// sb.append('&');// 全角 +// break; +// case '%': +// sb.append('%');// 全角 +// break; + case '+': + sb.append("+");// 全角 + break; + case ';': + sb.append(";");// 全角 + break; + case '\\': + sb.append('\');// 全角斜线 + break; +// case '/': +// sb.append('/');// 全角斜线 +// break; + case '#': + sb.append('#');// 全角井号 + break; +// case ':': +// sb.append(':');// 全角冒号 +// break; + default: + sb.append(c); + break; + } + } + return sb.toString(); + } + + /** + * 判断是否有中文字符并转换为英文 + * @param s 入参 + * @return String 处理后的参数 + */ + public static String conversionCharacter(String s){ + final String REG_EX = "[ _`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。,、?]|\n|\r|\t"; + Pattern p = Pattern.compile(REG_EX); + Matcher m = p.matcher(s); + boolean b = m.find(); + if (b){ + s=toSemiangle(s) ; + } + return s.replaceAll("\\s*",""); + } + + /** + * 全角转半角 + * @param src + * @return String + */ + public static String toSemiangle(String src) { + char[] c = src.toCharArray(); + for (int index = 0; index < c.length; index++) { + // 全角空格 + if (c[index] == 12288) { + c[index] = (char) 32; + // 其他全角字符 + } else if (c[index] > 65280 && c[index] < 65375) { + c[index] = (char) (c[index] - 65248); + } + } + return String.valueOf(c).intern(); + } + /** + * 获取uuid + * @return string + * */ + public static String getUUid() + { + return UUID.randomUUID().toString().replaceAll("-",""); + } +} diff --git a/src/main/java/com/pms/ocp/controller/OcpDetailsController.java b/src/main/java/com/pms/ocp/controller/OcpDetailsController.java new file mode 100644 index 0000000000000000000000000000000000000000..903208dbfc8520239a0e1b9d121e68b0145f740f --- /dev/null +++ b/src/main/java/com/pms/ocp/controller/OcpDetailsController.java @@ -0,0 +1,96 @@ +package com.pms.ocp.controller; + + +import com.pms.ocp.model.entity.OcpApiAudit; +import com.pms.ocp.model.entity.OcpApiModelRel; +import com.pms.ocp.model.entity.OcpApiSubs; +import com.pms.ocp.model.entity.OcpApiTenantRel; +import com.pms.ocp.model.vo.ResponseVO; +import com.pms.ocp.service.OcpApiAuditService; +import com.pms.ocp.service.OcpApiModelRelService; +import com.pms.ocp.service.OcpApiSubsService; +import com.pms.ocp.service.OcpApiTenantRelService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +@Slf4j +@RequestMapping("/tenant") +@RestController +@Api(tags = "应用接口") +public class OcpDetailsController { + + @Autowired + private OcpApiSubsService ocpApiSubsService; + + @Autowired + private OcpApiAuditService ocpApiAuditService; + + @Autowired + private OcpApiTenantRelService ocpApiTenantRelService; + + @Autowired + private OcpApiModelRelService ocpApiModelRelService; + + + @ApiOperation("服务订阅记录-查询") + @PostMapping("/getocpapisublist") + public ResponseVO getOcpApiSubsList(OcpApiSubs ocpApiSubs) { + return ocpApiSubsService.getOcpApiSubsList(ocpApiSubs); + } + + @ApiOperation("服务大事记-查询") + @PostMapping("/getocpapiauditlist") + public ResponseVO getOcpApiAuditList(OcpApiAudit ocpApiAudit) { + return ocpApiAuditService.getOcpApiAuditList(ocpApiAudit); + } + + @ApiOperation("服务大事记-查询详情") + @PostMapping("/getocpapidetails") + public ResponseVO getOcpApiDetails(OcpApiAudit ocpApiAudit){ + return ocpApiAuditService.sById(ocpApiAudit); + } + + @ApiOperation("服务大事记-查询详情") + @PostMapping("/getocpapi") + public ResponseVO getOcpApi(OcpApiAudit ocpApiAudit){ + return ocpApiAuditService.OaaById(ocpApiAudit); + } + + @ApiOperation("服务与应用拓扑图-查询") + @PostMapping("/getoatrlist") + public ResponseVO getOatrList(OcpApiTenantRel ocpApiTenantRel) { + return ocpApiTenantRelService.getOatrList(ocpApiTenantRel); + } + + @ApiOperation("服务与模型拓扑图-查询") + @PostMapping("/getoamrlist") + public ResponseVO getOamrList(OcpApiModelRel ocpApiModelRel) { + return ocpApiModelRelService.getOamrList(ocpApiModelRel); + } + + @ApiOperation("服务与模型拓扑图-关联查询详情") + @PostMapping("/getoaabyid") + public ResponseVO OaaById(OcpApiAudit ocpApiAudit) { + return ocpApiAuditService.OaaById(ocpApiAudit); + } + +// @ApiOperation("服务大事记-导出") +// @RequestMapping("/export") +// public void exportExcel(OcpApiAudit ocpApiAudit, HttpServletRequest request, HttpServletResponse response) { +// ocpApiAuditService.exportExcel(ocpApiAudit,request,response); +// } + +// @ApiOperation("服务大事记-导出") +// @RequestMapping("/export") +// public void exportExcel(Oaa oaa, HttpServletRequest request, HttpServletResponse response) { +// oaaService.exportExcel(oaa, request, response); +// } +} diff --git a/src/main/java/com/pms/ocp/mapper/OcpApiAuditMapper.java b/src/main/java/com/pms/ocp/mapper/OcpApiAuditMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..34ace9a9218d7119a766d17e7d91142220dd43a8 --- /dev/null +++ b/src/main/java/com/pms/ocp/mapper/OcpApiAuditMapper.java @@ -0,0 +1,23 @@ +package com.pms.ocp.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.pms.ocp.model.entity.OcpApiAudit; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * @Auther: liukai + * @Date: 2022/3/7 + * @Description:服务大事记接口 + */ +@Mapper +public interface OcpApiAuditMapper extends BaseMapper { + + List OaaById(OcpApiAudit ocpApiAudit); + + List getOcpApiSubsList(OcpApiAudit ocpApiAudit); + + List sById(OcpApiAudit ocpApiAudit); + +} diff --git a/src/main/java/com/pms/ocp/mapper/OcpApiModelRelMapper.java b/src/main/java/com/pms/ocp/mapper/OcpApiModelRelMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..87dbd0476eaa5cd014d3c64e049e98df234fa104 --- /dev/null +++ b/src/main/java/com/pms/ocp/mapper/OcpApiModelRelMapper.java @@ -0,0 +1,14 @@ +package com.pms.ocp.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.pms.ocp.model.entity.OcpApiModelRel; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface OcpApiModelRelMapper extends BaseMapper { + List getOamrList(OcpApiModelRel ocpApiModelRel); + + +} diff --git a/src/main/java/com/pms/ocp/mapper/OcpApiSubsMapper.java b/src/main/java/com/pms/ocp/mapper/OcpApiSubsMapper.java index 2eaf28e41fe3972e1d96fe8358b44159a2e99f8c..11a06cac9ef0c5e1af64984e5cb920c6a2f39b19 100644 --- a/src/main/java/com/pms/ocp/mapper/OcpApiSubsMapper.java +++ b/src/main/java/com/pms/ocp/mapper/OcpApiSubsMapper.java @@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.pms.ocp.model.entity.OcpApiSubs; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + @Mapper public interface OcpApiSubsMapper extends BaseMapper { + List getOcpApisList(OcpApiSubs ocpApiSubs); } diff --git a/src/main/java/com/pms/ocp/mapper/OcpApiTenantRelMapper.java b/src/main/java/com/pms/ocp/mapper/OcpApiTenantRelMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..6e4e47a38727df7f85795d84a32f12a5fb7b516b --- /dev/null +++ b/src/main/java/com/pms/ocp/mapper/OcpApiTenantRelMapper.java @@ -0,0 +1,13 @@ +package com.pms.ocp.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.pms.ocp.model.entity.OcpApiTenantRel; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface OcpApiTenantRelMapper extends BaseMapper { + + List getOatrList(OcpApiTenantRel ocpApiTenantRel); +} diff --git a/src/main/java/com/pms/ocp/model/entity/OcpApiAudit.java b/src/main/java/com/pms/ocp/model/entity/OcpApiAudit.java index 26c169bcc8b224b427f091cd1963ece6b040fe80..e5e4a20270aecec0a641143f2153be8cd5933696 100644 --- a/src/main/java/com/pms/ocp/model/entity/OcpApiAudit.java +++ b/src/main/java/com/pms/ocp/model/entity/OcpApiAudit.java @@ -1,5 +1,6 @@ package com.pms.ocp.model.entity; +import cn.afterturn.easypoi.excel.annotation.Excel; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; @@ -16,60 +17,103 @@ public class OcpApiAudit { @TableId(type = IdType.ASSIGN_ID) @ApiModelProperty("主键ID") + @Excel(name = "主键ID",orderNum = "1") private String objId; @ApiModelProperty("服务编码") + @Excel(name = "服务编码",orderNum = "2") private String apiCode; @ApiModelProperty("操作状态0:新增,1:迭代;2,下线") + @Excel(name = "操作状态",orderNum = "3") private long operStatus; @ApiModelProperty("操作对象0:服务,1:入参,2:出参") + @Excel(name = "操作对象",orderNum = "4") private long operTarget; @ApiModelProperty("类型0:人工操作,1:流程管控,3:总部下发") + @Excel(name = "操作对象",orderNum = "4") private long auditType; @ApiModelProperty("备注简述") + @Excel(name = "备注简述",orderNum = "5") private String auditMessage; @ApiModelProperty("事记内容") + @Excel(name = "事记内容",orderNum = "6") private String auditJson; @ApiModelProperty("提交人id") + @Excel(name = "提交人id",orderNum = "7") private String auditUserId; @ApiModelProperty("提交人姓名") + @Excel(name = "提交人姓名",orderNum = "8") private String auditUserName; @ApiModelProperty("创建时间") + @Excel(name = "创建时间",orderNum = "9") private Timestamp auditCtime; @ApiModelProperty("修改时间") + @Excel(name = "修改时间",orderNum = "10") private Timestamp auditMtime; @ApiModelProperty("是否删除0-否1-是") + @Excel(name = "是否删除",orderNum = "11") private long isDelete; @ApiModelProperty("当前版本") + @Excel(name = "当前版本",orderNum = "12") private long applyVersion; @ApiModelProperty("上一版本") - private long preApplyVersion; + @Excel(name = "上一版本",orderNum = "13") + private long preApiVersion; - public long getApplyVersion() { - return applyVersion; - } + @ApiModelProperty("服务接口中文名称") + private String apiName; - public void setApplyVersion(long applyVersion) { - this.applyVersion = applyVersion; - } + @ApiModelProperty("服务分类代码") + private String apiGroupCode; - public long getPreApplyVersion() { - return preApplyVersion; - } + @ApiModelProperty("推广类型0:统建;1:自建") + private long apiPromotion; - public void setPreApplyVersion(long preApplyVersion) { - this.preApplyVersion = preApplyVersion; - } + @ApiModelProperty("服务请求体") + private String apiReq; + + @ApiModelProperty("服务返回体") + private String apiResp; + + @ApiModelProperty("服务地址") + private String apiUrl; + + @ApiModelProperty("服务创建时间") + private Timestamp apiCtime; + + @ApiModelProperty("服务修改时间") + private Timestamp apiMtime; + + @ApiModelProperty("创建者用户ID") + private String apiUserId; + + @ApiModelProperty("建设单位") + private String apiUnit; + + @ApiModelProperty("服务所属公司") + private String ownerCompanyCode; + + @ApiModelProperty("服务所属公司") + private String ownerCompanyName; + + @ApiModelProperty("所属区域 1:生产控制大区;2:信息关联大区;3:互联网大区") + private long apiZone; + + @ApiModelProperty("'所属层级 1:应用层;2:平台层;3:网络层;4:感知层;") + private long apiLayer; + + @ApiModelProperty("服务版本(最新版本)") + private long apiVersion; public String getObjId() { return objId; @@ -79,7 +123,6 @@ public class OcpApiAudit { this.objId = objId; } - public String getApiCode() { return apiCode; } @@ -88,7 +131,6 @@ public class OcpApiAudit { this.apiCode = apiCode; } - public long getOperStatus() { return operStatus; } @@ -97,7 +139,6 @@ public class OcpApiAudit { this.operStatus = operStatus; } - public long getOperTarget() { return operTarget; } @@ -106,7 +147,6 @@ public class OcpApiAudit { this.operTarget = operTarget; } - public long getAuditType() { return auditType; } @@ -115,7 +155,6 @@ public class OcpApiAudit { this.auditType = auditType; } - public String getAuditMessage() { return auditMessage; } @@ -124,7 +163,6 @@ public class OcpApiAudit { this.auditMessage = auditMessage; } - public String getAuditJson() { return auditJson; } @@ -133,7 +171,6 @@ public class OcpApiAudit { this.auditJson = auditJson; } - public String getAuditUserId() { return auditUserId; } @@ -142,7 +179,6 @@ public class OcpApiAudit { this.auditUserId = auditUserId; } - public String getAuditUserName() { return auditUserName; } @@ -151,7 +187,6 @@ public class OcpApiAudit { this.auditUserName = auditUserName; } - public Timestamp getAuditCtime() { return auditCtime; } @@ -160,7 +195,6 @@ public class OcpApiAudit { this.auditCtime = auditCtime; } - public Timestamp getAuditMtime() { return auditMtime; } @@ -169,7 +203,6 @@ public class OcpApiAudit { this.auditMtime = auditMtime; } - public long getIsDelete() { return isDelete; } @@ -178,4 +211,139 @@ public class OcpApiAudit { this.isDelete = isDelete; } + public long getApplyVersion() { + return applyVersion; + } + + public void setApplyVersion(long applyVersion) { + this.applyVersion = applyVersion; + } + + public long getPreApiVersion() { + return preApiVersion; + } + + public void setPreApiVersion(long preApiVersion) { + this.preApiVersion = preApiVersion; + } + + public String getApiName() { + return apiName; + } + + public void setApiName(String apiName) { + this.apiName = apiName; + } + + public String getApiGroupCode() { + return apiGroupCode; + } + + public void setApiGroupCode(String apiGroupCode) { + this.apiGroupCode = apiGroupCode; + } + + public long getApiPromotion() { + return apiPromotion; + } + + public void setApiPromotion(long apiPromotion) { + this.apiPromotion = apiPromotion; + } + + public String getApiReq() { + return apiReq; + } + + public void setApiReq(String apiReq) { + this.apiReq = apiReq; + } + + public String getApiResp() { + return apiResp; + } + + public void setApiResp(String apiResp) { + this.apiResp = apiResp; + } + + public String getApiUrl() { + return apiUrl; + } + + public void setApiUrl(String apiUrl) { + this.apiUrl = apiUrl; + } + + public Timestamp getApiCtime() { + return apiCtime; + } + + public void setApiCtime(Timestamp apiCtime) { + this.apiCtime = apiCtime; + } + + public Timestamp getApiMtime() { + return apiMtime; + } + + public void setApiMtime(Timestamp apiMtime) { + this.apiMtime = apiMtime; + } + + public String getApiUserId() { + return apiUserId; + } + + public void setApiUserId(String apiUserId) { + this.apiUserId = apiUserId; + } + + public String getApiUnit() { + return apiUnit; + } + + public void setApiUnit(String apiUnit) { + this.apiUnit = apiUnit; + } + + public String getOwnerCompanyCode() { + return ownerCompanyCode; + } + + public void setOwnerCompanyCode(String ownerCompanyCode) { + this.ownerCompanyCode = ownerCompanyCode; + } + + public String getOwnerCompanyName() { + return ownerCompanyName; + } + + public void setOwnerCompanyName(String ownerCompanyName) { + this.ownerCompanyName = ownerCompanyName; + } + + public long getApiZone() { + return apiZone; + } + + public void setApiZone(long apiZone) { + this.apiZone = apiZone; + } + + public long getApiLayer() { + return apiLayer; + } + + public void setApiLayer(long apiLayer) { + this.apiLayer = apiLayer; + } + + public long getApiVersion() { + return apiVersion; + } + + public void setApiVersion(long apiVersion) { + this.apiVersion = apiVersion; + } } diff --git a/src/main/java/com/pms/ocp/model/entity/OcpApiModelRel.java b/src/main/java/com/pms/ocp/model/entity/OcpApiModelRel.java index 03a429134818234f678c08a9e50dcecbfb348a2d..ae99dee5653d69fa6a59b460999ef94fb729770c 100644 --- a/src/main/java/com/pms/ocp/model/entity/OcpApiModelRel.java +++ b/src/main/java/com/pms/ocp/model/entity/OcpApiModelRel.java @@ -37,6 +37,105 @@ public class OcpApiModelRel { @ApiModelProperty("是否已删除 0-否1-是") private long isDelete; + @ApiModelProperty("服务接口中文名称") + private String apiName; + + @ApiModelProperty("服务分类代码") + private String apiGroupCode; + + @ApiModelProperty("推广类型0:统建;1:自建") + private long apiPromotion; + + @ApiModelProperty("服务请求体") + private String apiReq; + + @ApiModelProperty("服务返回体") + private String apiResp; + + @ApiModelProperty("服务地址") + private String apiUrl; + + @ApiModelProperty("服务创建时间") + private Timestamp apiCtime; + + @ApiModelProperty("服务修改时间") + private Timestamp apiMtime; + + @ApiModelProperty("创建者用户ID") + private String apiUserId; + + @ApiModelProperty("建设单位") + private String apiUnit; + + @ApiModelProperty("服务所属公司") + private String ownerCompanyCode; + + @ApiModelProperty("服务所属公司") + private String ownerCompanyName; + + @ApiModelProperty("所属区域 1:生产控制大区;2:信息关联大区;3:互联网大区") + private long apiZone; + + @ApiModelProperty("'所属层级 1:应用层;2:平台层;3:网络层;4:感知层;") + private long apiLayer; + + @ApiModelProperty("服务版本(最新版本)") + private long apiVersion; + + @ApiModelProperty("应用编码") + private String tenantCode; + + @ApiModelProperty("应用名称") + private String tenantName; + + @ApiModelProperty("应用分类代码") + private String tenantGroupCode; + + @ApiModelProperty("应用IP") + private String tenantIp; + + @ApiModelProperty("应用url") + private String tenantUrl; + + @ApiModelProperty("所属专业") + private String professionalKind; + + @ApiModelProperty("创建者用户ID") + private String tenantUserId; + + @ApiModelProperty("排序") + private String tenantOrderNo; + + @ApiModelProperty("创建时间") + private String tenantCtime; + + @ApiModelProperty("最后更新时间") + private String tenantMtime; + + @ApiModelProperty("部署名称") + private String deploymentName; + + @ApiModelProperty("描述") + private String tenantDescription; + + @ApiModelProperty("应用状态0设计 1运行态") + private String tenantState; + + + @ApiModelProperty("建设单位") + private String tenantUnit; + + @ApiModelProperty("所属区域 1:生产控制大区;2:信息关联大区;3:互联网大区") + private String tenantZone; + + @ApiModelProperty("所属层级 1:应用层;2:平台层;3:网络层;4:感知层") + private String tenantLayer; + + @ApiModelProperty("应用版本(当前版本)") + private String tenantVersion; + + @ApiModelProperty("应用版本(当前版本)") + private String tenanttVersion; public String getObjId() { return objId; @@ -46,7 +145,6 @@ public class OcpApiModelRel { this.objId = objId; } - public String getModelCode() { return modelCode; } @@ -55,7 +153,6 @@ public class OcpApiModelRel { this.modelCode = modelCode; } - public String getModelDepCompanyCode() { return modelDepCompanyCode; } @@ -64,7 +161,6 @@ public class OcpApiModelRel { this.modelDepCompanyCode = modelDepCompanyCode; } - public String getApiCode() { return apiCode; } @@ -73,7 +169,6 @@ public class OcpApiModelRel { this.apiCode = apiCode; } - public String getApiDepCompanyCode() { return apiDepCompanyCode; } @@ -82,7 +177,6 @@ public class OcpApiModelRel { this.apiDepCompanyCode = apiDepCompanyCode; } - public Timestamp getRelationCtime() { return relationCtime; } @@ -91,7 +185,6 @@ public class OcpApiModelRel { this.relationCtime = relationCtime; } - public long getIsDelete() { return isDelete; } @@ -100,4 +193,267 @@ public class OcpApiModelRel { this.isDelete = isDelete; } + public String getApiName() { + return apiName; + } + + public void setApiName(String apiName) { + this.apiName = apiName; + } + + public String getApiGroupCode() { + return apiGroupCode; + } + + public void setApiGroupCode(String apiGroupCode) { + this.apiGroupCode = apiGroupCode; + } + + public long getApiPromotion() { + return apiPromotion; + } + + public void setApiPromotion(long apiPromotion) { + this.apiPromotion = apiPromotion; + } + + public String getApiReq() { + return apiReq; + } + + public void setApiReq(String apiReq) { + this.apiReq = apiReq; + } + + public String getApiResp() { + return apiResp; + } + + public void setApiResp(String apiResp) { + this.apiResp = apiResp; + } + + public String getApiUrl() { + return apiUrl; + } + + public void setApiUrl(String apiUrl) { + this.apiUrl = apiUrl; + } + + public Timestamp getApiCtime() { + return apiCtime; + } + + public void setApiCtime(Timestamp apiCtime) { + this.apiCtime = apiCtime; + } + + public Timestamp getApiMtime() { + return apiMtime; + } + + public void setApiMtime(Timestamp apiMtime) { + this.apiMtime = apiMtime; + } + + public String getApiUserId() { + return apiUserId; + } + + public void setApiUserId(String apiUserId) { + this.apiUserId = apiUserId; + } + + public String getApiUnit() { + return apiUnit; + } + + public void setApiUnit(String apiUnit) { + this.apiUnit = apiUnit; + } + + public String getOwnerCompanyCode() { + return ownerCompanyCode; + } + + public void setOwnerCompanyCode(String ownerCompanyCode) { + this.ownerCompanyCode = ownerCompanyCode; + } + + public String getOwnerCompanyName() { + return ownerCompanyName; + } + + public void setOwnerCompanyName(String ownerCompanyName) { + this.ownerCompanyName = ownerCompanyName; + } + + public long getApiZone() { + return apiZone; + } + + public void setApiZone(long apiZone) { + this.apiZone = apiZone; + } + + public long getApiLayer() { + return apiLayer; + } + + public void setApiLayer(long apiLayer) { + this.apiLayer = apiLayer; + } + + public long getApiVersion() { + return apiVersion; + } + + public void setApiVersion(long apiVersion) { + this.apiVersion = apiVersion; + } + + public String getTenantCode() { + return tenantCode; + } + + public void setTenantCode(String tenantCode) { + this.tenantCode = tenantCode; + } + + public String getTenantName() { + return tenantName; + } + + public void setTenantName(String tenantName) { + this.tenantName = tenantName; + } + + public String getTenantGroupCode() { + return tenantGroupCode; + } + + public void setTenantGroupCode(String tenantGroupCode) { + this.tenantGroupCode = tenantGroupCode; + } + + public String getTenantIp() { + return tenantIp; + } + + public void setTenantIp(String tenantIp) { + this.tenantIp = tenantIp; + } + + public String getTenantUrl() { + return tenantUrl; + } + + public void setTenantUrl(String tenantUrl) { + this.tenantUrl = tenantUrl; + } + + public String getProfessionalKind() { + return professionalKind; + } + + public void setProfessionalKind(String professionalKind) { + this.professionalKind = professionalKind; + } + + public String getTenantUserId() { + return tenantUserId; + } + + public void setTenantUserId(String tenantUserId) { + this.tenantUserId = tenantUserId; + } + + public String getTenantOrderNo() { + return tenantOrderNo; + } + + public void setTenantOrderNo(String tenantOrderNo) { + this.tenantOrderNo = tenantOrderNo; + } + + public String getTenantCtime() { + return tenantCtime; + } + + public void setTenantCtime(String tenantCtime) { + this.tenantCtime = tenantCtime; + } + + public String getTenantMtime() { + return tenantMtime; + } + + public void setTenantMtime(String tenantMtime) { + this.tenantMtime = tenantMtime; + } + + public String getDeploymentName() { + return deploymentName; + } + + public void setDeploymentName(String deploymentName) { + this.deploymentName = deploymentName; + } + + public String getTenantDescription() { + return tenantDescription; + } + + public void setTenantDescription(String tenantDescription) { + this.tenantDescription = tenantDescription; + } + + public String getTenantState() { + return tenantState; + } + + public void setTenantState(String tenantState) { + this.tenantState = tenantState; + } + + public String getTenantUnit() { + return tenantUnit; + } + + public void setTenantUnit(String tenantUnit) { + this.tenantUnit = tenantUnit; + } + + public String getTenantZone() { + return tenantZone; + } + + public void setTenantZone(String tenantZone) { + this.tenantZone = tenantZone; + } + + public String getTenantLayer() { + return tenantLayer; + } + + public void setTenantLayer(String tenantLayer) { + this.tenantLayer = tenantLayer; + } + + public String getTenantVersion() { + return tenantVersion; + } + + public void setTenantVersion(String tenantVersion) { + this.tenantVersion = tenantVersion; + } + + public String getTenanttVersion() { + return tenanttVersion; + } + + public void setTenanttVersion(String tenanttVersion) { + this.tenanttVersion = tenanttVersion; + } } diff --git a/src/main/java/com/pms/ocp/model/entity/OcpApiTenantRel.java b/src/main/java/com/pms/ocp/model/entity/OcpApiTenantRel.java index b1b5ddaaa44d76ef22905026396842a544dbe60e..072478dd110a0c1d74be47f4f395f18629522bb1 100644 --- a/src/main/java/com/pms/ocp/model/entity/OcpApiTenantRel.java +++ b/src/main/java/com/pms/ocp/model/entity/OcpApiTenantRel.java @@ -46,6 +46,98 @@ public class OcpApiTenantRel { @ApiModelProperty("是否已删除0未删除,1已删除") private long isDelete; + @ApiModelProperty("服务接口中文名称") + private String apiName; + + @ApiModelProperty("服务分类代码") + private String apiGroupCode; + + @ApiModelProperty("推广类型0:统建;1:自建") + private long apiPromotion; + + @ApiModelProperty("服务请求体") + private String apiReq; + + @ApiModelProperty("服务返回体") + private String apiResp; + + @ApiModelProperty("服务地址") + private String apiUrl; + + @ApiModelProperty("服务创建时间") + private Timestamp apiCtime; + + @ApiModelProperty("服务修改时间") + private Timestamp apiMtime; + + @ApiModelProperty("创建者用户ID") + private String apiUserId; + + @ApiModelProperty("建设单位") + private String apiUnit; + + @ApiModelProperty("服务所属公司") + private String ownerCompanyCode; + + @ApiModelProperty("服务所属公司") + private String ownerCompanyName; + + @ApiModelProperty("所属区域 1:生产控制大区;2:信息关联大区;3:互联网大区") + private long apiZone; + + @ApiModelProperty("'所属层级 1:应用层;2:平台层;3:网络层;4:感知层;") + private long apiLayer; + + @ApiModelProperty("服务版本(最新版本)") + private long apiVersion; + + @ApiModelProperty("应用名称") + private String tenantName; + + @ApiModelProperty("应用分类代码") + private String tenantGroupCode; + + @ApiModelProperty("应用IP") + private String tenantIp; + + @ApiModelProperty("应用url") + private String tenantUrl; + + @ApiModelProperty("所属专业") + private String professionalKind; + + @ApiModelProperty("创建者用户ID") + private String tenantUserId; + + @ApiModelProperty("排序") + private String tenantOrderNo; + + @ApiModelProperty("创建时间") + private String tenantCtime; + + @ApiModelProperty("最后更新时间") + private String tenantMtime; + + @ApiModelProperty("部署名称") + private String deploymentName; + + @ApiModelProperty("描述") + private String tenantDescription; + + @ApiModelProperty("应用状态0设计 1运行态") + private String tenantState; + + @ApiModelProperty("建设单位") + private String tenantUnit; + + @ApiModelProperty("所属区域 1:生产控制大区;2:信息关联大区;3:互联网大区") + private String tenantZone; + + @ApiModelProperty("所属层级 1:应用层;2:平台层;3:网络层;4:感知层") + private String tenantLayer; + + @ApiModelProperty("应用版本(当前版本)") + private String tenantVersion; public String getObjId() { return objId; @@ -55,7 +147,6 @@ public class OcpApiTenantRel { this.objId = objId; } - public String getTenantCode() { return tenantCode; } @@ -64,7 +155,6 @@ public class OcpApiTenantRel { this.tenantCode = tenantCode; } - public String getApiCode() { return apiCode; } @@ -73,7 +163,6 @@ public class OcpApiTenantRel { this.apiCode = apiCode; } - public String getApiDepCompanyCode() { return apiDepCompanyCode; } @@ -82,7 +171,6 @@ public class OcpApiTenantRel { this.apiDepCompanyCode = apiDepCompanyCode; } - public String getTenantDepCompanyCode() { return tenantDepCompanyCode; } @@ -91,7 +179,6 @@ public class OcpApiTenantRel { this.tenantDepCompanyCode = tenantDepCompanyCode; } - public Timestamp getApiTenantRelCtime() { return apiTenantRelCtime; } @@ -100,7 +187,6 @@ public class OcpApiTenantRel { this.apiTenantRelCtime = apiTenantRelCtime; } - public Timestamp getApiTenantRelMtime() { return apiTenantRelMtime; } @@ -109,7 +195,6 @@ public class OcpApiTenantRel { this.apiTenantRelMtime = apiTenantRelMtime; } - public String getApiTenantRelUserId() { return apiTenantRelUserId; } @@ -118,7 +203,6 @@ public class OcpApiTenantRel { this.apiTenantRelUserId = apiTenantRelUserId; } - public String getApiTenantRelUserName() { return apiTenantRelUserName; } @@ -127,7 +211,6 @@ public class OcpApiTenantRel { this.apiTenantRelUserName = apiTenantRelUserName; } - public long getIsDelete() { return isDelete; } @@ -136,4 +219,251 @@ public class OcpApiTenantRel { this.isDelete = isDelete; } + public String getApiName() { + return apiName; + } + + public void setApiName(String apiName) { + this.apiName = apiName; + } + + public String getApiGroupCode() { + return apiGroupCode; + } + + public void setApiGroupCode(String apiGroupCode) { + this.apiGroupCode = apiGroupCode; + } + + public long getApiPromotion() { + return apiPromotion; + } + + public void setApiPromotion(long apiPromotion) { + this.apiPromotion = apiPromotion; + } + + public String getApiReq() { + return apiReq; + } + + public void setApiReq(String apiReq) { + this.apiReq = apiReq; + } + + public String getApiResp() { + return apiResp; + } + + public void setApiResp(String apiResp) { + this.apiResp = apiResp; + } + + public String getApiUrl() { + return apiUrl; + } + + public void setApiUrl(String apiUrl) { + this.apiUrl = apiUrl; + } + + public Timestamp getApiCtime() { + return apiCtime; + } + + public void setApiCtime(Timestamp apiCtime) { + this.apiCtime = apiCtime; + } + + public Timestamp getApiMtime() { + return apiMtime; + } + + public void setApiMtime(Timestamp apiMtime) { + this.apiMtime = apiMtime; + } + + public String getApiUserId() { + return apiUserId; + } + + public void setApiUserId(String apiUserId) { + this.apiUserId = apiUserId; + } + + public String getApiUnit() { + return apiUnit; + } + + public void setApiUnit(String apiUnit) { + this.apiUnit = apiUnit; + } + + public String getOwnerCompanyCode() { + return ownerCompanyCode; + } + + public void setOwnerCompanyCode(String ownerCompanyCode) { + this.ownerCompanyCode = ownerCompanyCode; + } + + public String getOwnerCompanyName() { + return ownerCompanyName; + } + + public void setOwnerCompanyName(String ownerCompanyName) { + this.ownerCompanyName = ownerCompanyName; + } + + public long getApiZone() { + return apiZone; + } + + public void setApiZone(long apiZone) { + this.apiZone = apiZone; + } + + public long getApiLayer() { + return apiLayer; + } + + public void setApiLayer(long apiLayer) { + this.apiLayer = apiLayer; + } + + public long getApiVersion() { + return apiVersion; + } + + public void setApiVersion(long apiVersion) { + this.apiVersion = apiVersion; + } + + public String getTenantName() { + return tenantName; + } + + public void setTenantName(String tenantName) { + this.tenantName = tenantName; + } + + public String getTenantGroupCode() { + return tenantGroupCode; + } + + public void setTenantGroupCode(String tenantGroupCode) { + this.tenantGroupCode = tenantGroupCode; + } + + public String getTenantIp() { + return tenantIp; + } + + public void setTenantIp(String tenantIp) { + this.tenantIp = tenantIp; + } + + public String getTenantUrl() { + return tenantUrl; + } + + public void setTenantUrl(String tenantUrl) { + this.tenantUrl = tenantUrl; + } + + public String getProfessionalKind() { + return professionalKind; + } + + public void setProfessionalKind(String professionalKind) { + this.professionalKind = professionalKind; + } + + public String getTenantUserId() { + return tenantUserId; + } + + public void setTenantUserId(String tenantUserId) { + this.tenantUserId = tenantUserId; + } + + public String getTenantOrderNo() { + return tenantOrderNo; + } + + public void setTenantOrderNo(String tenantOrderNo) { + this.tenantOrderNo = tenantOrderNo; + } + + public String getTenantCtime() { + return tenantCtime; + } + + public void setTenantCtime(String tenantCtime) { + this.tenantCtime = tenantCtime; + } + + public String getTenantMtime() { + return tenantMtime; + } + + public void setTenantMtime(String tenantMtime) { + this.tenantMtime = tenantMtime; + } + + public String getDeploymentName() { + return deploymentName; + } + + public void setDeploymentName(String deploymentName) { + this.deploymentName = deploymentName; + } + + public String getTenantDescription() { + return tenantDescription; + } + + public void setTenantDescription(String tenantDescription) { + this.tenantDescription = tenantDescription; + } + + public String getTenantState() { + return tenantState; + } + + public void setTenantState(String tenantState) { + this.tenantState = tenantState; + } + + public String getTenantUnit() { + return tenantUnit; + } + + public void setTenantUnit(String tenantUnit) { + this.tenantUnit = tenantUnit; + } + + public String getTenantZone() { + return tenantZone; + } + + public void setTenantZone(String tenantZone) { + this.tenantZone = tenantZone; + } + + public String getTenantLayer() { + return tenantLayer; + } + + public void setTenantLayer(String tenantLayer) { + this.tenantLayer = tenantLayer; + } + + public String getTenantVersion() { + return tenantVersion; + } + + public void setTenantVersion(String tenantVersion) { + this.tenantVersion = tenantVersion; + } } diff --git a/src/main/java/com/pms/ocp/service/OcpApiAuditService.java b/src/main/java/com/pms/ocp/service/OcpApiAuditService.java new file mode 100644 index 0000000000000000000000000000000000000000..4ac0596fba9961abdea66a992eed060f2a1159a3 --- /dev/null +++ b/src/main/java/com/pms/ocp/service/OcpApiAuditService.java @@ -0,0 +1,19 @@ +package com.pms.ocp.service; + +import com.pms.ocp.model.entity.OcpApiAudit; +import com.pms.ocp.model.vo.ResponseVO; + + +public interface OcpApiAuditService { + ResponseVO getOcpApiAuditList(OcpApiAudit ocpApiAudit); + + ResponseVO getOcpApiDetails(String objId); + +// ResponseVO getOcpApiList(Oaa oaa); + + ResponseVO OaaById(OcpApiAudit ocpApiAudit); + + ResponseVO sById(OcpApiAudit ocpApiAudit); + +// void exportExcel(Oaa oaa, HttpServletRequest request, HttpServletResponse response); +} diff --git a/src/main/java/com/pms/ocp/service/OcpApiModelRelService.java b/src/main/java/com/pms/ocp/service/OcpApiModelRelService.java new file mode 100644 index 0000000000000000000000000000000000000000..f79330a0de5e23a978b50aaf68ab86c08d78b482 --- /dev/null +++ b/src/main/java/com/pms/ocp/service/OcpApiModelRelService.java @@ -0,0 +1,9 @@ +package com.pms.ocp.service; + + +import com.pms.ocp.model.entity.OcpApiModelRel; +import com.pms.ocp.model.vo.ResponseVO; + +public interface OcpApiModelRelService { + ResponseVO getOamrList(OcpApiModelRel ocpApiModelRel); +} diff --git a/src/main/java/com/pms/ocp/service/OcpApiSubsService.java b/src/main/java/com/pms/ocp/service/OcpApiSubsService.java index bc4cf89534eca39c732a6edad278b3aad2a425f3..72d9e1efba95e68c5fe3eb87bcc51cfadf0e4d7c 100644 --- a/src/main/java/com/pms/ocp/service/OcpApiSubsService.java +++ b/src/main/java/com/pms/ocp/service/OcpApiSubsService.java @@ -2,6 +2,8 @@ package com.pms.ocp.service; import com.baomidou.mybatisplus.extension.service.IService; import com.pms.ocp.model.entity.OcpApiSubs; +import com.pms.ocp.model.vo.ResponseVO; -public interface OcpApiSubsService extends IService { +public interface OcpApiSubsService { + ResponseVO getOcpApiSubsList(OcpApiSubs ocpApiSubs); } diff --git a/src/main/java/com/pms/ocp/service/OcpApiTenantRelService.java b/src/main/java/com/pms/ocp/service/OcpApiTenantRelService.java new file mode 100644 index 0000000000000000000000000000000000000000..54e24cbfe36e00e7db834e0f7d711cc5b242c1ab --- /dev/null +++ b/src/main/java/com/pms/ocp/service/OcpApiTenantRelService.java @@ -0,0 +1,9 @@ +package com.pms.ocp.service; + +import com.pms.ocp.model.entity.OcpApiTenantRel; +import com.pms.ocp.model.vo.ResponseVO; + + +public interface OcpApiTenantRelService { + ResponseVO getOatrList(OcpApiTenantRel ocpApiTenantRel); +} diff --git a/src/main/java/com/pms/ocp/service/impl/ApiBasicManagementServiceImpl.java b/src/main/java/com/pms/ocp/service/impl/ApiBasicManagementServiceImpl.java index 9be1b6db88832825336c761c86528a3c6a973aac..de8b6c3a37d77337117a9ee0b76e9f1a3174298c 100644 --- a/src/main/java/com/pms/ocp/service/impl/ApiBasicManagementServiceImpl.java +++ b/src/main/java/com/pms/ocp/service/impl/ApiBasicManagementServiceImpl.java @@ -77,7 +77,7 @@ public class ApiBasicManagementServiceImpl extends ServiceImpl ocpApiAuditList = ocpApiAuditMapper.getOcpApiSubsList(ocpApiAudit); + if(CollectionUtils.isEmpty(ocpApiAuditList)){ + return ResponseVO.error("查询列表为空"); + }else{ + return ResponseVO.ok(ocpApiAuditList); + } + } + +// @Override +// public ResponseVO getOcpApiList(Oaa oaa) { +// List list = ocpApiAuditMapper.getOcpApiSubsList(oaa); +// return ResponseVO.ok(list); +// } + + @Override + public ResponseVO getOcpApiDetails(String objId) { + OcpApiAudit ocpApiAudit = ocpApiAuditMapper.selectById(objId); + return ResponseVO.ok(ocpApiAudit); + } + + @Override + public ResponseVO OaaById(OcpApiAudit ocpApiAudit) { + List oaaById = ocpApiAuditMapper.OaaById(ocpApiAudit); + return ResponseVO.ok(oaaById); + } + + @Override + public ResponseVO sById(OcpApiAudit ocpApiAudit) { + List oaaById = ocpApiAuditMapper.sById(ocpApiAudit); + return ResponseVO.ok(oaaById); + } + +// @Override +// public void exportExcel(Oaa oaa, HttpServletRequest request, HttpServletResponse response) { +// List list = ocpApiAuditMapper.selectList(oaa); +// ExportParams param = new ExportParams(AnalysisConstant.exportOcpApiAuditName.OCP_API_AUDIT,AnalysisConstant.exportOcpApiAuditName.OCP_API_AUDIT); +// Workbook workbook = ExcelExportUtil.exportExcel(param,OcpApiAudit.class,list); +// ExportUtils.exportExcel(response, AnalysisConstant.exportOcpApiAuditName.OCP_API_AUDIT,workbook); +// } + + +} diff --git a/src/main/java/com/pms/ocp/service/impl/OcpApiModelRelServiceImpl.java b/src/main/java/com/pms/ocp/service/impl/OcpApiModelRelServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..0faa367c6e7e5dacdc56544201d15d22353a5db8 --- /dev/null +++ b/src/main/java/com/pms/ocp/service/impl/OcpApiModelRelServiceImpl.java @@ -0,0 +1,21 @@ +package com.pms.ocp.service.impl; + +import com.pms.ocp.mapper.OcpApiModelRelMapper; +import com.pms.ocp.model.entity.OcpApiModelRel; +import com.pms.ocp.model.vo.ResponseVO; +import com.pms.ocp.service.OcpApiModelRelService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class OcpApiModelRelServiceImpl implements OcpApiModelRelService { + @Autowired + private OcpApiModelRelMapper ocpApiModelRelMapper; + @Override + public ResponseVO getOamrList(OcpApiModelRel ocpApiModelRel) { + List ocpApiModelRelList = ocpApiModelRelMapper.getOamrList(ocpApiModelRel); + return ResponseVO.ok(ocpApiModelRelList); + } +} diff --git a/src/main/java/com/pms/ocp/service/impl/OcpApiSubsServiceImpl.java b/src/main/java/com/pms/ocp/service/impl/OcpApiSubsServiceImpl.java index 81cae1972afca55d88095e00b41380aae41e04f1..baab60b5eb48f0c1956cd1e427d0cd3347814323 100644 --- a/src/main/java/com/pms/ocp/service/impl/OcpApiSubsServiceImpl.java +++ b/src/main/java/com/pms/ocp/service/impl/OcpApiSubsServiceImpl.java @@ -3,9 +3,26 @@ package com.pms.ocp.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.pms.ocp.mapper.OcpApiSubsMapper; import com.pms.ocp.model.entity.OcpApiSubs; +import com.pms.ocp.model.vo.ResponseVO; import com.pms.ocp.service.OcpApiSubsService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; @Service -public class OcpApiSubsServiceImpl extends ServiceImpl implements OcpApiSubsService { +public class OcpApiSubsServiceImpl implements OcpApiSubsService { + + @Autowired + private OcpApiSubsMapper ocpApiSubsMapper; + @Override + public ResponseVO getOcpApiSubsList(OcpApiSubs ocpApiSubs) { + List ocpApiSubsList = ocpApiSubsMapper.getOcpApisList(ocpApiSubs); + if(CollectionUtils.isEmpty(ocpApiSubsList)){ + return ResponseVO.error("查询列表为空"); + }else{ + return ResponseVO.ok(ocpApiSubsList); + } + } } diff --git a/src/main/java/com/pms/ocp/service/impl/OcpApiTenantRelServiceImpl.java b/src/main/java/com/pms/ocp/service/impl/OcpApiTenantRelServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..ac4edbdc81dea28917b153a0eca6ffce55d934a4 --- /dev/null +++ b/src/main/java/com/pms/ocp/service/impl/OcpApiTenantRelServiceImpl.java @@ -0,0 +1,24 @@ +package com.pms.ocp.service.impl; + +import com.pms.ocp.mapper.OcpApiTenantRelMapper; +import com.pms.ocp.model.entity.OcpApiTenantRel; +import com.pms.ocp.model.vo.ResponseVO; +import com.pms.ocp.service.OcpApiTenantRelService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + + +@Service +public class OcpApiTenantRelServiceImpl implements OcpApiTenantRelService { + @Autowired + private OcpApiTenantRelMapper ocpApiTenantRelMapper; + + + @Override + public ResponseVO getOatrList(OcpApiTenantRel ocpApiTenantRel) { + List oatrList = ocpApiTenantRelMapper.getOatrList(ocpApiTenantRel); + return ResponseVO.ok(oatrList); + } +} diff --git a/src/main/resources/mapper/OcpApiAuditMapper.xml b/src/main/resources/mapper/OcpApiAuditMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..115806b83215fc6eba4c887df1fcbc63133cb7da --- /dev/null +++ b/src/main/resources/mapper/OcpApiAuditMapper.xml @@ -0,0 +1,19 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/OcpApiModelRelMapper.xml b/src/main/resources/mapper/OcpApiModelRelMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..b843637fdc5832d74beb1023435cfe876ceda7bd --- /dev/null +++ b/src/main/resources/mapper/OcpApiModelRelMapper.xml @@ -0,0 +1,13 @@ + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/OcpApiSubsMapper.xml b/src/main/resources/mapper/OcpApiSubsMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..d3895ae6b4d42b9cb03c1ff94b65b014a6b9aa13 --- /dev/null +++ b/src/main/resources/mapper/OcpApiSubsMapper.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/OcpApiTenantRelMapper.xml b/src/main/resources/mapper/OcpApiTenantRelMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..927727a05c7e6763dbb847b10a30d0ec257313d9 --- /dev/null +++ b/src/main/resources/mapper/OcpApiTenantRelMapper.xml @@ -0,0 +1,13 @@ + + + + + +