diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/AuditListResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/AuditListResultDTO.java index 26a3ac0edd..5878ca9864 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/AuditListResultDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/AuditListResultDTO.java @@ -19,6 +19,8 @@ public class AuditListResultDTO implements Serializable { * 所属网格 */ private String gridName; + private String gridId; + private String orgId; /** * 议题标题 diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueApplicationDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueApplicationDao.java index a1d2c89468..4f2ede6325 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueApplicationDao.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueApplicationDao.java @@ -76,10 +76,28 @@ public interface IssueApplicationDao extends BaseDao { */ List selectTopicIdList(@Param("topicIdList") List topicIdList); + /** + * Desc: 待审核,驳回列表 + * @param formDTO + * @author zxc + * @date 2022/10/10 13:42 + */ List auditList(AuditListFormDTO formDTO); + /** + * Desc: 补全数据 + * @param + * @author zxc + * @date 2022/10/10 13:42 + */ List initIssueApplicationHistoryData(); + /** + * Desc: 批量更新议题审核组织信息 + * @param list + * @author zxc + * @date 2022/10/10 13:42 + */ void updateIssueApplication(List list); } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueApplicationServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueApplicationServiceImpl.java index 24806fd924..a37a1aad89 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueApplicationServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueApplicationServiceImpl.java @@ -22,9 +22,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.IssueApplicationDao; @@ -32,6 +34,7 @@ import com.epmet.dto.IssueApplicationDTO; import com.epmet.dto.form.AuditListFormDTO; import com.epmet.dto.form.IssueAppQueryFormDTO; import com.epmet.dto.form.UserPubAuditingIssueFormDTO; +import com.epmet.dto.result.AllIssueListResultDTO; import com.epmet.dto.result.AuditListResultDTO; import com.epmet.dto.result.IssueApplicationResDTO; import com.epmet.dto.result.UserPubAuditingIssueResDTO; @@ -46,11 +49,13 @@ import com.epmet.service.IssueApplicationService; import com.epmet.utils.ModuleConstants; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -62,6 +67,7 @@ import java.util.Map; * @since v1.0.0 2020-11-17 */ @Service +@Slf4j public class IssueApplicationServiceImpl extends BaseServiceImpl implements IssueApplicationService { @Override @@ -196,7 +202,34 @@ public class IssueApplicationServiceImpl extends BaseServiceImpl auditList(AuditListFormDTO formDTO) { - return null; + if (StringUtils.isBlank(formDTO.getOrgId())){ + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo){ + throw new EpmetException("查询工作人员信息失败:"+formDTO.getUserId()); + } + formDTO.setOrgId(staffInfo.getAgencyId()); + formDTO.setOrgType(ModuleConstants.ISSUE_PROCESS_ORG_TYPE_AGENCY); + } + PageData result = new PageData<>(new ArrayList(),NumConstant.ZERO_L); + if (formDTO.getIsPage()){ + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.auditList(formDTO)); + result.setList(pageInfo.getList()); + result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal()))); + }else { + List auditListResultDTOS = baseDao.auditList(formDTO); + result.setList(auditListResultDTOS); + result.setTotal(auditListResultDTOS.size()); + } + if (CollectionUtils.isNotEmpty(result.getList())){ + result.getList().forEach(l -> { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(l.getGridId()); + if(null == gridInfo){ + throw new EpmetException("查询网格信息失败:"+l.getGridId()); + } + l.setGridName(gridInfo.getGridNamePath()); + }); + } + return result; } @Override @@ -208,14 +241,15 @@ public class IssueApplicationServiceImpl extends BaseServiceImpl list = pageInfo.getList(); size = list.size(); if (CollectionUtils.isNotEmpty(list)){ - list.forEach(l -> { + for (IssueApplicationDTO l : list) { GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(l.getGridId()); if (null == gridInfo){ - throw new EpmetException("查询网格信息失败:"+l.getGridId()); + log.warn("查询网格信息失败:"+l.getGridId()); + continue; } l.setOrgId(gridInfo.getPid()); l.setOrgIdPath(gridInfo.getPids()); - }); + } updateIssueApplication(list); } no++; diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueApplicationDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueApplicationDao.xml index c205c2004f..64541d95c6 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueApplicationDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueApplicationDao.xml @@ -7,19 +7,19 @@ - when ID = #{i.ID} then #{orgId} + when ID = #{i.id} then #{i.orgId} - when ID = #{i.ID} then #{ORG_ID_PATH} + when ID = #{i.id} then #{i.orgIdPath} updated_time = now() where 1=1 - ID = #{i.ID} + ID = #{i.id} @@ -112,31 +112,34 @@