From 89de07eac0255cfba953dc0fcba0521011e111e4 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 18 Nov 2022 11:12:12 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=94=BF=E5=8A=A1=E4=BA=91=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E8=B5=84=E6=BA=90=20=E6=9C=AC=E5=9C=B0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resource/controller/ResourceController.java | 17 +++++++++++++++++ .../db/V7.4__create_policy_cloud_service.sql | 14 ++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 renren-admin/src/main/resources/db/V7.4__create_policy_cloud_service.sql diff --git a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java index fc628c0f..6415e8b0 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java @@ -912,4 +912,21 @@ public class ResourceController { } } + @PostMapping("/getPolicyCloudService") + @ApiOperation("/获取政务云服务资源") + @LogOperation("/获取政务云服务资源") + public Result>> getPolicyCloudService(@RequestParam Map params) { + int page = 1; + int pageSize = 10; + if (params.containsKey("limit") && org.apache.commons.lang3.StringUtils.isNotBlank(params.get("limit").toString())) { + pageSize = Integer.parseInt(params.get("limit").toString()); + } + if (params.containsKey("page") && org.apache.commons.lang3.StringUtils.isNotBlank(params.get("page").toString())) { + page = Integer.parseInt(params.get("page").toString()); + } + String sql = String.format("SELECT * FROM policy_cloud_service LIMIT %d,%d", page * pageSize, pageSize); + List> result = jdbcTemplate.queryForList(sql); + return new Result>>().ok(new PageData<>(result, jdbcTemplate.queryForObject("SELECT COUNT(*) FROM policy_cloud_service", Long.class))); + } + } \ No newline at end of file diff --git a/renren-admin/src/main/resources/db/V7.4__create_policy_cloud_service.sql b/renren-admin/src/main/resources/db/V7.4__create_policy_cloud_service.sql new file mode 100644 index 00000000..6b8148ba --- /dev/null +++ b/renren-admin/src/main/resources/db/V7.4__create_policy_cloud_service.sql @@ -0,0 +1,14 @@ +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; +DROP TABLE IF EXISTS `policy_cloud_service`; +CREATE TABLE `policy_cloud_service` ( + `service_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `service_item_tier1` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `service_item_tier2` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `service_description` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `specification` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `remark` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `year` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL + PRIMARY KEY (`service_type`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; +SET FOREIGN_KEY_CHECKS = 1; From 5668ae110ddb599bc02919f6f68e21a93854ce7c Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 18 Nov 2022 12:41:45 +0800 Subject: [PATCH 2/3] ... --- .../controller/ResourceController.java | 12 +++- .../db/V7.4__create_policy_cloud_service.sql | 70 ++++++++++++++++++- 2 files changed, 76 insertions(+), 6 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java index 6415e8b0..1d416b8f 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java @@ -915,7 +915,7 @@ public class ResourceController { @PostMapping("/getPolicyCloudService") @ApiOperation("/获取政务云服务资源") @LogOperation("/获取政务云服务资源") - public Result>> getPolicyCloudService(@RequestParam Map params) { + public Result>> getPolicyCloudService(@RequestBody Map params) { int page = 1; int pageSize = 10; if (params.containsKey("limit") && org.apache.commons.lang3.StringUtils.isNotBlank(params.get("limit").toString())) { @@ -924,9 +924,15 @@ public class ResourceController { if (params.containsKey("page") && org.apache.commons.lang3.StringUtils.isNotBlank(params.get("page").toString())) { page = Integer.parseInt(params.get("page").toString()); } - String sql = String.format("SELECT * FROM policy_cloud_service LIMIT %d,%d", page * pageSize, pageSize); + String sql = String.format("SELECT * FROM policy_cloud_service LIMIT %d,%d", (page - 1) * pageSize, pageSize); + long count = jdbcTemplate.queryForObject("SELECT COUNT(*) FROM policy_cloud_service", Long.class); + if (params.containsKey("name") && org.apache.commons.lang3.StringUtils.isNotBlank(params.get("name").toString())) { + sql = String.format("SELECT * FROM policy_cloud_service WHERE service_description LIKE '%s' LIMIT %d,%d", "%" + params.get("name").toString() + "%", (page - 1) * pageSize, pageSize); + count = jdbcTemplate.queryForObject(String.format("SELECT COUNT(*) FROM policy_cloud_service WHERE service_description LIKE '%s'", "%" + params.get("name").toString() + "%"), Long.class); + } + logger.info("sql:" + sql); List> result = jdbcTemplate.queryForList(sql); - return new Result>>().ok(new PageData<>(result, jdbcTemplate.queryForObject("SELECT COUNT(*) FROM policy_cloud_service", Long.class))); + return new Result>>().ok(new PageData<>(result, count)); } } \ No newline at end of file diff --git a/renren-admin/src/main/resources/db/V7.4__create_policy_cloud_service.sql b/renren-admin/src/main/resources/db/V7.4__create_policy_cloud_service.sql index 6b8148ba..9f40fe5a 100644 --- a/renren-admin/src/main/resources/db/V7.4__create_policy_cloud_service.sql +++ b/renren-admin/src/main/resources/db/V7.4__create_policy_cloud_service.sql @@ -1,14 +1,78 @@ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for policy_cloud_service +-- ---------------------------- DROP TABLE IF EXISTS `policy_cloud_service`; CREATE TABLE `policy_cloud_service` ( `service_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `service_item_tier1` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, `service_item_tier2` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, - `service_description` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `service_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL, `specification` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, `remark` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, `year` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL - PRIMARY KEY (`service_type`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of policy_cloud_service +-- ---------------------------- +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置1H4G', '1H4G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置1H4G', '1H4G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置2H4G', '2H4G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置2H8G', '2H8G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置2H16G', '2H16G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置4H8G', '4H8G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置4H16G', '4H16G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置4H32G', '4H32G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置8H16G', '8H16G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置8H32G', '8H32G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置8H64G', '8H64G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置16H32G', '16H32G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置16H64G', '16H64G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置32H64G', '32H64G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置32H128G', '32H128G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机系统盘', '云主机系统盘', '40G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机数据盘', '云主机数据盘', '100G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '非结构化数据对象存储服务', '非结构化数据对象存储服务', '100G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '数据异地容灾服务', '数据异地容灾服务', '100G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '数据本地备份及快速恢复服务', '数据本地备份及快速恢复服务', '100G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '机柜服务', '机柜租赁服务', '机柜租赁服务', '1', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库RDS for MySQL', '云数据库RDS for MySQL', '1200MB内存', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库RDS for MySQL', '云数据库RDS for MySQL', '2400MB内存', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库RDS for MySQL', '云数据库RDS for MySQL', '6000MB内存', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库RDS for MySQL', '云数据库RDS for MySQL', '12000MB内存', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库RDS for MSSQL Server', '云数据库RDS for MS SQL Server', '1000MB内存', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库RDS for MSSQL Server', '云数据库RDS for MS SQL Server', '12000MB内存', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库RDS for MSSQL Server', '云数据库RDS for MS SQL Server', '4000MB内存', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库RDS for MSSQL Server', '云数据库RDS for MS SQL Server', '6000MB内存', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库RDS for MSSQL Server', '云数据库RDS for MS SQL Server', '12000MB内存', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库数据盘', '云数据库数据盘', '100MB内存', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '负载均衡', '负载均衡服务', '负载均衡服务', '实例', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('安全服务', '主机数据库应用安全服务', '等保三级标准服务', '云主机安全服务-等保三级服务', '云主机', '必选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('安全服务', '主机数据库应用安全服务', '数据安全服务', '数据安全服务', '数据库实例', '必选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('安全服务', '主机数据库应用安全服务', '应用安全服务', '应用安全服务', '云主机', '必选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('运营服务', '增值服务', '同城应用容灾服务', '同城应用容灾服务', '云主机', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('大数据服务', '数据分析服务', '数据分析服务', '数据分析服务数据离线计算', '1', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('大数据服务', '数据分析服务', '数据分析服务', '数据分析服务数据实时计算', '1', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('大数据服务', '数据分析服务', '数据分析服务', '数据分析服务数据同步服务', '1', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('大数据服务', '数据脱敏服务', '数据脱敏服务', '数据脱敏服务隐私数据发现', '套', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('大数据服务', '数据脱敏服务', '数据脱敏服务', '数据脱敏服务隐私数据漂泊', '1', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('大数据服务', '大数据存储', '非结构化数据存储', '大数据存储服务非结构化数据存储', '1', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('大数据服务', '大数据存储', '结构化数据存储', '大数据存储服务结构化数据存储', '1', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '操作系统和其他中间件', '商用操作系统套餐', 'Windows server 2008 、2012、2016数据中心版等安装、授权激活、维护', '云主机', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '操作系统和其他中间件', '商用操作系统套餐', 'Redhat 6.6以上不同版本系统安装和维护', '云主机', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '操作系统和其他中间件', '商用操作系统套餐', 'CentOS 6.5以上不同版本系统安装和维护', '云主机', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '操作系统和其他中间件', '桌面云基础套餐', '双核(1.6Ghz)/3G内存/40G系统盘/100G数据盘;6个USB口、1个VGA接口或1个HDMI接口,音频输入输出接口。支持1920*1200桌面分辨率。含瘦终端、分屏器、软件升级费用,不包含鼠标、键盘等外设费用', '个', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '操作系统和其他中间件', '桌面云基础套餐', '双核(1.6Ghz)/3G内存/40G系统盘/100G数据盘;6个USB口、1个VGA接口或1个HDMI接口,音频输入输出接口。支持1920*1200桌面分辨率。含瘦终端、分屏器、软件升级费用,不包含鼠标、键盘等外设费用', '个', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '操作系统和其他中间件', '桌面云标准套餐', '双核(2.0Ghz)/5G内存/40G系统盘/100G数据盘;6个USB口、1个VGA接口或1个HDMI接口,音频输入输出接口。支持1920*1200桌面分辨率。含瘦终端、分屏器、软件升级费用,不包含鼠标、键盘等外设费用', '个', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '操作系统和其他中间件', '桌面云高级套餐', '四核2.4GHz、8G内存/40G系统盘/100G数据盘;6个USB口、1个VGA接口和1个HDMI接口,音频输入输出接口。支持1920*1200桌面分辨率。含瘦终端、分屏器、软件升级费用,不包含鼠标、键盘等外设费用', '个', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '操作系统和其他中间件', '桌面云数据盘', '以100GB为单位', '100G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '云安全保障增值服务', '信息系统二级等级保护测评服务', '按照国家公安部门等级保护制度要求提供物理安全、网络安全、主机安全、数据安全、应用安全等测评服务(二级)。本服务目录价格为省公安厅最低价。', '信息系统', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '云安全保障增值服务', '信息系统三级等级保护测评服务', '按照国家公安部门等级保护制度要求提供物理安全、网络安全、主机安全、数据安全、应用安全等测评服务(三级)。本服务目录价格为省公安厅最低价。', '信息系统', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '云安全保障增值服务', '网页防篡改服务', '增强版网页防篡改服务。', '云主机', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '云安全保障增值服务', '商用密码安全评估', '按照国家《密码安全法》对云平台或云主机做商用密码安全全量评估。最终出具业内标准的商密评估报告。', '系统', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '云安全保障增值服务', '蜜罐服务', '融合网络欺骗和主动防御威胁检测防御系统,通过暗设陷阱,主动诱导攻击,能够动态感知内网攻击行为,及时精准的定位攻击源,并隐匿真实资产,保障业务系统的安全运行。', '套', '可选', '2022'); + SET FOREIGN_KEY_CHECKS = 1; From d3b3c4181fab868f8792537ef69ccf3325aaa35f Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 18 Nov 2022 13:06:05 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=94=BF=E5=8A=A1=E4=BA=91=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=20=E7=B1=BB=E5=9E=8B=20=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ResourceController.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java index 1d416b8f..a7faaf6d 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java @@ -924,13 +924,24 @@ public class ResourceController { if (params.containsKey("page") && org.apache.commons.lang3.StringUtils.isNotBlank(params.get("page").toString())) { page = Integer.parseInt(params.get("page").toString()); } - String sql = String.format("SELECT * FROM policy_cloud_service LIMIT %d,%d", (page - 1) * pageSize, pageSize); - long count = jdbcTemplate.queryForObject("SELECT COUNT(*) FROM policy_cloud_service", Long.class); + String sql; + String sqlRoot = "SELECT * FROM policy_cloud_service "; + String where = " WHERE 1=1 "; + String limit = String.format(" LIMIT %d,%d", (page - 1) * pageSize, pageSize); + + long count = 0; + if (params.containsKey("name") && org.apache.commons.lang3.StringUtils.isNotBlank(params.get("name").toString())) { - sql = String.format("SELECT * FROM policy_cloud_service WHERE service_description LIKE '%s' LIMIT %d,%d", "%" + params.get("name").toString() + "%", (page - 1) * pageSize, pageSize); - count = jdbcTemplate.queryForObject(String.format("SELECT COUNT(*) FROM policy_cloud_service WHERE service_description LIKE '%s'", "%" + params.get("name").toString() + "%"), Long.class); + where = where + String.format(" AND service_description LIKE '%s'", "%" + params.get("name").toString() + "%"); } + if (params.containsKey("type") && org.apache.commons.lang3.StringUtils.isNotBlank(params.get("type").toString())) { + where = where + String.format(" AND service_type = '%s'", params.get("type").toString()); + } + + sql = sqlRoot + where + limit; logger.info("sql:" + sql); + String sqlCount = "SELECT COUNT(*) FROM policy_cloud_service " + where; + count = jdbcTemplate.queryForObject(sqlCount, Long.class); List> result = jdbcTemplate.queryForList(sql); return new Result>>().ok(new PageData<>(result, count)); }