diff --git a/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml b/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml index 0e28eb555d..847da3aacc 100644 --- a/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml +++ b/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml @@ -136,6 +136,12 @@ hystrix: isolation: thread: timeoutInMilliseconds: 60000 #缺省为1000 + threadpool: + default: + coreSize: 20 + maximumSize: 50 + maxQueueSize: 500 + queueSizeRejectionThreshold: 200 ribbon: ReadTimeout: 300000 diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index 888f8544d1..797c0c5e5b 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -471,6 +471,12 @@ hystrix: isolation: thread: timeoutInMilliseconds: 60000 #缺省为1000 + threadpool: + default: + coreSize: 20 + maximumSize: 50 + maxQueueSize: 500 + queueSizeRejectionThreshold: 200 ribbon: ReadTimeout: 300000 diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml index af955a0722..fd72caafbf 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml @@ -191,6 +191,13 @@ hystrix: isolation: thread: timeoutInMilliseconds: 60000 #缺省为1000 + threadpool: + default: + coreSize: 20 + maximumSize: 50 + maxQueueSize: 500 + queueSizeRejectionThreshold: 200 + ribbon: ReadTimeout: 300000 diff --git a/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml b/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml index 7d3bf719af..205f7efffa 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml @@ -138,6 +138,12 @@ hystrix: isolation: thread: timeoutInMilliseconds: 60000 #缺省为1000 + threadpool: + default: + coreSize: 20 + maximumSize: 50 + maxQueueSize: 500 + queueSizeRejectionThreshold: 200 ribbon: ReadTimeout: 300000 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml index 368ee31ebe..f60ad30d00 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml @@ -120,6 +120,12 @@ hystrix: isolation: thread: timeoutInMilliseconds: 60000 #缺省为1000 + threadpool: + default: + coreSize: 20 + maximumSize: 50 + maxQueueSize: 500 + queueSizeRejectionThreshold: 200 ribbon: ReadTimeout: 300000 diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml index 77138fd835..7d0e8dd471 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml @@ -122,6 +122,12 @@ hystrix: isolation: thread: timeoutInMilliseconds: 60000 #缺省为1000 + threadpool: + default: + coreSize: 20 + maximumSize: 50 + maxQueueSize: 500 + queueSizeRejectionThreshold: 200 ribbon: ReadTimeout: 300000 diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml index 9893b21193..cd7764c4c4 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml @@ -127,6 +127,12 @@ hystrix: isolation: thread: timeoutInMilliseconds: 600000 #缺省为1000 + threadpool: + default: + coreSize: 20 + maximumSize: 50 + maxQueueSize: 500 + queueSizeRejectionThreshold: 200 ribbon: ReadTimeout: 600000 diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml index 97fde10faf..ba1ebd9637 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml @@ -133,6 +133,12 @@ hystrix: isolation: thread: timeoutInMilliseconds: 60000 #缺省为1000 + threadpool: + default: + coreSize: 20 + maximumSize: 50 + maxQueueSize: 500 + queueSizeRejectionThreshold: 200 ribbon: ReadTimeout: 300000 diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml index a7e2df7e6f..63b721cef6 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml @@ -122,6 +122,12 @@ hystrix: isolation: thread: timeoutInMilliseconds: 60000 #缺省为1000 + threadpool: + default: + coreSize: 20 + maximumSize: 50 + maxQueueSize: 500 + queueSizeRejectionThreshold: 200 ribbon: ReadTimeout: 300000 diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml b/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml index 5347bdcd70..8ce4eb923f 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml @@ -77,6 +77,12 @@ hystrix: isolation: thread: timeoutInMilliseconds: 60000 #缺省为1000 + threadpool: + default: + coreSize: 20 + maximumSize: 50 + maxQueueSize: 500 + queueSizeRejectionThreshold: 200 ribbon: ReadTimeout: 300000 diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml index d4c4b44d34..6409f6c5ac 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml @@ -120,6 +120,12 @@ hystrix: isolation: thread: timeoutInMilliseconds: 60000 #缺省为1000 + threadpool: + default: + coreSize: 20 + maximumSize: 50 + maxQueueSize: 500 + queueSizeRejectionThreshold: 200 ribbon: ReadTimeout: 300000 diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml b/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml index 6b12841f19..0d2b8c3ceb 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml @@ -101,6 +101,12 @@ hystrix: isolation: thread: timeoutInMilliseconds: 60000 #缺省为1000 + threadpool: + default: + coreSize: 20 + maximumSize: 50 + maxQueueSize: 500 + queueSizeRejectionThreshold: 200 ribbon: ReadTimeout: 300000 diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index 760f9690ad..3ee1bc565e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -66,6 +66,9 @@ import org.springframework.transaction.annotation.Transactional; import java.lang.reflect.Field; import java.util.*; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; @@ -112,6 +115,8 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl(); } - List list = baseDao.selectStaffOrgList(staffOrgsFormDTO.getCustomerIdList()); + CompletableFuture> listFuture = CompletableFuture.supplyAsync(()-> baseDao.selectStaffOrgList(staffOrgsFormDTO.getCustomerIdList()),executorService); + //List list = baseDao.selectStaffOrgList(staffOrgsFormDTO.getCustomerIdList()); + CustomerFormDTO customerFormDTO = new CustomerFormDTO(); customerFormDTO.setCustomerIdList(staffOrgsFormDTO.getCustomerIdList()); - Result> customerDTOResult = operCrmFeignClient.queryCustomerList(customerFormDTO); + CompletableFuture>> customerDTOResultFuture = CompletableFuture.supplyAsync(()-> operCrmFeignClient.queryCustomerList(customerFormDTO),executorService); + //Result> customerDTOResult = operCrmFeignClient.queryCustomerList(customerFormDTO); + List list = null; + Result> customerDTOResult = null; + try { + list = listFuture.get(10, TimeUnit.SECONDS); + customerDTOResult = customerDTOResultFuture.get(10, TimeUnit.SECONDS); + } catch (Exception e) { + log.error("getStaffOrgList exception",e); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); + } List customerDTOList = customerDTOResult.getData(); if (customerDTOResult.success() && customerDTOList.size() > 0) { for (CustomerDTO customer : customerDTOList) { diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml b/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml index 7a39cb8d95..d9ef717249 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml @@ -214,6 +214,12 @@ hystrix: isolation: thread: timeoutInMilliseconds: 60000 #缺省为1000 + threadpool: + default: + coreSize: 20 + maximumSize: 50 + maxQueueSize: 500 + queueSizeRejectionThreshold: 200 ribbon: ReadTimeout: 300000 diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml index 18f921b75d..8c0a41ab0d 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml @@ -111,6 +111,12 @@ hystrix: isolation: thread: timeoutInMilliseconds: 60000 #缺省为1000 + threadpool: + default: + coreSize: 20 + maximumSize: 50 + maxQueueSize: 500 + queueSizeRejectionThreshold: 200 ribbon: ReadTimeout: 300000 diff --git a/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml b/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml index 44d601f5ca..7a5a301ba6 100644 --- a/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml +++ b/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml @@ -122,6 +122,12 @@ hystrix: isolation: thread: timeoutInMilliseconds: 60000 #缺省为1000 + threadpool: + default: + coreSize: 20 + maximumSize: 50 + maxQueueSize: 500 + queueSizeRejectionThreshold: 200 ribbon: ReadTimeout: 300000 diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java index 856a72c96d..fb26af5f00 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java @@ -229,8 +229,24 @@ public class CustomerServiceImpl extends BaseServiceImpl> queryCustomerList(CustomerFormDTO formDTO) { - List customerDTOList = baseDao.selectListByIds(formDTO.getCustomerIdList()); - return new Result>().ok(customerDTOList); + List result = new ArrayList<>(); + if(formDTO.getCustomerIdList() != null){ + for (String customerId : formDTO.getCustomerIdList()) { + //先从缓存取 取不到从数据库取 + CustomerDTO customerDTO = customerRedis.queryCustomerInfo(customerId); + if (customerDTO == null) { + CustomerEntity customerEntity = baseDao.selectById(customerId); + if (customerEntity != null) { + customerDTO = ConvertUtils.sourceToTarget(customerEntity, CustomerDTO.class); + } + } + if (customerDTO != null) { + result.add(customerDTO); + } + } + //List customerDTOList = baseDao.selectListByIds(formDTO.getCustomerIdList()); + } + return new Result>().ok(result); } @Override diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml b/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml index d4fd81c58f..714c45a95f 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml @@ -128,6 +128,12 @@ hystrix: isolation: thread: timeoutInMilliseconds: 60000 #缺省为1000 + threadpool: + default: + coreSize: 20 + maximumSize: 50 + maxQueueSize: 500 + queueSizeRejectionThreshold: 200 ribbon: ReadTimeout: 300000 diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml index 1db0540a46..ce28431363 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml @@ -123,6 +123,12 @@ hystrix: isolation: thread: timeoutInMilliseconds: 60000 #缺省为1000 + threadpool: + default: + coreSize: 20 + maximumSize: 50 + maxQueueSize: 500 + queueSizeRejectionThreshold: 200 ribbon: ReadTimeout: 300000 diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml b/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml index 38d164bfb5..97348ebc84 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml @@ -131,6 +131,12 @@ hystrix: isolation: thread: timeoutInMilliseconds: 60000 #缺省为1000 + threadpool: + default: + coreSize: 20 + maximumSize: 50 + maxQueueSize: 500 + queueSizeRejectionThreshold: 200 ribbon: ReadTimeout: 300000 diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml b/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml index 1076e0030f..6fcb9f365c 100644 --- a/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml @@ -123,6 +123,12 @@ hystrix: isolation: thread: timeoutInMilliseconds: 60000 #缺省为1000 + threadpool: + default: + coreSize: 20 + maximumSize: 50 + maxQueueSize: 500 + queueSizeRejectionThreshold: 200 ribbon: ReadTimeout: 300000 diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml b/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml index 4fc19e9bd7..45ed220213 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml @@ -104,6 +104,12 @@ hystrix: isolation: thread: timeoutInMilliseconds: 60000 #缺省为1000 + threadpool: + default: + coreSize: 20 + maximumSize: 50 + maxQueueSize: 500 + queueSizeRejectionThreshold: 200 ribbon: ReadTimeout: 300000 @@ -129,4 +135,4 @@ thread: queueCapacity: @thread.threadPool.queue-capacity@ keepAliveSeconds: @thread.threadPool.keep-alive-seconds@ threadNamePrefix: @thread.threadPool.thread-name-prefix@ - rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@ \ No newline at end of file + rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@ diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml index ab22d6ce22..e6b1b16aa4 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml @@ -122,6 +122,12 @@ hystrix: isolation: thread: timeoutInMilliseconds: 60000 #缺省为1000 + threadpool: + default: + coreSize: 20 + maximumSize: 50 + maxQueueSize: 500 + queueSizeRejectionThreshold: 200 ribbon: ReadTimeout: 300000 diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml b/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml index 01d9431086..051747d9ca 100644 --- a/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml @@ -72,6 +72,12 @@ hystrix: isolation: thread: timeoutInMilliseconds: 60000 #缺省为1000 + threadpool: + default: + coreSize: 20 + maximumSize: 50 + maxQueueSize: 500 + queueSizeRejectionThreshold: 200 ribbon: ReadTimeout: 300000 @@ -97,4 +103,4 @@ thread: queueCapacity: @thread.threadPool.queue-capacity@ keepAliveSeconds: @thread.threadPool.keep-alive-seconds@ threadNamePrefix: @thread.threadPool.thread-name-prefix@ - rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@ \ No newline at end of file + rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@ diff --git a/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml b/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml index 46786ebd6b..1a9ecfdc59 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml +++ b/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml @@ -76,6 +76,12 @@ hystrix: isolation: thread: timeoutInMilliseconds: 60000 #缺省为1000 + threadpool: + default: + coreSize: 20 + maximumSize: 50 + maxQueueSize: 500 + queueSizeRejectionThreshold: 200 ribbon: ReadTimeout: 300000