diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueCategoryDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueCategoryDTO.java new file mode 100644 index 0000000000..12d645937a --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueCategoryDTO.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 议题所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Data +public class IssueCategoryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 网格ID: 议题所属网格Id + */ + private String gridId; + + /** + * 议题id + */ + private String issueId; + + /** + * 分类id + */ + private String categoryId; + + /** + * 分类对应的所有上级,英文逗号隔开 + */ + private String categoryPids; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueProjectCategoryDictDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueProjectCategoryDictDTO.java new file mode 100644 index 0000000000..d0df3169f5 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueProjectCategoryDictDTO.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 议题项目分类字典 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Data +public class IssueProjectCategoryDictDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + 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; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueProjectTagDictDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueProjectTagDictDTO.java new file mode 100644 index 0000000000..b13500e735 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueProjectTagDictDTO.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 议题、项目标签字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Data +public class IssueProjectTagDictDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 标签名称 + */ + private String tagName; + + /** + * 分类id, 用户自己添加的标签此列可为空 + */ + private String categoryId; + + /** + * 是否是默认标签(0:是 1:否) + */ + private String isDefault; + + /** + * 议题对标签的引用次数 + */ + private Integer issueUseCount; + + /** + * 项目对标签的引用次数 + */ + private Integer projectUseCount; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueTagsDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueTagsDTO.java new file mode 100644 index 0000000000..6ca1c51c6a --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueTagsDTO.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 议题关联标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Data +public class IssueTagsDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 议题所属网格id + */ + private String gridId; + + /** + * 议题ID + */ + private String issueId; + + /** + * 标签ID + */ + private String tagId; + + /** + * 标签名称 + */ + private String tagName; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CustomerCategoryListFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CustomerCategoryListFormDTO.java new file mode 100644 index 0000000000..39ae42441e --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CustomerCategoryListFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 分类列表查询-接口入参 + * @Author sun + */ +@Data +public class CustomerCategoryListFormDTO implements Serializable { + + private static final long serialVersionUID = 2599592072265715951L; + @NotBlank(message = "客户ID不能为空",groups = {CustomerCategoryListFormDTO.Category.class}) + private String customerId; + + public interface Category{} + + +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueCategoryTagListFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueCategoryTagListFormDTO.java new file mode 100644 index 0000000000..d9339a0e97 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueCategoryTagListFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 获取议题的分类、标签列表-接口入参 + * @Author sun + */ +@Data +public class IssueCategoryTagListFormDTO implements Serializable { + + private static final long serialVersionUID = 2599592072265715951L; + @NotBlank(message = "议题ID不能为空",groups = {ProjectCategoryTagListFormDTO.CategoryTag.class}) + private String issueId; + + public interface CategoryTag{} + +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueCategoryTagListResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueCategoryTagListResultDTO.java new file mode 100644 index 0000000000..cd78b59aaf --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueCategoryTagListResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Description 获取议题的分类、标签列表-接口返参 + * @Author sun + */ +@Data +public class IssueCategoryTagListResultDTO implements Serializable { + + private static final long serialVersionUID = 5957826616179876849L; + + /** + * 类别集合 + */ + private List categoryList = new ArrayList<>(); + /** + * 标签集合 + */ + private List tagList = new ArrayList<>(); + +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueCategoryTagResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueCategoryTagResultDTO.java new file mode 100644 index 0000000000..23ac6afece --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueCategoryTagResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 获取议题的分类、标签列表-接口返参 + * @Author sun + */ +@Data +public class IssueCategoryTagResultDTO implements Serializable { + + private static final long serialVersionUID = 5957826616179876849L; + + /** + * 分类或标签Id + */ + private String id; + /** + * 分类或标签名称 + */ + private String name; + +} 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 a974ae1109..fc1da4b290 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 @@ -2,8 +2,8 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.IssueDTO; import com.epmet.dto.IssueApplicationDTO; +import com.epmet.dto.IssueDTO; import com.epmet.dto.IssueSuggestionDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; @@ -209,4 +209,11 @@ public interface GovIssueOpenFeignClient { **/ @PostMapping(value = "/gov/issue/issueapplication/queryuserpubauditingissues") Result> queryUserPubAuditingIssues(@RequestBody UserPubAuditingIssueFormDTO fomrDTO); + + /** + * @description 调用issue库,查询分类Id对应的分类名称,按分类升序排列 + * @author sun + **/ + @PostMapping(value = "/gov/issue/issuecategory/projectcategorylist") + Result> projectCategoryList(@RequestBody List categoryIdList); } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java index ea59c6d349..5866034512 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java @@ -3,8 +3,8 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.IssueDTO; import com.epmet.dto.IssueApplicationDTO; +import com.epmet.dto.IssueDTO; import com.epmet.dto.IssueSuggestionDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; @@ -193,4 +193,13 @@ public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient public Result> queryUserPubAuditingIssues(UserPubAuditingIssueFormDTO fomrDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "queryUserPubAuditingIssues", fomrDTO); } + + /** + * @description 调用issue库,查询分类Id对应的分类名称,按分类升序排列 + * @author sun + **/ + @Override + public Result> projectCategoryList(List categoryIdList) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "projectCategoryList", categoryIdList); + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/GovIssueRedisKeys.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/GovIssueRedisKeys.java index 1da3dc7911..80635a483b 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/GovIssueRedisKeys.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/GovIssueRedisKeys.java @@ -18,5 +18,17 @@ public class GovIssueRedisKeys { public static String getWorkGrassrootsIssueRedDotKey(String gridId) { return rootPrefix.concat(String.format("gov:wxmp:work:grassroots:issue:%s",gridId)); } + + /** + * 议题项目标签key epmet:govern:customer:category:[customerId]:[categoryId] + * + * 自定义标签的categoryId统一为[customize] + * @param customerId + * @param categoryId + * @return + */ + public static String getGovernmentTagKey(String customerId,String categoryId){ + return rootPrefix.concat("govern:customer:category:").concat(customerId).concat(":").concat(categoryId); + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCategoryController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCategoryController.java new file mode 100644 index 0000000000..83aa6560d7 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCategoryController.java @@ -0,0 +1,120 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IssueCategoryDTO; +import com.epmet.dto.form.IssueCategoryTagListFormDTO; +import com.epmet.dto.result.IssueCategoryTagListResultDTO; +import com.epmet.dto.result.ProjectCategoryTagResultDTO; +import com.epmet.excel.IssueCategoryExcel; +import com.epmet.service.IssueCategoryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 议题所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@RestController +@RequestMapping("issuecategory") +public class IssueCategoryController { + + @Autowired + private IssueCategoryService issueCategoryService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = issueCategoryService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IssueCategoryDTO data = issueCategoryService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IssueCategoryDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + issueCategoryService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IssueCategoryDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + issueCategoryService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + issueCategoryService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = issueCategoryService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IssueCategoryExcel.class); + } + + /** + * @param formDTO + * @return + * @Description 获取议题的分类、标签列表 + * @Author sun + **/ + @PostMapping("categorytaglist") + public Result categoryTagList(@RequestBody IssueCategoryTagListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, IssueCategoryTagListFormDTO.CategoryTag.class); + return new Result().ok(issueCategoryService.categoryTagList(formDTO)); + } + + /** + * @param categoryIdList + * @return + * @Description 查询分类Id集合对应的分类名称,按分类升序排列 + * @Author sun + **/ + @PostMapping("projectcategorylist") + public Result> projectCategoryList(@RequestBody List categoryIdList) { + return new Result>().ok(issueCategoryService.projectCategoryList(categoryIdList)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java new file mode 100644 index 0000000000..87a31f658f --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java @@ -0,0 +1,110 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IssueProjectCategoryDictDTO; +import com.epmet.dto.form.CustomerCategoryListFormDTO; +import com.epmet.dto.form.IssueCategoryTagListFormDTO; +import com.epmet.dto.result.CustomerCategoryListResultDTO; +import com.epmet.dto.result.ProjectCategoryTagResultDTO; +import com.epmet.excel.IssueProjectCategoryDictExcel; +import com.epmet.service.IssueProjectCategoryDictService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 议题项目分类字典 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@RestController +@RequestMapping("issueprojectcategorydict") +public class IssueProjectCategoryDictController { + + @Autowired + private IssueProjectCategoryDictService issueProjectCategoryDictService; + + @GetMapping("page") + public Result> page(@RequestParam Map params) { + PageData page = issueProjectCategoryDictService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id) { + IssueProjectCategoryDictDTO data = issueProjectCategoryDictService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IssueProjectCategoryDictDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + issueProjectCategoryDictService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IssueProjectCategoryDictDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + issueProjectCategoryDictService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids) { + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + issueProjectCategoryDictService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = issueProjectCategoryDictService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IssueProjectCategoryDictExcel.class); + } + + /** + * @param formDTO + * @return + * @Description 客户分类列表查询,按分类升序排列 + * @Author sun + **/ + @PostMapping("list") + public Result> categoryList(@RequestBody CustomerCategoryListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, CustomerCategoryListFormDTO.Category.class); + return new Result>().ok(issueProjectCategoryDictService.categoryList(formDTO)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectTagDictController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectTagDictController.java new file mode 100644 index 0000000000..f4dbe2b03e --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectTagDictController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IssueProjectTagDictDTO; +import com.epmet.excel.IssueProjectTagDictExcel; +import com.epmet.service.IssueProjectTagDictService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 议题、项目标签字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@RestController +@RequestMapping("issueprojecttagdict") +public class IssueProjectTagDictController { + + @Autowired + private IssueProjectTagDictService issueProjectTagDictService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = issueProjectTagDictService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IssueProjectTagDictDTO data = issueProjectTagDictService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IssueProjectTagDictDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + issueProjectTagDictService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IssueProjectTagDictDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + issueProjectTagDictService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + issueProjectTagDictService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = issueProjectTagDictService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IssueProjectTagDictExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueTagsController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueTagsController.java new file mode 100644 index 0000000000..4be04baf85 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueTagsController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IssueTagsDTO; +import com.epmet.excel.IssueTagsExcel; +import com.epmet.service.IssueTagsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 议题关联标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@RestController +@RequestMapping("issuetags") +public class IssueTagsController { + + @Autowired + private IssueTagsService issueTagsService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = issueTagsService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IssueTagsDTO data = issueTagsService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IssueTagsDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + issueTagsService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IssueTagsDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + issueTagsService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + issueTagsService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = issueTagsService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IssueTagsExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueCategoryDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueCategoryDao.java new file mode 100644 index 0000000000..ad55b96802 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueCategoryDao.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.IssueCategoryTagResultDTO; +import com.epmet.dto.result.ProjectCategoryTagResultDTO; +import com.epmet.entity.IssueCategoryEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 议题所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Mapper +public interface IssueCategoryDao extends BaseDao { + + /** + * @Description 查询议题绑定的分类名称,按排序升序 + * @Author sun + **/ + List selectIssueCategoryList(@Param("issueId") String issueId); + + /** + * @param categoryIdList + * @return + * @Description 查询分类Id对应的分类名称,按分类升序排列 + * @Author sun + **/ + List selectProjectCategoryList(@Param("categoryIdList") List categoryIdList); +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectCategoryDictDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectCategoryDictDao.java new file mode 100644 index 0000000000..c3e44340e4 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectCategoryDictDao.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.CustomerCategoryListResultDTO; +import com.epmet.entity.IssueProjectCategoryDictEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 议题项目分类字典 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Mapper +public interface IssueProjectCategoryDictDao extends BaseDao { + + /** + * @Description 客户分类列表查询,按分类升序排列 + * @Author sun + **/ + List selectCustomerCategoryList(@Param("customerId") String customerId); + /** + * @Description 查询某个分类的下级分类 + * @Author sun + **/ + List subCategoryList(@Param("id") String categoryId); +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectTagDictDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectTagDictDao.java new file mode 100644 index 0000000000..7f2bd323dd --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectTagDictDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IssueProjectTagDictEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 议题、项目标签字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Mapper +public interface IssueProjectTagDictDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueTagsDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueTagsDao.java new file mode 100644 index 0000000000..e4c1e9e81d --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueTagsDao.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.IssueCategoryTagResultDTO; +import com.epmet.entity.IssueTagsEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 议题关联标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Mapper +public interface IssueTagsDao extends BaseDao { + + /** + * @Description 查询议题绑定的标签,按绑定时间升序 + * @Author sun + **/ + List selectIssueTagList(@Param("issueId") String issueId); +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueCategoryEntity.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueCategoryEntity.java new file mode 100644 index 0000000000..fa9e5b8d5b --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueCategoryEntity.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 议题所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("issue_category") +public class IssueCategoryEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 网格ID: 议题所属网格Id + */ + private String gridId; + + /** + * 议题id + */ + private String issueId; + + /** + * 分类id + */ + private String categoryId; + + /** + * 分类对应的所有上级,英文逗号隔开 + */ + private String categoryPids; + +} diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueProjectCategoryDictEntity.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueProjectCategoryDictEntity.java new file mode 100644 index 0000000000..74a2e32b29 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueProjectCategoryDictEntity.java @@ -0,0 +1,76 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 议题项目分类字典 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("issue_project_category_dict") +public class IssueProjectCategoryDictEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户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-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueProjectTagDictEntity.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueProjectTagDictEntity.java new file mode 100644 index 0000000000..c56d5974a7 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueProjectTagDictEntity.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 议题、项目标签字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("issue_project_tag_dict") +public class IssueProjectTagDictEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 标签名称 + */ + private String tagName; + + /** + * 分类id, 用户自己添加的标签此列可为空 + */ + private String categoryId; + + /** + * 是否是默认标签(0:是 1:否) + */ + private String isDefault; + + /** + * 议题对标签的引用次数 + */ + private Integer issueUseCount; + + /** + * 项目对标签的引用次数 + */ + private Integer projectUseCount; + +} diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueTagsEntity.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueTagsEntity.java new file mode 100644 index 0000000000..1dc56255fc --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueTagsEntity.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 议题关联标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("issue_tags") +public class IssueTagsEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 议题所属网格id + */ + private String gridId; + + /** + * 议题ID + */ + private String issueId; + + /** + * 标签ID + */ + private String tagId; + + /** + * 标签名称 + */ + private String tagName; + +} diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/IssueCategoryExcel.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/IssueCategoryExcel.java new file mode 100644 index 0000000000..1d74b3fe92 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/IssueCategoryExcel.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 议题所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Data +public class IssueCategoryExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "网格ID: 议题所属网格Id") + private String gridId; + + @Excel(name = "议题id") + private String issueId; + + @Excel(name = "分类id") + private String categoryId; + + @Excel(name = "分类对应的所有上级,英文逗号隔开") + private String categoryPids; + + @Excel(name = "删除标识 0未删除、1已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/IssueProjectCategoryDictExcel.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/IssueProjectCategoryDictExcel.java new file mode 100644 index 0000000000..4cef5ada59 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/IssueProjectCategoryDictExcel.java @@ -0,0 +1,77 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 议题项目分类字典 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Data +public class IssueProjectCategoryDictExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户id, 产品默认default") + private String customerId; + + @Excel(name = "上级分类ID 顶级此列存储0") + private String pid; + + @Excel(name = "所有上级分类ID,用逗号分开") + private String pids; + + @Excel(name = "分类编码,分类编码+customer_id唯一") + private String categoryCode; + + @Excel(name = "分类名称") + private String categoryName; + + @Excel(name = "分类类别1,2,3,4....") + private String categoryType; + + @Excel(name = "排序") + private Integer sort; + + @Excel(name = "删除标识 0未删除、1已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/IssueProjectTagDictExcel.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/IssueProjectTagDictExcel.java new file mode 100644 index 0000000000..26fee432bd --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/IssueProjectTagDictExcel.java @@ -0,0 +1,74 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 议题、项目标签字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Data +public class IssueProjectTagDictExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "标签名称") + private String tagName; + + @Excel(name = "分类id, 用户自己添加的标签此列可为空") + private String categoryId; + + @Excel(name = "是否是默认标签(0:是 1:否)") + private String isDefault; + + @Excel(name = "议题对标签的引用次数") + private Integer issueUseCount; + + @Excel(name = "项目对标签的引用次数") + private Integer projectUseCount; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/IssueTagsExcel.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/IssueTagsExcel.java new file mode 100644 index 0000000000..c790e5e6e2 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/IssueTagsExcel.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 议题关联标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Data +public class IssueTagsExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "议题所属网格id") + private String gridId; + + @Excel(name = "议题ID") + private String issueId; + + @Excel(name = "标签ID") + private String tagId; + + @Excel(name = "标签名称") + private String tagName; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueCategoryRedis.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueCategoryRedis.java new file mode 100644 index 0000000000..f05e1bac72 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueCategoryRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 议题所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Component +public class IssueCategoryRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueProjectCategoryDictRedis.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueProjectCategoryDictRedis.java new file mode 100644 index 0000000000..f4bfbe0967 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueProjectCategoryDictRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 议题项目分类字典 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Component +public class IssueProjectCategoryDictRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueProjectTagDictRedis.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueProjectTagDictRedis.java new file mode 100644 index 0000000000..662b85402c --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueProjectTagDictRedis.java @@ -0,0 +1,74 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.dto.result.IssueCategoryTagResultDTO; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 议题、项目标签字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Component +@Slf4j +public class IssueProjectTagDictRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + + /** + * @Description 传入category列表,返回对应category下的标签,按热度排序 + * category列表为空则查询客户下全部 + * 如果想要自定义标签,单独请求一次,分类列表中只含"customize" + * + * @param customerId + * @param category + * @return java.util.List + * @author wangc + * @date 2020.12.09 11:16 + */ + public List getTagsOrderByRank(String customerId,List category){ + if(StringUtils.isBlank(customerId)) { + log.error("customerId can not be null when obtain govern tags cache"); + return null; + } + + + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueTagsRedis.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueTagsRedis.java new file mode 100644 index 0000000000..3219ea7b57 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueTagsRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 议题关联标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Component +public class IssueTagsRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueCategoryService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueCategoryService.java new file mode 100644 index 0000000000..6a3324c908 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueCategoryService.java @@ -0,0 +1,114 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IssueCategoryDTO; +import com.epmet.dto.form.IssueCategoryTagListFormDTO; +import com.epmet.dto.result.IssueCategoryTagListResultDTO; +import com.epmet.dto.result.ProjectCategoryTagResultDTO; +import com.epmet.entity.IssueCategoryEntity; + +import java.util.List; +import java.util.Map; + +/** + * 议题所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +public interface IssueCategoryService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-12-08 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-12-08 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IssueCategoryDTO + * @author generator + * @date 2020-12-08 + */ + IssueCategoryDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-08 + */ + void save(IssueCategoryDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-08 + */ + void update(IssueCategoryDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-12-08 + */ + void delete(String[] ids); + + /** + * @param formDTO + * @return + * @Description 获取议题的分类、标签列表 + * @Author sun + **/ + IssueCategoryTagListResultDTO categoryTagList(IssueCategoryTagListFormDTO formDTO); + + /** + * @param categoryIdList + * @return + * @Description 查询分类Id集合对应的分类名称,按分类升序排列 + * @Author sun + **/ + List projectCategoryList(List categoryIdList); +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java new file mode 100644 index 0000000000..41a807cd40 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IssueProjectCategoryDictDTO; +import com.epmet.dto.form.CustomerCategoryListFormDTO; +import com.epmet.dto.result.CustomerCategoryListResultDTO; +import com.epmet.entity.IssueProjectCategoryDictEntity; + +import java.util.List; +import java.util.Map; + +/** + * 议题项目分类字典 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +public interface IssueProjectCategoryDictService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-12-08 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-12-08 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IssueProjectCategoryDictDTO + * @author generator + * @date 2020-12-08 + */ + IssueProjectCategoryDictDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-08 + */ + void save(IssueProjectCategoryDictDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-08 + */ + void update(IssueProjectCategoryDictDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-12-08 + */ + void delete(String[] ids); + + /** + * @param formDTO + * @return + * @Description 客户分类列表查询,按分类升序排列 + * @Author sun + **/ + List categoryList(CustomerCategoryListFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectTagDictService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectTagDictService.java new file mode 100644 index 0000000000..46521d6bbb --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectTagDictService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IssueProjectTagDictDTO; +import com.epmet.entity.IssueProjectTagDictEntity; + +import java.util.List; +import java.util.Map; + +/** + * 议题、项目标签字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +public interface IssueProjectTagDictService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-12-08 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-12-08 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IssueProjectTagDictDTO + * @author generator + * @date 2020-12-08 + */ + IssueProjectTagDictDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-08 + */ + void save(IssueProjectTagDictDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-08 + */ + void update(IssueProjectTagDictDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-12-08 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueTagsService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueTagsService.java new file mode 100644 index 0000000000..b4e37ae7c0 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueTagsService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IssueTagsDTO; +import com.epmet.entity.IssueTagsEntity; + +import java.util.List; +import java.util.Map; + +/** + * 议题关联标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +public interface IssueTagsService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-12-08 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-12-08 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IssueTagsDTO + * @author generator + * @date 2020-12-08 + */ + IssueTagsDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-08 + */ + void save(IssueTagsDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-08 + */ + void update(IssueTagsDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-12-08 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueCategoryServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueCategoryServiceImpl.java new file mode 100644 index 0000000000..82405538d6 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueCategoryServiceImpl.java @@ -0,0 +1,145 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IssueCategoryDao; +import com.epmet.dao.IssueTagsDao; +import com.epmet.dto.IssueCategoryDTO; +import com.epmet.dto.form.IssueCategoryTagListFormDTO; +import com.epmet.dto.result.IssueCategoryTagListResultDTO; +import com.epmet.dto.result.IssueCategoryTagResultDTO; +import com.epmet.dto.result.ProjectCategoryTagResultDTO; +import com.epmet.entity.IssueCategoryEntity; +import com.epmet.redis.IssueCategoryRedis; +import com.epmet.service.IssueCategoryService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 议题所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Service +public class IssueCategoryServiceImpl extends BaseServiceImpl implements IssueCategoryService { + + @Autowired + private IssueCategoryRedis issueCategoryRedis; + @Autowired + private IssueTagsDao issueTagsDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IssueCategoryDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IssueCategoryDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IssueCategoryDTO get(String id) { + IssueCategoryEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IssueCategoryDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IssueCategoryDTO dto) { + IssueCategoryEntity entity = ConvertUtils.sourceToTarget(dto, IssueCategoryEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IssueCategoryDTO dto) { + IssueCategoryEntity entity = ConvertUtils.sourceToTarget(dto, IssueCategoryEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param formDTO + * @return + * @Description 获取议题的分类、标签列表 + * @Author sun + **/ + @Override + public IssueCategoryTagListResultDTO categoryTagList(IssueCategoryTagListFormDTO formDTO) { + IssueCategoryTagListResultDTO resultDTO = new IssueCategoryTagListResultDTO(); + //1.查询议题绑定的分类名称,按排序升序 + List categoryList = baseDao.selectIssueCategoryList(formDTO.getIssueId()); + if (categoryList.size() > NumConstant.ZERO) { + resultDTO.setCategoryList(categoryList); + } + //2.查询议题绑定的标签,按绑定时间升序 + List tagList = issueTagsDao.selectIssueTagList(formDTO.getIssueId()); + if (tagList.size() > NumConstant.ZERO) { + resultDTO.setTagList(tagList); + } + return resultDTO; + } + + /** + * @param categoryIdList + * @return + * @Description 查询分类Id集合对应的分类名称,按分类升序排列 + * @Author sun + **/ + @Override + public List projectCategoryList(List categoryIdList) { + return baseDao.selectProjectCategoryList(categoryIdList); + } + +} \ No newline at end of file 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 new file mode 100644 index 0000000000..3aa823b8d3 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java @@ -0,0 +1,118 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IssueProjectCategoryDictDao; +import com.epmet.dto.IssueProjectCategoryDictDTO; +import com.epmet.dto.form.CustomerCategoryListFormDTO; +import com.epmet.dto.result.CustomerCategoryListResultDTO; +import com.epmet.entity.IssueProjectCategoryDictEntity; +import com.epmet.redis.IssueProjectCategoryDictRedis; +import com.epmet.service.IssueProjectCategoryDictService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 议题项目分类字典 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Service +public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl implements IssueProjectCategoryDictService { + + @Autowired + private IssueProjectCategoryDictRedis issueProjectCategoryDictRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IssueProjectCategoryDictDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IssueProjectCategoryDictDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IssueProjectCategoryDictDTO get(String id) { + IssueProjectCategoryDictEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IssueProjectCategoryDictDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IssueProjectCategoryDictDTO dto) { + IssueProjectCategoryDictEntity entity = ConvertUtils.sourceToTarget(dto, IssueProjectCategoryDictEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IssueProjectCategoryDictDTO dto) { + IssueProjectCategoryDictEntity entity = ConvertUtils.sourceToTarget(dto, IssueProjectCategoryDictEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param formDTO + * @return + * @Description 客户分类列表查询,按分类升序排列 + * @Author sun + **/ + @Override + public List categoryList(CustomerCategoryListFormDTO formDTO) { + List resultList = baseDao.selectCustomerCategoryList(formDTO.getCustomerId()); + return resultList; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectTagDictServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectTagDictServiceImpl.java new file mode 100644 index 0000000000..2250587ec3 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectTagDictServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IssueProjectTagDictDao; +import com.epmet.dto.IssueProjectTagDictDTO; +import com.epmet.entity.IssueProjectTagDictEntity; +import com.epmet.redis.IssueProjectTagDictRedis; +import com.epmet.service.IssueProjectTagDictService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 议题、项目标签字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Service +public class IssueProjectTagDictServiceImpl extends BaseServiceImpl implements IssueProjectTagDictService { + + @Autowired + private IssueProjectTagDictRedis issueProjectTagDictRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IssueProjectTagDictDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IssueProjectTagDictDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IssueProjectTagDictDTO get(String id) { + IssueProjectTagDictEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IssueProjectTagDictDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IssueProjectTagDictDTO dto) { + IssueProjectTagDictEntity entity = ConvertUtils.sourceToTarget(dto, IssueProjectTagDictEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IssueProjectTagDictDTO dto) { + IssueProjectTagDictEntity entity = ConvertUtils.sourceToTarget(dto, IssueProjectTagDictEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueTagsServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueTagsServiceImpl.java new file mode 100644 index 0000000000..6a9002cd7c --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueTagsServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IssueTagsDao; +import com.epmet.dto.IssueTagsDTO; +import com.epmet.entity.IssueTagsEntity; +import com.epmet.redis.IssueTagsRedis; +import com.epmet.service.IssueTagsService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 议题关联标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Service +public class IssueTagsServiceImpl extends BaseServiceImpl implements IssueTagsService { + + @Autowired + private IssueTagsRedis issueTagsRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IssueTagsDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IssueTagsDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IssueTagsDTO get(String id) { + IssueTagsEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IssueTagsDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IssueTagsDTO dto) { + IssueTagsEntity entity = ConvertUtils.sourceToTarget(dto, IssueTagsEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IssueTagsDTO dto) { + IssueTagsEntity entity = ConvertUtils.sourceToTarget(dto, IssueTagsEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueCategoryDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueCategoryDao.xml new file mode 100644 index 0000000000..875e1c755b --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueCategoryDao.xml @@ -0,0 +1,38 @@ + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml new file mode 100644 index 0000000000..e638fec0b8 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectTagDictDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectTagDictDao.xml new file mode 100644 index 0000000000..24ce93f310 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectTagDictDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueTagsDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueTagsDao.xml new file mode 100644 index 0000000000..9e15021e6d --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueTagsDao.xml @@ -0,0 +1,19 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectCategoryDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectCategoryDTO.java new file mode 100644 index 0000000000..4c7b39c7d6 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectCategoryDTO.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 项目所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Data +public class ProjectCategoryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 来源网格id + */ + private String gridId; + + /** + * 项目id + */ + private String projectId; + + /** + * 分类id + */ + private String categoryId; + + /** + * 分类对应的所有上级,英文逗号隔开 + */ + private String categoryPids; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectTagsDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectTagsDTO.java new file mode 100644 index 0000000000..1cc47c4bb6 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectTagsDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 项目关联标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Data +public class ProjectTagsDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 项目ID + */ + private String projectId; + + /** + * 标签ID + */ + private String tagId; + + /** + * 标签名称 + */ + private String tagName; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectCategoryTagListFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectCategoryTagListFormDTO.java new file mode 100644 index 0000000000..9c179732ac --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectCategoryTagListFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 获取议题的分类、标签列表-接口入参 + * @Author sun + */ +@Data +public class ProjectCategoryTagListFormDTO implements Serializable { + + private static final long serialVersionUID = 2599592072265715951L; + @NotBlank(message = "议题ID不能为空",groups = {ProjectCategoryTagListFormDTO.CategoryTag.class}) + private String projectId; + + public interface CategoryTag{} + + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CustomerCategoryListResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CustomerCategoryListResultDTO.java new file mode 100644 index 0000000000..2ae7331706 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CustomerCategoryListResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 获取议题的分类、标签列表-接口返参 + * @Author sun + */ +@Data +public class CustomerCategoryListResultDTO implements Serializable { + + private static final long serialVersionUID = 5957826616179876849L; + + /** + * 分类Id + */ + private String id; + /** + * 分类名称 + */ + private String name; + + /** + * 子级分类对象 + */ + private List subCategory; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectCategoryTagListResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectCategoryTagListResultDTO.java new file mode 100644 index 0000000000..43b33a74bf --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectCategoryTagListResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Description 获取议题的分类、标签列表-接口返参 + * @Author sun + */ +@Data +public class ProjectCategoryTagListResultDTO implements Serializable { + + private static final long serialVersionUID = 5957826616179876849L; + + /** + * 类别集合 + */ + private List categoryList = new ArrayList<>(); + /** + * 标签集合 + */ + private List tagList = new ArrayList<>(); + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectCategoryTagResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectCategoryTagResultDTO.java new file mode 100644 index 0000000000..375bc1a898 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectCategoryTagResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 获取议题的分类、标签列表-接口返参 + * @Author sun + */ +@Data +public class ProjectCategoryTagResultDTO implements Serializable { + + private static final long serialVersionUID = 5957826616179876849L; + + /** + * 分类或标签Id + */ + private String id; + /** + * 分类或标签名称 + */ + private String name; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectCategoryController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectCategoryController.java new file mode 100644 index 0000000000..c773ece4f9 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectCategoryController.java @@ -0,0 +1,108 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.ProjectCategoryDTO; +import com.epmet.dto.form.ProjectCategoryTagListFormDTO; +import com.epmet.dto.result.ProjectCategoryTagListResultDTO; +import com.epmet.excel.ProjectCategoryExcel; +import com.epmet.service.ProjectCategoryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 项目所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@RestController +@RequestMapping("projectcategory") +public class ProjectCategoryController { + + @Autowired + private ProjectCategoryService projectCategoryService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = projectCategoryService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ProjectCategoryDTO data = projectCategoryService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ProjectCategoryDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + projectCategoryService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ProjectCategoryDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + projectCategoryService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + projectCategoryService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = projectCategoryService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ProjectCategoryExcel.class); + } + + /** + * @param formDTO + * @return + * @Description 获取项目的分类、标签列表 + * @Author sun + **/ + @PostMapping("categorytaglist") + public Result categoryTagList(@RequestBody ProjectCategoryTagListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ProjectCategoryTagListFormDTO.CategoryTag.class); + return new Result().ok(projectCategoryService.categoryTagList(formDTO)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTagsController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTagsController.java new file mode 100644 index 0000000000..01ab68f1b9 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTagsController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.ProjectTagsDTO; +import com.epmet.excel.ProjectTagsExcel; +import com.epmet.service.ProjectTagsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 项目关联标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@RestController +@RequestMapping("projecttags") +public class ProjectTagsController { + + @Autowired + private ProjectTagsService projectTagsService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = projectTagsService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ProjectTagsDTO data = projectTagsService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ProjectTagsDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + projectTagsService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ProjectTagsDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + projectTagsService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + projectTagsService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = projectTagsService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ProjectTagsExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectCategoryDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectCategoryDao.java new file mode 100644 index 0000000000..ac041659f7 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectCategoryDao.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ProjectCategoryEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 项目所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Mapper +public interface ProjectCategoryDao extends BaseDao { + + /** + * @Description 查询项目绑定的分类Id集合 + * @Author sun + **/ + List selectProjectCategoryIdList(@Param("projectId") String projectId); + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectTagsDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectTagsDao.java new file mode 100644 index 0000000000..da5b1d39c9 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectTagsDao.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.ProjectCategoryTagResultDTO; +import com.epmet.entity.ProjectTagsEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 项目关联标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Mapper +public interface ProjectTagsDao extends BaseDao { + + /** + * @Description 查询项目绑定的标签,按绑定时间升序 + * @Author sun + **/ + List selectProjectTagList(@Param("projectId") String projectId); +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectCategoryEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectCategoryEntity.java new file mode 100644 index 0000000000..ce718cc201 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectCategoryEntity.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 项目所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("project_category") +public class ProjectCategoryEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 来源网格id + */ + private String gridId; + + /** + * 项目id + */ + private String projectId; + + /** + * 分类id + */ + private String categoryId; + + /** + * 分类对应的所有上级,英文逗号隔开 + */ + private String categoryPids; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectTagsEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectTagsEntity.java new file mode 100644 index 0000000000..12febddfea --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectTagsEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 项目关联标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("project_tags") +public class ProjectTagsEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 项目ID + */ + private String projectId; + + /** + * 标签ID + */ + private String tagId; + + /** + * 标签名称 + */ + private String tagName; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectCategoryExcel.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectCategoryExcel.java new file mode 100644 index 0000000000..515c2ddf7e --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectCategoryExcel.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 项目所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Data +public class ProjectCategoryExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "来源网格id") + private String gridId; + + @Excel(name = "项目id") + private String projectId; + + @Excel(name = "分类id") + private String categoryId; + + @Excel(name = "分类对应的所有上级,英文逗号隔开") + private String categoryPids; + + @Excel(name = "删除标识 0未删除、1已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectTagsExcel.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectTagsExcel.java new file mode 100644 index 0000000000..e923b47d6c --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectTagsExcel.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 项目关联标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Data +public class ProjectTagsExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "项目ID") + private String projectId; + + @Excel(name = "标签ID") + private String tagId; + + @Excel(name = "标签名称") + private String tagName; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/redis/ProjectCategoryRedis.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/redis/ProjectCategoryRedis.java new file mode 100644 index 0000000000..cdf23a7a26 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/redis/ProjectCategoryRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 项目所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Component +public class ProjectCategoryRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/redis/ProjectTagsRedis.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/redis/ProjectTagsRedis.java new file mode 100644 index 0000000000..08f8b14e55 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/redis/ProjectTagsRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 项目关联标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Component +public class ProjectTagsRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectCategoryService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectCategoryService.java new file mode 100644 index 0000000000..e31a951784 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectCategoryService.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ProjectCategoryDTO; +import com.epmet.dto.form.ProjectCategoryTagListFormDTO; +import com.epmet.dto.result.ProjectCategoryTagListResultDTO; +import com.epmet.entity.ProjectCategoryEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +public interface ProjectCategoryService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-12-08 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-12-08 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ProjectCategoryDTO + * @author generator + * @date 2020-12-08 + */ + ProjectCategoryDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-08 + */ + void save(ProjectCategoryDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-08 + */ + void update(ProjectCategoryDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-12-08 + */ + void delete(String[] ids); + + /** + * @param formDTO + * @return + * @Description 获取项目的分类、标签列表 + * @Author sun + **/ + ProjectCategoryTagListResultDTO categoryTagList(ProjectCategoryTagListFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTagsService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTagsService.java new file mode 100644 index 0000000000..d281c2100e --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTagsService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ProjectTagsDTO; +import com.epmet.entity.ProjectTagsEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目关联标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +public interface ProjectTagsService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-12-08 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-12-08 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ProjectTagsDTO + * @author generator + * @date 2020-12-08 + */ + ProjectTagsDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-08 + */ + void save(ProjectTagsDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-08 + */ + void update(ProjectTagsDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-12-08 + */ + void delete(String[] ids); +} \ No newline at end of file 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 new file mode 100644 index 0000000000..315aa7fd59 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectCategoryServiceImpl.java @@ -0,0 +1,144 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +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.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +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.ProjectCategoryDao; +import com.epmet.dao.ProjectTagsDao; +import com.epmet.dto.ProjectCategoryDTO; +import com.epmet.dto.form.ProjectCategoryTagListFormDTO; +import com.epmet.dto.result.ProjectCategoryTagListResultDTO; +import com.epmet.dto.result.ProjectCategoryTagResultDTO; +import com.epmet.entity.ProjectCategoryEntity; +import com.epmet.feign.GovIssueOpenFeignClient; +import com.epmet.redis.ProjectCategoryRedis; +import com.epmet.service.ProjectCategoryService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 项目所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Service +public class ProjectCategoryServiceImpl extends BaseServiceImpl implements ProjectCategoryService { + + @Autowired + private ProjectCategoryRedis projectCategoryRedis; + @Autowired + private ProjectTagsDao projectTagsDao; + @Autowired + private GovIssueOpenFeignClient govIssueOpenFeignClient; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ProjectCategoryDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ProjectCategoryDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ProjectCategoryDTO get(String id) { + ProjectCategoryEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ProjectCategoryDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ProjectCategoryDTO dto) { + ProjectCategoryEntity entity = ConvertUtils.sourceToTarget(dto, ProjectCategoryEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ProjectCategoryDTO dto) { + ProjectCategoryEntity entity = ConvertUtils.sourceToTarget(dto, ProjectCategoryEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param formDTO + * @return + * @Description 获取项目的分类、标签列表 + * @Author sun + **/ + @Override + public ProjectCategoryTagListResultDTO categoryTagList(ProjectCategoryTagListFormDTO formDTO) { + ProjectCategoryTagListResultDTO resultDTO = new ProjectCategoryTagListResultDTO(); + //1.查询项目绑定的分类名称,按排序升序 + List categoryIdList = baseDao.selectProjectCategoryIdList(formDTO.getProjectId()); + if (categoryIdList.size() > NumConstant.ZERO) { + //1-1.调用issue库,查询分类Id对应的分类名称,按分类升序排列 + Result> result = govIssueOpenFeignClient.projectCategoryList(categoryIdList); + if (!result.success()) { + throw new RenException(result.getInternalMsg()); + } + resultDTO.setCategoryList(result.getData()); + } + //2.查询项目绑定的标签,按绑定时间升序 + List tagList = projectTagsDao.selectProjectTagList(formDTO.getProjectId()); + if (tagList.size() > NumConstant.ZERO) { + resultDTO.setTagList(tagList); + } + return resultDTO; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTagsServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTagsServiceImpl.java new file mode 100644 index 0000000000..4d4f135b6e --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTagsServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ProjectTagsDao; +import com.epmet.dto.ProjectTagsDTO; +import com.epmet.entity.ProjectTagsEntity; +import com.epmet.redis.ProjectTagsRedis; +import com.epmet.service.ProjectTagsService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 项目关联标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Service +public class ProjectTagsServiceImpl extends BaseServiceImpl implements ProjectTagsService { + + @Autowired + private ProjectTagsRedis projectTagsRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ProjectTagsDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ProjectTagsDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ProjectTagsDTO get(String id) { + ProjectTagsEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ProjectTagsDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ProjectTagsDTO dto) { + ProjectTagsEntity entity = ConvertUtils.sourceToTarget(dto, ProjectTagsEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ProjectTagsDTO dto) { + ProjectTagsEntity entity = ConvertUtils.sourceToTarget(dto, ProjectTagsEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectCategoryDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectCategoryDao.xml new file mode 100644 index 0000000000..da4a2d332e --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectCategoryDao.xml @@ -0,0 +1,16 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectTagsDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectTagsDao.xml new file mode 100644 index 0000000000..0936bcc4d4 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectTagsDao.xml @@ -0,0 +1,19 @@ + + + + + + + + \ No newline at end of file