diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueApplicationHistoryServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueApplicationHistoryServiceImpl.java index 7caa252331..ba8ce255f5 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueApplicationHistoryServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueApplicationHistoryServiceImpl.java @@ -26,6 +26,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.IssueApplicationHistoryDao; +import com.epmet.dto.IssueApplicationDTO; import com.epmet.dto.IssueApplicationHistoryDTO; import com.epmet.dto.form.ApplicationDetailWorkFormDTO; import com.epmet.dto.form.ApplicationHistoryWorkFormDTO; @@ -37,6 +38,7 @@ import com.epmet.resi.group.dto.group.form.ApplicationDetailFormDTO; import com.epmet.resi.group.dto.group.result.ApplicationDetailCopyResultDTO; import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; import com.epmet.service.IssueApplicationHistoryService; +import com.epmet.service.IssueApplicationService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -62,6 +64,8 @@ public class IssueApplicationHistoryServiceImpl extends BaseServiceImpl page(Map params) { @@ -136,6 +140,8 @@ public class IssueApplicationHistoryServiceImpl extends BaseServiceImpl result = resiGroupOpenFeignClient.applicationDetail(formDTO); if (!result.success()){ throw new RenException("工作端查询待审核||已驳回 申请详情失败......"); diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplicationDetailFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplicationDetailFormDTO.java index 8dcccb0eae..2d84f8cb13 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplicationDetailFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplicationDetailFormDTO.java @@ -21,4 +21,9 @@ public class ApplicationDetailFormDTO implements Serializable { */ @NotBlank(message = "issueApplicationId不能为空",groups = {ApplicationDetail.class}) private String issueApplicationId; + + /** + * 话题ID是否为空 + */ + private Boolean topicIdIsNull; } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/GroupIssueServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/GroupIssueServiceImpl.java index fa5e644cf3..7d2b5fe87c 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/GroupIssueServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/GroupIssueServiceImpl.java @@ -73,53 +73,41 @@ public class GroupIssueServiceImpl implements GroupIssueService { List userIds = new ArrayList<>(); ApplicationDetailResultDTO data = result.getData(); userIds.add(data.getUserId()); - TopicInfoResultDTO topicInfoResultDTO = resiGroupDao.selectTopicInfo(data.getTopicId()); - userIds.add(topicInfoResultDTO.getTopicUserId()); - // 查询小组类别 - ResiGroupEntity resiGroupEntity = resiGroupDao.selectById(topicInfoResultDTO.getGroupId()); - if (null == resiGroupEntity){ - throw new RenException("此小组信息不存在"); - } - List userInfos = resiTopicService.disPoseUserInfo(resiGroupEntity.getGroupType(), userIds); - if(CollectionUtils.isEmpty(userInfos)){ - throw new RenException("未查询到用户信息"); - } - userInfos.forEach(u -> { - if (u.getUserId().equals(data.getUserId())){ - data.setIssuePublisher(u.getReleaseUserName()); - data.setIssuePublisherMobile(u.getMobile()); + if (!applicationDetailFormDTO.getTopicIdIsNull()){ + TopicInfoResultDTO topicInfoResultDTO = resiGroupDao.selectTopicInfo(data.getTopicId()); + userIds.add(topicInfoResultDTO.getTopicUserId()); + // 查询小组类别 + ResiGroupEntity resiGroupEntity = resiGroupDao.selectById(topicInfoResultDTO.getGroupId()); + if (null == resiGroupEntity){ + throw new RenException("此小组信息不存在"); } - if (u.getUserId().equals(topicInfoResultDTO.getTopicUserId())){ - topicInfoResultDTO.setPublishedUser(u.getReleaseUserName()); - topicInfoResultDTO.setTopicPublishMobile(u.getMobile()); + List userInfos = resiTopicService.disPoseUserInfo(resiGroupEntity.getGroupType(), userIds); + if(CollectionUtils.isEmpty(userInfos)){ + throw new RenException("未查询到用户信息"); } - }); - /*Result> listResult = epmetUserOpenFeignClient.queryUserBaseInfo(userIds); - if (!listResult.success()){ - throw new RenException("查询话题创建者,议题创建者失败......"); - } - listResult.getData().forEach(user -> { - if (user.getUserId().equals(data.getUserId())){ - data.setIssuePublisher(user.getStreet().concat("-").concat(user.getSurname()).concat(getMrOrMs(user.getGender()))); - data.setIssuePublisherMobile(user.getMobile()); + userInfos.forEach(u -> { + if (u.getUserId().equals(data.getUserId())){ + data.setIssuePublisher(u.getReleaseUserName()); + data.setIssuePublisherMobile(u.getMobile()); + } + if (u.getUserId().equals(topicInfoResultDTO.getTopicUserId())){ + topicInfoResultDTO.setPublishedUser(u.getReleaseUserName()); + topicInfoResultDTO.setTopicPublishMobile(u.getMobile()); + } + }); + List gridIds = new ArrayList<>(); + gridIds.add(data.getGridId()); + Result> gridListByGridIds = govOrgOpenFeignClient.getGridListByGridIds(gridIds); + if (!gridListByGridIds.success()){ + throw new RenException("查询议题所属网格名称失败......"); } - if (user.getUserId().equals(topicInfoResultDTO.getTopicUserId())){ - topicInfoResultDTO.setPublishedUser(user.getStreet().concat("-").concat(user.getSurname()).concat(getMrOrMs(user.getGender()))); - topicInfoResultDTO.setTopicPublishMobile(user.getMobile()); - } - });*/ - List gridIds = new ArrayList<>(); - gridIds.add(data.getGridId()); - Result> gridListByGridIds = govOrgOpenFeignClient.getGridListByGridIds(gridIds); - if (!gridListByGridIds.success()){ - throw new RenException("查询议题所属网格名称失败......"); + gridListByGridIds.getData().forEach(grid -> { + if (grid.getGridId().equals(data.getGridId())){ + data.setGridName(grid.getGridName()); + } + }); + data.setTopicInfo(topicInfoResultDTO); } - gridListByGridIds.getData().forEach(grid -> { - if (grid.getGridId().equals(data.getGridId())){ - data.setGridName(grid.getGridName()); - } - }); - data.setTopicInfo(topicInfoResultDTO); return ConvertUtils.sourceToTarget(data,ApplicationDetailCopyResultDTO.class); }