From 94ec1cceb97d33b029770803bb48dad9876f76bd Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 1 Mar 2022 16:44:52 +0800 Subject: [PATCH] =?UTF-8?q?stats=20=E5=8E=BB=E6=8E=89=E7=BA=BF=E7=A8=8B?= =?UTF-8?q?=E6=B1=A0=E5=AE=9A=E4=B9=89=20=E7=9B=B4=E6=8E=A5=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=9C=8D=E5=8A=A1=E5=AE=9A=E4=B9=89=E7=9A=84=E7=BA=BF?= =?UTF-8?q?=E7=A8=8B=E6=B1=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/DemoController.java | 14 ++----- .../ScreenExtractDailyController.java | 12 ++---- .../external/IndexCalculateController.java | 16 +++---- .../biz/impl/BizDataStatsServiceImpl.java | 7 ---- .../impl/IndexOriginExtractServiceImpl.java | 5 --- .../impl/FactOriginExtractServiceImpl.java | 29 +++++-------- .../impl/ScreenExtractServiceImpl.java | 42 +++++-------------- .../service/impl/TopicDraftServiceImpl.java | 28 ++++--------- 8 files changed, 41 insertions(+), 112 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index e7ba9b027f..a0abb1b2e2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -1098,12 +1098,6 @@ public class DemoController { return new Result(); } - ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() - .setNameFormat("ScreenExtractServiceImpl-pool-%d").build(); - ExecutorService threadPool = new ThreadPoolExecutor(3, 6, - 10L, TimeUnit.MINUTES, - new LinkedBlockingQueue<>(500), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy()); - @Autowired private ScreenProjectCategoryGridAndOrgDailyService screenProjectCategoryGridAndOrgDailyService; @@ -1118,20 +1112,20 @@ public class DemoController { if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)){ List daysBetween = DateUtils.getDaysBetween(startDate, endDate); daysBetween.forEach(d -> { - threadPool.submit(() -> { + executorService.submit(() -> { screenProjectCategoryGridAndOrgDailyService.extractCategoryProjectGridData(customerId,d); }); - threadPool.submit(() -> { + executorService.submit(() -> { screenProjectCategoryGridAndOrgDailyService.extractCategoryProjectOrgData(customerId,d); }); result.add(d); redisUtils.hSet(RedisKeys.getBackDoorbizExcuteResult("gridandorgdailynew"),customerId,result,3*24*60*60L); }); }else { - threadPool.submit(() -> { + executorService.submit(() -> { screenProjectCategoryGridAndOrgDailyService.extractCategoryProjectGridData(customerId,dateId); }); - threadPool.submit(() -> { + executorService.submit(() -> { screenProjectCategoryGridAndOrgDailyService.extractCategoryProjectOrgData(customerId,dateId); }); result.add(dateId); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java index 07919aa425..756ecc2d8a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java @@ -5,7 +5,6 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.ExtractScreenFormDTO; import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractService; -import com.google.common.util.concurrent.ThreadFactoryBuilder; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -13,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import java.util.concurrent.*; +import java.util.concurrent.ExecutorService; /** * @Author zxc @@ -23,13 +22,10 @@ import java.util.concurrent.*; @RestController @RequestMapping("screenextract") public class ScreenExtractDailyController { - ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() - .setNameFormat("ScreenExtractDailyController-pool-%d").build(); - ExecutorService threadPool = new ThreadPoolExecutor(1, 1, - 10L, TimeUnit.MINUTES, - new LinkedBlockingQueue<>(500), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy()); @Autowired private ScreenExtractService screenExtractService; + @Autowired + private ExecutorService executorService; /** * @param extractOriginFormDTO @@ -39,7 +35,7 @@ public class ScreenExtractDailyController { */ @PostMapping("extractdailyall") public Result screenExtractDaily(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) { - threadPool.submit(() -> { + executorService.submit(() -> { log.info("screenExtractDaily start,param:{}", JSON.toJSONString(extractOriginFormDTO)); try { screenExtractService.extractDailyAll(extractOriginFormDTO); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/external/IndexCalculateController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/external/IndexCalculateController.java index 247dc31d7f..15f6cb77c8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/external/IndexCalculateController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/external/IndexCalculateController.java @@ -17,7 +17,6 @@ import com.epmet.model.CalculateFlagModel; import com.epmet.service.evaluationindex.indexcal.CpcIndexCalculateService; import com.epmet.service.evaluationindex.indexcal.IndexCalculateService; import com.epmet.util.DimIdGenerator; -import com.google.common.util.concurrent.ThreadFactoryBuilder; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -28,7 +27,8 @@ import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.Set; -import java.util.concurrent.*; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Future; /** * 指标计算controller @@ -40,13 +40,6 @@ import java.util.concurrent.*; @RestController @RequestMapping("indexcalculate") public class IndexCalculateController { - ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() - .setNameFormat("manual_execute_indexcal-pool-%d").build(); - ExecutorService singleThreadPool = new ThreadPoolExecutor(1, 1, - 0L, TimeUnit.MILLISECONDS, - new LinkedBlockingQueue(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy()); - - @Autowired private IndexCalculateService indexCalculateService; @@ -55,6 +48,9 @@ public class IndexCalculateController { @Autowired private RedisUtils redisUtils; + @Autowired + private ExecutorService executorService; + // 计算同步锁 private Object statsCalLock = new Object(); @@ -172,7 +168,7 @@ public class IndexCalculateController { * @return */ private void submitCalculate(CalculateCommonFormDTO formDTO) { - Future future = singleThreadPool.submit(() -> { + Future future = executorService.submit(() -> { try { long start = System.currentTimeMillis(); Boolean aBoolean = indexCalculateService.indexCalculate(formDTO); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/biz/impl/BizDataStatsServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/biz/impl/BizDataStatsServiceImpl.java index 0b0d0d5f1c..25dd3d764b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/biz/impl/BizDataStatsServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/biz/impl/BizDataStatsServiceImpl.java @@ -21,7 +21,6 @@ import com.epmet.service.stats.DimCustomerService; import com.epmet.service.user.StatsStaffPatrolService; import com.epmet.service.user.UserService; import com.epmet.util.DimIdGenerator; -import com.google.common.util.concurrent.ThreadFactoryBuilder; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -34,7 +33,6 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; -import java.util.concurrent.*; import java.util.stream.Collectors; /** @@ -47,11 +45,6 @@ import java.util.stream.Collectors; @Slf4j @Service public class BizDataStatsServiceImpl implements BizDataStatsService { - ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() - .setNameFormat("bizDataStats-pool-%d").build(); - ExecutorService threadPool = new ThreadPoolExecutor(3, 6, - 10L, TimeUnit.MINUTES, - new LinkedBlockingQueue<>(500), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy()); @Autowired private CustomerStaffService customerStaffService; @Autowired diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java index 26c952ff79..b07c82ceb9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java @@ -30,11 +30,6 @@ import java.util.concurrent.ExecutorService; @Slf4j @Service public class IndexOriginExtractServiceImpl implements IndexOriginExtractService { - /*ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() - .setNameFormat("indexOriginExtractAndCal-pool-%d").build(); - ExecutorService threadPool = new ThreadPoolExecutor(1, 1, - 10L, TimeUnit.MINUTES, - new LinkedBlockingQueue<>(500), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy());*/ @Autowired private ExecutorService executorService; @Autowired diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java index b650e906d3..6db437e591 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java @@ -7,13 +7,10 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; -import com.epmet.service.StatsGroupService; -import com.epmet.service.StatsTopicService; import com.epmet.service.evaluationindex.extract.todata.*; import com.epmet.service.stats.DimCustomerPartymemberService; import com.epmet.service.stats.DimCustomerService; import com.epmet.util.DimIdGenerator; -import com.google.common.util.concurrent.ThreadFactoryBuilder; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -23,7 +20,9 @@ import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.Date; import java.util.List; -import java.util.concurrent.*; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Future; /** * desc:抽取业务数据 到 统计库 汇聚类 @@ -31,12 +30,6 @@ import java.util.concurrent.*; @Slf4j @Service public class FactOriginExtractServiceImpl implements FactOriginExtractService { - ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() - .setNameFormat("factOriginExtract-pool-%d").build(); - ExecutorService threadPool = new ThreadPoolExecutor(3, 6, - 10L, TimeUnit.MINUTES, - new LinkedBlockingQueue<>(500), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy()); - @Autowired private IssueExtractService issueExtractService; @Autowired @@ -54,9 +47,7 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { @Autowired private FactGroupActDailyService factGroupActDailyService; @Autowired - private StatsGroupService statsGroupService; - @Autowired - private StatsTopicService statsTopicService; + private ExecutorService executorService; @Override @@ -106,7 +97,7 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { daysBetween = DateUtils.getDaysBetween(param.getStartDate(), param.getEndDate()); } List finalDaysBetween = daysBetween; - threadPool.submit(() -> { + executorService.submit(() -> { try { CustomerIdAndDateIdFormDTO formDTO = new CustomerIdAndDateIdFormDTO(); formDTO.setCustomerId(param.getCustomerId()); @@ -132,7 +123,7 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { countDownLatch.countDown(); } }); - threadPool.submit(() -> { + executorService.submit(() -> { try { ExtractOriginFormDTO paramNew = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class); if (!isRange) { @@ -156,7 +147,7 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { countDownLatch.countDown(); } }); - threadPool.submit(() -> { + executorService.submit(() -> { try { log.debug("extractAll start param:{}", JSON.toJSONString(param)); ExtractOriginFormDTO paramNew = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class); @@ -183,7 +174,7 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { countDownLatch.countDown(); } }); - threadPool.submit(() -> { + executorService.submit(() -> { try { ExtractOriginFormDTO paramNew = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class); if (!isRange) { @@ -222,7 +213,7 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { } }); //小组活动 - threadPool.submit(() -> { + executorService.submit(() -> { try { ExtractOriginFormDTO extractOriginFormDTO = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class); if (!isRange) { @@ -339,7 +330,7 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { @Override public Future submitProjectRelationData(ExtractOriginFormDTO param, List finalDaysBetween) { - Future submit = threadPool.submit(() -> { + Future submit = executorService.submit(() -> { ExtractOriginFormDTO paramNew = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class); if (CollectionUtils.isEmpty(finalDaysBetween)) { try { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java index 193bebbdfc..e3ed39133b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java @@ -7,22 +7,17 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.distributedlock.DistributedLock; import com.epmet.commons.tools.distributedlock.LockConstants; -import com.epmet.commons.tools.enums.EnvEnum; import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.dto.extract.form.ExtractFactGridGovernDailyFromDTO; import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.ExtractScreenFormDTO; -import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; import com.epmet.service.evaluationindex.extract.todata.FactAgencyGovernDailyService; import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService; import com.epmet.service.evaluationindex.extract.todata.FactGridMemberStatisticsDailyService; import com.epmet.service.evaluationindex.extract.toscreen.*; -import com.epmet.service.evaluationindex.indexcal.IndexCalculateService; import com.epmet.service.evaluationindex.screen.*; import com.epmet.service.stats.DimCustomerService; -import com.google.common.util.concurrent.ThreadFactoryBuilder; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.redisson.api.RLock; @@ -33,7 +28,9 @@ import org.springframework.util.CollectionUtils; import java.time.LocalDate; import java.util.ArrayList; import java.util.List; -import java.util.concurrent.*; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.TimeUnit; /** * @Author zxc @@ -42,12 +39,6 @@ import java.util.concurrent.*; @Service @Slf4j public class ScreenExtractServiceImpl implements ScreenExtractService { - ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() - .setNameFormat("ScreenExtractServiceImpl-pool-%d").build(); - ExecutorService threadPool = new ThreadPoolExecutor(3, 6, - 10L, TimeUnit.MINUTES, - new LinkedBlockingQueue<>(500), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy()); - @Autowired private DimCustomerService dimCustomerService; @Autowired @@ -65,8 +56,6 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { @Autowired private PublicPartiTotalDataExtractService publicPartiTotalDataExtractService; @Autowired - private IndexCalculateService indexCalculateService; - @Autowired private ScreenCentralZoneDataAbsorptionService screenCentralZoneDataAbsorptionService; @Autowired private ScreenGrassrootsGovernDataAbsorptionService screenGrassrootsGovernDataAbsorptionService; @@ -81,10 +70,6 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { @Autowired private ScreenProjectSettleService screenProjectSettleService; @Autowired - private ScreenProjectCategoryGridDailyService projectCategoryGridDailyService; - @Autowired - private ScreenProjectCategoryOrgDailyService projectCategoryOrgDailyService; - @Autowired private FactGridGovernDailyService factGridGovernDailyService; @Autowired private FactAgencyGovernDailyService factAgencyGovernDailyService; @@ -94,6 +79,9 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { private ScreenProjectCategoryGridAndOrgDailyService screenProjectCategoryGridAndOrgDailyService; @Autowired private DistributedLock distributedLock; + @Autowired + private ExecutorService executorService; + /** * @param extractOriginFormDTO @@ -183,7 +171,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { lock = distributedLock.getLock(LockConstants.SCREEN_DAILY, NumConstant.SIX_HUNDRED_L, NumConstant.TEN_L, TimeUnit.SECONDS); //等待3个线程执行完毕后再 继续执行下一个客户的 避免死锁 final CountDownLatch latch = new CountDownLatch(NumConstant.FOUR); - threadPool.submit(() -> { + executorService.submit(() -> { //党员基本情况screen_cpc_base_data try { try { @@ -215,7 +203,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { } }); - threadPool.submit(() -> { + executorService.submit(() -> { //公众参与排行(注册人数、参与人数、话题数、议题数、项目数)screen_public_party_total_data try { @@ -263,7 +251,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { log.info("extractDaily 2 thread run end ========= dateId:{},customerId:{}", dateId, customerId); } }); - threadPool.submit(() -> { + executorService.submit(() -> { try { try { @@ -283,7 +271,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { log.info("extractDaily 3 thread run end ========= dateId:{},customerId:{}", dateId, customerId); } }); - threadPool.submit(() -> { + executorService.submit(() -> { //治理能力排行screen_govern_rank_data try { try { @@ -447,16 +435,6 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { } catch (Exception e) { log.error("党建引领抽取到大屏失败,参数为:" + JSON.toJSONString(formDTO), e); } - //已经挪到天抽取的抽取里了 - /* try { - //基层治理 - 热心市民 screen_party_user_rank_data - ScreenCentralZoneDataFormDTO param = new ScreenCentralZoneDataFormDTO(); - param.setCustomerId(customerId); - param.setDateId(monthId); - screenGrassrootsGovernDataAbsorptionService.userScoreDataHub(param); - } catch (Exception e) { - log.error("大屏热心市民/党员得分数据写入失败,参数为:{}" + JSON.toJSONString(formDTO), e); - }*/ try { // 项目(事件)数量分析按网格_按月统计 screenProjectQuantityGridMonthlyService.extractionProjectGridMonthly(customerId, monthId); diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java index 0d681d7368..8706317b90 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java @@ -17,7 +17,6 @@ package com.epmet.modules.topic.service.impl; -import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; @@ -25,8 +24,8 @@ import com.epmet.commons.rocketmq.messages.GroupAchievementMQMsg; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.MqConstant; import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; +import com.epmet.commons.tools.enums.AchievementTypeEnum; import com.epmet.commons.tools.enums.EventEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; @@ -37,19 +36,18 @@ import com.epmet.commons.tools.scan.result.AsyncScanTaskDTO; import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.scan.result.VoiceResultDTO; import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.commons.tools.utils.*; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.constant.SystemMessageType; import com.epmet.dto.form.CommonGridIdFormDTO; import com.epmet.dto.form.SystemMsgFormDTO; import com.epmet.dto.result.AllGridsByUserIdResultDTO; -import com.epmet.dto.result.UserInfoResultDTO; import com.epmet.dto.result.CommonDataFilterResultDTO; -import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.dto.result.UserInfoResultDTO; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; -import com.epmet.commons.tools.enums.AchievementTypeEnum; -import com.epmet.modules.feign.EpmetUserFeignClient; -import com.epmet.modules.group.dao.GroupMessageDao; import com.epmet.modules.feign.GovOrgFeignClient; import com.epmet.modules.group.dao.GroupMessageDao; import com.epmet.modules.group.dao.ResiGroupDao; @@ -58,7 +56,6 @@ import com.epmet.modules.group.entity.GroupMessageEntity; import com.epmet.modules.group.entity.ResiGroupEntity; import com.epmet.modules.group.entity.ResiGroupStatisticalEntity; import com.epmet.modules.group.redis.ResiGroupRedis; -import com.epmet.modules.member.dao.ResiGroupMemberDao; import com.epmet.modules.member.redis.ResiGroupMemberRedis; import com.epmet.modules.member.service.ResiGroupMemberService; import com.epmet.modules.topic.dao.ResiTopicAttachmentDao; @@ -84,7 +81,6 @@ import com.epmet.resi.group.dto.topic.result.MyAuditingListResultDTO; import com.epmet.resi.group.dto.topic.result.TopicAuditResultDTO; import com.epmet.send.SendMqMsgUtil; import com.google.common.base.CharMatcher; -import com.google.common.util.concurrent.ThreadFactoryBuilder; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -97,7 +93,6 @@ import org.springframework.transaction.annotation.Transactional; import java.text.SimpleDateFormat; import java.util.*; -import java.util.concurrent.*; import java.util.stream.Collectors; /** @@ -111,11 +106,6 @@ import java.util.stream.Collectors; public class TopicDraftServiceImpl extends BaseServiceImpl implements TopicDraftService { private static Logger logger = LoggerFactory.getLogger(TopicDraftServiceImpl.class); - private ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() - .setNameFormat("TopicDraftService-pool-%d").build(); - private ExecutorService threadPool = new ThreadPoolExecutor(1, 1, - 1L, TimeUnit.MINUTES, - new LinkedBlockingQueue<>(500), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy()); @Autowired private GovOrgOpenFeignClient govOrgOpenFeignClient; @Autowired @@ -125,12 +115,8 @@ public class TopicDraftServiceImpl extends BaseServiceImpl