diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ResiEventAutoAuditTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ResiEventAutoAuditTask.java new file mode 100644 index 0000000000..1e56204d0f --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ResiEventAutoAuditTask.java @@ -0,0 +1,30 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.feign.GovProjectOpenFeignClient; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @author sun + * @dscription 事件语音附件自动审核任务,没两分钟执行一次 + */ +@Slf4j +@Component("resiEventAutoAuditTask") +public class ResiEventAutoAuditTask implements ITask { + + @Autowired + private GovProjectOpenFeignClient govProjectOpenFeignClient; + + @Override + public void run(String params) { + log.info("ResiEventAutoAuditTask定时任务正在执行,参数为:{}", params); + Result result = govProjectOpenFeignClient.autoAudit(); + if (result.success()) { + log.info("ResiEventAutoAuditTask定时任务执行成功"); + } else { + log.error("ResiEventAutoAuditTask定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CommonIssueListFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CommonIssueListFormDTO.java index 925551f55c..bebad0de3d 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CommonIssueListFormDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CommonIssueListFormDTO.java @@ -32,4 +32,6 @@ public class CommonIssueListFormDTO implements Serializable { * 每页多少条 * */ private Integer pageSize = 20; + + private Boolean isPage = true; } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index f433bd60ed..3cd89730da 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -587,9 +587,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp **/ @Override public List votingList(CommonIssueListFormDTO issueListForm) { - issueListForm.setPageNo(null == issueListForm.getPageNo() ? NumConstant.ZERO : - (issueListForm.getPageNo() - NumConstant.ONE)*issueListForm.getPageSize() - ); + PageHelper.startPage(issueListForm.getPageNo(), issueListForm.getPageSize(), issueListForm.getIsPage()); return baseDao.selectVotingList(issueListForm); } @@ -602,9 +600,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp **/ @Override public List closedList(CommonIssueListFormDTO issueListForm) { - issueListForm.setPageNo(null == issueListForm.getPageNo() ? NumConstant.ZERO : - (issueListForm.getPageNo() - NumConstant.ONE)*issueListForm.getPageSize() - ); + PageHelper.startPage(issueListForm.getPageNo(), issueListForm.getPageSize(), issueListForm.getIsPage()); return baseDao.selectClosedList(issueListForm); } @@ -1555,15 +1551,17 @@ public class IssueServiceImpl extends BaseServiceImpl imp } if (CollectionUtils.isNotEmpty(resultList)) { resultList = resultList.stream().sorted(Comparator.comparing(UnResolvedResultDTO::getClosedTime).reversed()).collect(Collectors.toList()); - int fromIndex = (fromDTO.getPageNo() - NumConstant.ONE) * fromDTO.getPageSize(); - int toIndex = fromDTO.getPageNo() * fromDTO.getPageSize(); - if (fromIndex >= resultList.size()) { - return new ArrayList<>(); - } - if (toIndex > resultList.size()) { - toIndex = resultList.size(); + if (fromDTO.getIsPage()) { + int fromIndex = (fromDTO.getPageNo() - NumConstant.ONE) * fromDTO.getPageSize(); + int toIndex = fromDTO.getPageNo() * fromDTO.getPageSize(); + if (fromIndex >= resultList.size()) { + return new ArrayList<>(); + } + if (toIndex > resultList.size()) { + toIndex = resultList.size(); + } + resultList = resultList.subList(fromIndex, toIndex); } - resultList = resultList.subList(fromIndex, toIndex); } return resultList; } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml index 55648edcad..5194cad10b 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml @@ -218,8 +218,6 @@ AND ISSUE_STATUS = 'voting' ORDER BY created_time DESC - LIMIT #{pageNo}, - #{pageSize} @@ -239,8 +237,6 @@ AND RESOLVE_TYPE = 'resolved' ORDER BY created_time DESC - LIMIT #{pageNo}, - #{pageSize}