From 745e93b4f9e1a66852946bb7c1396469734409b3 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 10 Dec 2020 10:17:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E3=80=81=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E4=BF=A1=E6=81=AF=E4=BF=9D=E5=AD=98=E8=87=AA?= =?UTF-8?q?=E6=B5=8B=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/feign/GovIssueOpenFeignClient.java | 4 +- .../IssueProjectCategoryDictServiceImpl.java | 8 +- .../result/ProjectCategoryDTOResultDTO.java | 55 +++++++++++ .../result/ProjectIssueCategoryResultDTO.java | 9 +- .../dto/result/ProjectIssueDTOResultDTO.java | 96 +++++++++++++++++++ .../impl/ProjectCategoryServiceImpl.java | 12 +-- 6 files changed, 170 insertions(+), 14 deletions(-) create mode 100644 epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectCategoryDTOResultDTO.java create mode 100644 epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectIssueDTOResultDTO.java diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java index f94291e5bb..eebeae517c 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java @@ -34,8 +34,8 @@ import java.util.Map; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:37 */ -@FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallback = GovIssueOpenFeignClientFallBack.class) -//@FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallback = GovIssueOpenFeignClientFallBack.class,url = "localhost:8101") +//@FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallback = GovIssueOpenFeignClientFallBack.class) +@FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallback = GovIssueOpenFeignClientFallBack.class,url = "localhost:8101") public interface GovIssueOpenFeignClient { /** diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java index 4c57777837..2197ae8143 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java @@ -32,7 +32,9 @@ import com.epmet.dto.form.CustomerCategoryListFormDTO; import com.epmet.dto.form.ProjectSaveCategoryFormDTO; import com.epmet.dto.form.SaveIssueCategoryFormDTO; import com.epmet.dto.result.CustomerCategoryListResultDTO; +import com.epmet.dto.result.ProjectCategoryDTOResultDTO; import com.epmet.dto.result.ProjectIssueCategoryResultDTO; +import com.epmet.dto.result.ProjectIssueDTOResultDTO; import com.epmet.entity.IssueProjectCategoryDictEntity; import com.epmet.redis.IssueProjectCategoryDictRedis; import com.epmet.service.IssueProjectCategoryDictService; @@ -149,14 +151,16 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl%s", formDTO.getProjectId())); } - //resultDTO.setIssueDTO(dto); + ProjectIssueDTOResultDTO issueDTO = ConvertUtils.sourceToTarget(dto,ProjectIssueDTOResultDTO.class); + resultDTO.setIssueDTO(issueDTO); //2.批量查询分类信息 List categoryIdList = formDTO.getCategoryList().stream().map(SaveIssueCategoryFormDTO::getId).collect(Collectors.toList()); List categoryList = getCategoryList(categoryIdList); if (null == categoryList) { throw new RenException(String.format("保存项目分类信息,根据分类Id获取分类信息失败")); } - // resultDTO.setCategoryList(categoryList); + List list = ConvertUtils.sourceToTarget(categoryList,ProjectCategoryDTOResultDTO.class); + resultDTO.setCategoryList(list); return resultDTO; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectCategoryDTOResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectCategoryDTOResultDTO.java new file mode 100644 index 0000000000..17a4e51c20 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectCategoryDTOResultDTO.java @@ -0,0 +1,55 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @dscription 项目所属网格、分类基本信息-接口返参 + * @author sun + */ +@Data +public class ProjectCategoryDTOResultDTO implements Serializable { + + private static final long serialVersionUID = 5957826616179876849L; + /** + * 主键 + */ + private String id; + + /** + * 客户id, 产品默认default + */ + private String customerId; + + /** + * 上级分类ID 顶级此列存储0 + */ + private String pid; + + /** + * 所有上级分类ID,用逗号分开 + */ + private String pids; + + /** + * 分类编码,分类编码+customer_id唯一 + */ + private String categoryCode; + + /** + * 分类名称 + */ + private String categoryName; + + /** + * 分类类别1,2,3,4.... + */ + private String categoryType; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectIssueCategoryResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectIssueCategoryResultDTO.java index 9aad1bb5a9..e035523fe7 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectIssueCategoryResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectIssueCategoryResultDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.result; import lombok.Data; import java.io.Serializable; +import java.util.List; /** * @dscription 项目所属网格、分类基本信息-接口返参 @@ -15,10 +16,10 @@ public class ProjectIssueCategoryResultDTO implements Serializable { /** * 项目Id */ - /*private IssueDTO issueDTO; - *//** + private ProjectIssueDTOResultDTO issueDTO; + /** * 项目标题 - *//* - private List categoryList;*/ + */ + private List categoryList; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectIssueDTOResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectIssueDTOResultDTO.java new file mode 100644 index 0000000000..0dd2698c4c --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectIssueDTOResultDTO.java @@ -0,0 +1,96 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @dscription 项目所属网格、分类基本信息-接口返参 + * @author sun + */ +@Data +public class ProjectIssueDTOResultDTO implements Serializable { + + private static final long serialVersionUID = 5957826616179876849L; + /** + * 议题ID + */ + private String id; + + /** + * 议题状态 表决中:voting 已转项目:shift_project 已关闭:closed + */ + private String issueStatus; + + /** + * 来源类型 eg:resi_topic + */ + private String sourceType; + + /** + * 来源ID eg:2223232(当SOURCE_TYPE为"resi_topic"时,这里指话题的ID) + */ + private String sourceId; + + /** + * 关闭理由 【未关闭时可以为空】关闭议题时必填的理由,转项目后而且已经结案,这个字段不回写 + */ + private String closeReason; + + /** + * 解决类型 【未关闭时可以为空】已解决resolved、未解决unresolved,对应在关闭议题时所选的checkbox,转项目后而且已经结案,这个字段不回写 + */ + private String resolveType; + + /** + * 议题名称 最多20字 + */ + private String issueTitle; + + /** + * 建议 最多1000字 + */ + private String suggestion; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID 居民端议题对应一个网格Id + */ + private String gridId; + + /** + * 所属机关 【数据权限-非必填】11:22:33(agencyId)数据权限控制 + */ + private String orgIdPath; + + /** + * 组织ID 【数据权限-非必填】agencyId + */ + private String orgId; + + /** + * 表决截止日期 + */ + private Date votingDeadline; + + /** + * 表决发起日期(转议题日期) + */ + private Date decidedTime; + + /** + * 转项目日期 (服务间调用日期一致性) + */ + private Date shiftedTime; + + /** + * 关闭日期 + */ + private Date closedTime; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectCategoryServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectCategoryServiceImpl.java index ca2febe86c..74ed9133ee 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectCategoryServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectCategoryServiceImpl.java @@ -31,8 +31,7 @@ import com.epmet.dao.ProjectTagsDao; import com.epmet.dto.ProjectCategoryDTO; import com.epmet.dto.form.ProjectCategoryTagListFormDTO; import com.epmet.dto.form.ProjectSaveCategoryFormDTO; -import com.epmet.dto.result.ProjectCategoryTagListResultDTO; -import com.epmet.dto.result.ProjectCategoryTagResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.ProjectCategoryEntity; import com.epmet.feign.GovIssueOpenFeignClient; import com.epmet.redis.ProjectCategoryRedis; @@ -42,6 +41,7 @@ import org.springframework.beans.factory.annotation.Autowired; 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; @@ -151,12 +151,12 @@ public class ProjectCategoryServiceImpl extends BaseServiceImpl result = govIssueOpenFeignClient.getProjectAndCategoryInfo(formDTO); + Result result = govIssueOpenFeignClient.getProjectAndCategoryInfo(formDTO); if (!result.success()) { throw new RenException(String.format("保存项目分类,获取项目对应的议题信息以及分类信息失败,projiectId->%s", formDTO.getProjectId())); } - IssueDTO issue = result.getData().getIssueDTO(); - List categoryList = result.getData().getCategoryList(); + ProjectIssueDTOResultDTO issue = result.getData().getIssueDTO(); + List categoryList = result.getData().getCategoryList(); //2.汇总批量新增数据 List entityList = new ArrayList<>(); @@ -180,7 +180,7 @@ public class ProjectCategoryServiceImpl extends BaseServiceImpl