diff --git a/lib/ojdbc8-11.2.0.3.jar b/lib/ojdbc8-11.2.0.3.jar new file mode 100644 index 00000000..3aa102fe Binary files /dev/null and b/lib/ojdbc8-11.2.0.3.jar differ diff --git a/pom.xml b/pom.xml index 06276c1e..e610e158 100644 --- a/pom.xml +++ b/pom.xml @@ -92,6 +92,14 @@ mysql-connector-java ${mysql.version} + + + + + + + + com.oracle diff --git a/renren-admin/lib/ojdbc8-11.2.0.3.jar b/renren-admin/lib/ojdbc8-11.2.0.3.jar new file mode 100644 index 00000000..3aa102fe Binary files /dev/null and b/renren-admin/lib/ojdbc8-11.2.0.3.jar differ diff --git a/renren-admin/pom.xml b/renren-admin/pom.xml index c1274993..678c6c53 100644 --- a/renren-admin/pom.xml +++ b/renren-admin/pom.xml @@ -231,6 +231,22 @@ ${project.basedir}/lib/yawei-pso-${yawei-pso.version}.jar ${yawei-pso.version} + + + com.oracle + ojdbc8 + system + ${project.basedir}/lib/ojdbc8-11.2.0.3.jar + ${oracle.version} + + + + + + + + + sw.vc3term @@ -333,7 +349,7 @@ application-prod.yml application-show.yml application-test.yml - application-xha.yml + db/*.sql domain/** @@ -370,6 +386,7 @@ . lib/yawei-pso-${yawei-pso.version}.jar lib/contingencyplan-${contingencyplan.version}.jar + lib/ojdbc8-11.2.0.3.jar diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java b/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java index 213151aa..a1ea38d4 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java @@ -12,6 +12,7 @@ import io.renren.common.utils.Result; import io.renren.modules.activiti.dto.BatchCompleteDTO; import io.renren.modules.activiti.dto.TaskDTO; import io.renren.modules.activiti.service.ActTaskService; +import io.renren.modules.resource.service.impl.ResourceServiceImpl; import io.renren.modules.security.user.SecurityUser; import io.renren.modules.security.user.UserDetail; import io.renren.modules.sys.dto.SysUserDTO; @@ -25,6 +26,8 @@ import org.activiti.engine.TaskService; import org.activiti.engine.repository.ProcessDefinition; import org.activiti.engine.repository.ProcessDefinitionQuery; import org.activiti.engine.task.TaskQuery; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.util.StringUtils; @@ -47,6 +50,8 @@ import java.util.stream.Collectors; @Api(tags = "任务管理") public class ActTaskController { + private static final Logger logger = LoggerFactory.getLogger(ActTaskController.class); + private static final Integer CPU_NUM = Runtime.getRuntime().availableProcessors(); private static final ExecutorService executor = Executors.newWorkStealingPool(CPU_NUM * 3); @@ -67,6 +72,8 @@ public class ActTaskController { this.lcJdbcTemplate = JdbcTemplateFactory.getJdbcTemplate(); } + + /** * 获取用户任务列表 * 根据用户ID或角色组获取任务信息 @@ -454,8 +461,9 @@ public class ActTaskController { }) public Result getZwyBusinessList(String name, String applyType, String status, int pageNum, int pageSize) { UserDetail user = SecurityUser.getUser(); + JdbcTemplate lcJdbcTemplate = JdbcTemplateFactory.getJdbcTemplate(); StringBuilder sql = new StringBuilder("SELECT BSNUM, BUSINESS_NAME, APPLYTYPE, to_char(CREATE_TIME,'yyyy-mm-dd hh24:mi:ss') AS \"CREATE_TIME\", STATUS " + - "FROM VIEW_CLOUD_BUSINESS_INDEX WHERE 1 = 1 AND APPLYTYPE = '01' AND STATUS != '00' AND ACCOUNT = '" + user.getUsername() + "'"); + "FROM VIEW_CLOUD_BUSINESS_INDEX WHERE 1 = 1 AND APPLYTYPE = '01' AND STATUS != '00' AND ACCOUNT = '" + user.getUsername() + "'"); if (!StringUtils.isEmpty(name)) { sql.append(" AND BUSINESS_NAME LIKE CONCAT('%', ").append(name).append(", '%') "); } @@ -466,14 +474,17 @@ public class ActTaskController { sql.append(" AND STATUS = '").append(status).append("'"); } sql.append("ORDER BY CREATE_TIME DESC"); + logger.error("--->查询语句{}", sql); try { Map resultMap = new HashMap<>(); List> list = lcJdbcTemplate.queryForList(sql.toString()); - resultMap.put("total", list.size()); - List> result = list.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); - resultMap.put("list", result); + resultMap.put("total", list.isEmpty() ? 0 : list.size()); + list = list.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); + resultMap.put("list", list); return new Result().ok(resultMap); } catch (Exception e) { + logger.error("浪潮数据查询异常", e); + return new Result().error("数据查询异常,请联系云资源数据库管理人员!"); } @@ -490,6 +501,7 @@ public class ActTaskController { }) public Result getZwyVideoList(String name, String status, int pageNum, int pageSize) { + JdbcTemplate lcJdbcTemplate = JdbcTemplateFactory.getJdbcTemplate(); UserDetail user = SecurityUser.getUser(); StringBuilder sql = new StringBuilder("SELECT BSNUM, BUSINESS_NAME, to_char(CREATE_TIME,'yyyy-mm-dd hh24:mi:ss') AS \"CREATE_TIME\", STATUS " + "FROM VIEW_VIDEO_BUSINESS_INDEX WHERE 1 = 1 AND STATUS != '00' AND ACCOUNT = '" + user.getUsername() + "'"); @@ -500,14 +512,16 @@ public class ActTaskController { sql.append(" AND STATUS = '").append(status).append("'"); } sql.append("ORDER BY CREATE_TIME DESC"); + logger.error("--->查询语句{}", sql); try { Map resultMap = new HashMap<>(); List> list = lcJdbcTemplate.queryForList(sql.toString()); - resultMap.put("total", list.size()); - List> result = list.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); - resultMap.put("list", result); + resultMap.put("total", list.isEmpty() ? 0 : list.size()); + list = list.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); + resultMap.put("list", list); return new Result().ok(resultMap); } catch (Exception e) { + logger.error("浪潮数据查询异常", e); return new Result().error("数据查询异常,请联系云资源数据库管理人员!"); } @@ -521,6 +535,7 @@ public class ActTaskController { @ApiImplicitParam(name = "id", value = "业务ID", paramType = "query", required = true, dataType = "String") }) public Result getZwyBusinessInfoById(String id) { + JdbcTemplate lcJdbcTemplate = JdbcTemplateFactory.getJdbcTemplate(); try { ArrayList arrayList = new ArrayList<>(); @@ -530,6 +545,7 @@ public class ActTaskController { StringBuilder sql = new StringBuilder("SELECT BSNUM, '云主机' AS \"SOURCE_TYPE\", NAME, DISPOSE AS \"INFO\" " + " FROM VIEW_CLOUD_HOST_INFO WHERE 1 = 1 AND BSNUM = '"); sql.append(id).append("'"); + logger.error("--->查询语句{}", sql); List> list = lcJdbcTemplate.queryForList(sql.toString()); arrayList.addAll(list); @@ -541,6 +557,7 @@ public class ActTaskController { StringBuilder sql = new StringBuilder("SELECT BSNUM, '云数据库' AS \"SOURCE_TYPE\", NAME, (TYPE || '/' || STORAGE_SPACE || 'GB') AS \"INFO\" " + " FROM VIEW_CLOUD_DATABASE_INFO WHERE 1 = 1 AND BSNUM = '"); sql.append(id).append("'"); + logger.error("--->查询语句{}", sql); List> list = lcJdbcTemplate.queryForList(sql.toString()); arrayList.addAll(list); @@ -552,6 +569,7 @@ public class ActTaskController { StringBuilder sql = new StringBuilder("SELECT BSNUM, '对象存储' AS \"SOURCE_TYPE\", NAME, (DATA_DISK || 'GB') AS \"INFO\" " + " FROM VIEW_CLOUD_OBJECTSTORAGE_INFO WHERE 1 = 1 AND BSNUM = '"); sql.append(id).append("'"); + logger.error("--->查询语句{}", sql); List> list = lcJdbcTemplate.queryForList(sql.toString()); arrayList.addAll(list); @@ -562,6 +580,7 @@ public class ActTaskController { StringBuilder sql = new StringBuilder("SELECT BSNUM, '托管服务' AS \"SOURCE_TYPE\", NAME, (U_NUM || 'U') AS \"INFO\" " + " FROM VIEW_TRUSTEESHIPSERVICE_INFO WHERE 1 = 1 AND BSNUM = '"); sql.append(id).append("'"); + logger.error("--->查询语句{}", sql); List> list = lcJdbcTemplate.queryForList(sql.toString()); arrayList.addAll(list); @@ -571,6 +590,8 @@ public class ActTaskController { all.join(); return new Result().ok(arrayList); } catch (Exception e) { + logger.error("浪潮数据查询异常", e); + return new Result().error("数据查询异常,请联系云资源数据库管理人员!"); } @@ -583,14 +604,17 @@ public class ActTaskController { @ApiImplicitParam(name = "id", value = "业务ID", paramType = "query", required = true, dataType = "String") }) public Result getZwyVideoInfoById(String id) { - + JdbcTemplate lcJdbcTemplate = JdbcTemplateFactory.getJdbcTemplate(); StringBuilder sql = new StringBuilder("SELECT BSNUM, CAMERATYPE, NAME, ORG_NAME " + "FROM VIEW_VIDEO_BUSINESS_RELATION WHERE 1 = 1 AND BSNUM = '"); sql.append(id).append("'"); + logger.error("--->查询语句{}", sql); try { List> list = lcJdbcTemplate.queryForList(sql.toString()); return new Result().ok(list); } catch (Exception e) { + logger.error("浪潮数据查询异常", e); + return new Result().error("数据查询异常,请联系云资源数据库管理人员!"); } diff --git a/renren-admin/src/main/java/io/renren/modules/devtools/utils/DbUtils.java b/renren-admin/src/main/java/io/renren/modules/devtools/utils/DbUtils.java index a0ca2a63..3fcd7fd0 100644 --- a/renren-admin/src/main/java/io/renren/modules/devtools/utils/DbUtils.java +++ b/renren-admin/src/main/java/io/renren/modules/devtools/utils/DbUtils.java @@ -6,7 +6,6 @@ import io.renren.modules.devtools.config.query.AbstractQuery; import io.renren.modules.devtools.entity.TableFieldEntity; import io.renren.modules.devtools.entity.TableInfoEntity; import lombok.extern.slf4j.Slf4j; -import oracle.jdbc.OracleConnection; import java.sql.*; import java.util.ArrayList; @@ -34,7 +33,7 @@ public class DbUtils { Connection connection = DriverManager.getConnection(info.getConnUrl(), info.getUsername(), info.getPassword()); if (info.getDbType() == DbType.Oracle) { - ((OracleConnection) connection).setRemarksReporting(true); + //((OracleConnection) connection).setRemarksReporting(true); } return connection; diff --git a/renren-api/lib/ojdbc8-11.2.0.3.jar b/renren-api/lib/ojdbc8-11.2.0.3.jar new file mode 100644 index 00000000..3aa102fe Binary files /dev/null and b/renren-api/lib/ojdbc8-11.2.0.3.jar differ diff --git a/renren-api/pom.xml b/renren-api/pom.xml index 09de07dc..2c02dacb 100644 --- a/renren-api/pom.xml +++ b/renren-api/pom.xml @@ -16,6 +16,14 @@ renren-common 2.9.0 + + + com.oracle + ojdbc6 + system + ${project.basedir}/lib/ojdbc6-11.2.0.3.jar + ${oracle.version} + diff --git a/renren-common/lib/ojdbc8-11.2.0.3.jar b/renren-common/lib/ojdbc8-11.2.0.3.jar new file mode 100644 index 00000000..3aa102fe Binary files /dev/null and b/renren-common/lib/ojdbc8-11.2.0.3.jar differ diff --git a/renren-dynamic-datasource/lib/ojdbc8-11.2.0.3.jar b/renren-dynamic-datasource/lib/ojdbc8-11.2.0.3.jar new file mode 100644 index 00000000..3aa102fe Binary files /dev/null and b/renren-dynamic-datasource/lib/ojdbc8-11.2.0.3.jar differ