From 98463b39a29d509961c650aa018ada22c6c6368a Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 8 Dec 2020 14:12:27 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E3=80=81=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E5=88=86=E7=B1=BB=E3=80=81=E6=A0=87=E7=AD=BE=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/IssueCategoryDTO.java | 96 ++++++++++++++++ .../dto/IssueProjectCategoryDictDTO.java | 106 ++++++++++++++++++ .../com/epmet/dto/IssueProjectTagDictDTO.java | 96 ++++++++++++++++ .../main/java/com/epmet/dto/IssueTagsDTO.java | 96 ++++++++++++++++ .../controller/IssueCategoryController.java | 94 ++++++++++++++++ .../IssueProjectCategoryDictController.java | 94 ++++++++++++++++ .../IssueProjectTagDictController.java | 94 ++++++++++++++++ .../epmet/controller/IssueTagsController.java | 94 ++++++++++++++++ .../java/com/epmet/dao/IssueCategoryDao.java | 33 ++++++ .../dao/IssueProjectCategoryDictDao.java | 33 ++++++ .../com/epmet/dao/IssueProjectTagDictDao.java | 33 ++++++ .../main/java/com/epmet/dao/IssueTagsDao.java | 33 ++++++ .../com/epmet/entity/IssueCategoryEntity.java | 66 +++++++++++ .../IssueProjectCategoryDictEntity.java | 76 +++++++++++++ .../entity/IssueProjectTagDictEntity.java | 66 +++++++++++ .../com/epmet/entity/IssueTagsEntity.java | 66 +++++++++++ .../com/epmet/excel/IssueCategoryExcel.java | 71 ++++++++++++ .../excel/IssueProjectCategoryDictExcel.java | 77 +++++++++++++ .../epmet/excel/IssueProjectTagDictExcel.java | 71 ++++++++++++ .../java/com/epmet/excel/IssueTagsExcel.java | 71 ++++++++++++ .../com/epmet/redis/IssueCategoryRedis.java | 47 ++++++++ .../redis/IssueProjectCategoryDictRedis.java | 47 ++++++++ .../epmet/redis/IssueProjectTagDictRedis.java | 47 ++++++++ .../java/com/epmet/redis/IssueTagsRedis.java | 47 ++++++++ .../epmet/service/IssueCategoryService.java | 95 ++++++++++++++++ .../IssueProjectCategoryDictService.java | 95 ++++++++++++++++ .../service/IssueProjectTagDictService.java | 95 ++++++++++++++++ .../com/epmet/service/IssueTagsService.java | 95 ++++++++++++++++ .../impl/IssueCategoryServiceImpl.java | 104 +++++++++++++++++ .../IssueProjectCategoryDictServiceImpl.java | 104 +++++++++++++++++ .../impl/IssueProjectTagDictServiceImpl.java | 104 +++++++++++++++++ .../service/impl/IssueTagsServiceImpl.java | 104 +++++++++++++++++ .../resources/mapper/IssueCategoryDao.xml | 8 ++ .../mapper/IssueProjectCategoryDictDao.xml | 8 ++ .../mapper/IssueProjectTagDictDao.xml | 8 ++ .../main/resources/mapper/IssueTagsDao.xml | 8 ++ .../com/epmet/dto/ProjectCategoryDTO.java | 96 ++++++++++++++++ .../java/com/epmet/dto/ProjectTagsDTO.java | 91 +++++++++++++++ .../controller/ProjectCategoryController.java | 94 ++++++++++++++++ .../controller/ProjectTagsController.java | 94 ++++++++++++++++ .../com/epmet/dao/ProjectCategoryDao.java | 33 ++++++ .../java/com/epmet/dao/ProjectTagsDao.java | 33 ++++++ .../epmet/entity/ProjectCategoryEntity.java | 66 +++++++++++ .../com/epmet/entity/ProjectTagsEntity.java | 61 ++++++++++ .../com/epmet/excel/ProjectCategoryExcel.java | 71 ++++++++++++ .../com/epmet/excel/ProjectTagsExcel.java | 68 +++++++++++ .../com/epmet/redis/ProjectCategoryRedis.java | 47 ++++++++ .../com/epmet/redis/ProjectTagsRedis.java | 47 ++++++++ .../epmet/service/ProjectCategoryService.java | 95 ++++++++++++++++ .../com/epmet/service/ProjectTagsService.java | 95 ++++++++++++++++ .../impl/ProjectCategoryServiceImpl.java | 104 +++++++++++++++++ .../service/impl/ProjectTagsServiceImpl.java | 104 +++++++++++++++++ .../resources/mapper/ProjectCategoryDao.xml | 8 ++ .../main/resources/mapper/ProjectTagsDao.xml | 8 ++ 54 files changed, 3697 insertions(+) create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueCategoryDTO.java create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueProjectCategoryDictDTO.java create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueProjectTagDictDTO.java create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueTagsDTO.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCategoryController.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectTagDictController.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueTagsController.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueCategoryDao.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectCategoryDictDao.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectTagDictDao.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueTagsDao.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueCategoryEntity.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueProjectCategoryDictEntity.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueProjectTagDictEntity.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueTagsEntity.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/IssueCategoryExcel.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/IssueProjectCategoryDictExcel.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/IssueProjectTagDictExcel.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/IssueTagsExcel.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueCategoryRedis.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueProjectCategoryDictRedis.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueProjectTagDictRedis.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueTagsRedis.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueCategoryService.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectTagDictService.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueTagsService.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueCategoryServiceImpl.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectTagDictServiceImpl.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueTagsServiceImpl.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueCategoryDao.xml create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectTagDictDao.xml create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueTagsDao.xml create mode 100644 epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectCategoryDTO.java create mode 100644 epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectTagsDTO.java create mode 100644 epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectCategoryController.java create mode 100644 epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTagsController.java create mode 100644 epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectCategoryDao.java create mode 100644 epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectTagsDao.java create mode 100644 epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectCategoryEntity.java create mode 100644 epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectTagsEntity.java create mode 100644 epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectCategoryExcel.java create mode 100644 epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectTagsExcel.java create mode 100644 epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/redis/ProjectCategoryRedis.java create mode 100644 epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/redis/ProjectTagsRedis.java create mode 100644 epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectCategoryService.java create mode 100644 epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTagsService.java create mode 100644 epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectCategoryServiceImpl.java create mode 100644 epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTagsServiceImpl.java create mode 100644 epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectCategoryDao.xml create mode 100644 epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectTagsDao.xml 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..7d3e767591 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueProjectTagDictDTO.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 IssueProjectTagDictDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 标签名称 + */ + private String tagName; + + /** + * 分类id, 用户自己添加的标签此列可为空 + */ + private String categoryId; + + /** + * 议题对标签的引用次数 + */ + 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-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..ad5fd11583 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCategoryController.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.IssueCategoryDTO; +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); + } + +} \ 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..4f09b23bc1 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.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.IssueProjectCategoryDictDTO; +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); + } + +} \ 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..94e91b086b --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueCategoryDao.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.IssueCategoryEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 议题所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Mapper +public interface IssueCategoryDao extends BaseDao { + +} \ 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..bd770671d5 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectCategoryDictDao.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.IssueProjectCategoryDictEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 议题项目分类字典 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Mapper +public interface IssueProjectCategoryDictDao extends BaseDao { + +} \ 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..1cd8838351 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueTagsDao.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.IssueTagsEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 议题关联标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Mapper +public interface IssueTagsDao extends BaseDao { + +} \ 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..52ad36b5ef --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueProjectTagDictEntity.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_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; + + /** + * 议题对标签的引用次数 + */ + 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..2922932624 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/IssueProjectTagDictExcel.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 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 = "议题对标签的引用次数") + 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..7c9f56bd38 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueProjectTagDictRedis.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 IssueProjectTagDictRedis { + @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/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..92b700daa0 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueCategoryService.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.IssueCategoryDTO; +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); +} \ 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..5937393e1a --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.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.IssueProjectCategoryDictDTO; +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); +} \ 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..4e2a457af7 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueCategoryServiceImpl.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.IssueCategoryDao; +import com.epmet.dto.IssueCategoryDTO; +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; + + @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)); + } + +} \ 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..1bdb075c24 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.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.IssueProjectCategoryDictDao; +import com.epmet.dto.IssueProjectCategoryDictDTO; +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)); + } + +} \ 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..20f349dad8 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueCategoryDao.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/IssueProjectCategoryDictDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml new file mode 100644 index 0000000000..8be2371d88 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.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/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..d34e3bef22 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueTagsDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ 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-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..505d54c529 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectCategoryController.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.ProjectCategoryDTO; +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); + } + +} \ 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..8186178086 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectCategoryDao.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.ProjectCategoryEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 项目所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Mapper +public interface ProjectCategoryDao extends BaseDao { + +} \ 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..2b4435ab5f --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectTagsDao.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.ProjectTagsEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 项目关联标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Mapper +public interface ProjectTagsDao extends BaseDao { + +} \ 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..551b77ffbb --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectCategoryService.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.ProjectCategoryDTO; +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); +} \ 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..5663981dba --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectCategoryServiceImpl.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.ProjectCategoryDao; +import com.epmet.dto.ProjectCategoryDTO; +import com.epmet.entity.ProjectCategoryEntity; +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; + + @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)); + } + +} \ 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..5689229906 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectCategoryDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ 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..50ed689ab5 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectTagsDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file From 866b4653c58f9864f3a38eaf76add10910a77023 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 8 Dec 2020 15:55:06 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E8=A1=A8=E4=B8=AD=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/IssueCategoryDTO.java | 5 +++++ .../src/main/java/com/epmet/dto/IssueProjectTagDictDTO.java | 5 +++++ .../src/main/java/com/epmet/entity/IssueCategoryEntity.java | 5 +++++ .../java/com/epmet/entity/IssueProjectTagDictEntity.java | 5 +++++ .../src/main/java/com/epmet/excel/IssueCategoryExcel.java | 3 +++ .../main/java/com/epmet/excel/IssueProjectTagDictExcel.java | 3 +++ .../src/main/java/com/epmet/dto/ProjectCategoryDTO.java | 5 +++++ .../main/java/com/epmet/entity/ProjectCategoryEntity.java | 5 +++++ .../src/main/java/com/epmet/excel/ProjectCategoryExcel.java | 3 +++ 9 files changed, 39 insertions(+) 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 index 12d645937a..3883dc4b0f 100644 --- 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 @@ -58,6 +58,11 @@ public class IssueCategoryDTO implements Serializable { */ private String categoryId; + /** + * 分类名称 + */ + private String categoryName; + /** * 分类对应的所有上级,英文逗号隔开 */ 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 index 7d3e767591..b13500e735 100644 --- 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 @@ -53,6 +53,11 @@ public class IssueProjectTagDictDTO implements Serializable { */ private String categoryId; + /** + * 是否是默认标签(0:是 1:否) + */ + private String isDefault; + /** * 议题对标签的引用次数 */ 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 index fa9e5b8d5b..c977beb4bf 100644 --- 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 @@ -58,6 +58,11 @@ public class IssueCategoryEntity extends BaseEpmetEntity { */ private String categoryId; + /** + * 分类名称 + */ + private String categoryName; + /** * 分类对应的所有上级,英文逗号隔开 */ 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 index 52ad36b5ef..c56d5974a7 100644 --- 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 @@ -53,6 +53,11 @@ public class IssueProjectTagDictEntity extends BaseEpmetEntity { */ private String categoryId; + /** + * 是否是默认标签(0:是 1:否) + */ + private String isDefault; + /** * 议题对标签的引用次数 */ 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 index 1d74b3fe92..edb392740b 100644 --- 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 @@ -46,6 +46,9 @@ public class IssueCategoryExcel { @Excel(name = "分类id") private String categoryId; + @Excel(name = "分类名称") + private String categoryName; + @Excel(name = "分类对应的所有上级,英文逗号隔开") private String categoryPids; 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 index 2922932624..26fee432bd 100644 --- 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 @@ -43,6 +43,9 @@ public class IssueProjectTagDictExcel { @Excel(name = "分类id, 用户自己添加的标签此列可为空") private String categoryId; + @Excel(name = "是否是默认标签(0:是 1:否)") + private String isDefault; + @Excel(name = "议题对标签的引用次数") private Integer issueUseCount; 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 index 4c7b39c7d6..8ac01ddb81 100644 --- 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 @@ -58,6 +58,11 @@ public class ProjectCategoryDTO implements Serializable { */ private String categoryId; + /** + * 分类名称 + */ + private String categoryName; + /** * 分类对应的所有上级,英文逗号隔开 */ 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 index ce718cc201..ffcbb81753 100644 --- 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 @@ -58,6 +58,11 @@ public class ProjectCategoryEntity extends BaseEpmetEntity { */ private String categoryId; + /** + * 分类名称 + */ + private String categoryName; + /** * 分类对应的所有上级,英文逗号隔开 */ 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 index 515c2ddf7e..fe471b49cd 100644 --- 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 @@ -46,6 +46,9 @@ public class ProjectCategoryExcel { @Excel(name = "分类id") private String categoryId; + @Excel(name = "分类名称") + private String categoryName; + @Excel(name = "分类对应的所有上级,英文逗号隔开") private String categoryPids; From 4281356cee6142e7ddb3d8959f8d66671940a4bd Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 8 Dec 2020 16:02:16 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=BF=98=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/IssueCategoryDTO.java | 5 ----- .../src/main/java/com/epmet/entity/IssueCategoryEntity.java | 5 ----- .../src/main/java/com/epmet/excel/IssueCategoryExcel.java | 3 --- .../src/main/java/com/epmet/dto/ProjectCategoryDTO.java | 5 ----- .../main/java/com/epmet/entity/ProjectCategoryEntity.java | 5 ----- .../src/main/java/com/epmet/excel/ProjectCategoryExcel.java | 3 --- 6 files changed, 26 deletions(-) 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 index 3883dc4b0f..12d645937a 100644 --- 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 @@ -58,11 +58,6 @@ public class IssueCategoryDTO implements Serializable { */ private String categoryId; - /** - * 分类名称 - */ - private String categoryName; - /** * 分类对应的所有上级,英文逗号隔开 */ 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 index c977beb4bf..fa9e5b8d5b 100644 --- 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 @@ -58,11 +58,6 @@ public class IssueCategoryEntity extends BaseEpmetEntity { */ private String categoryId; - /** - * 分类名称 - */ - private String categoryName; - /** * 分类对应的所有上级,英文逗号隔开 */ 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 index edb392740b..1d74b3fe92 100644 --- 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 @@ -46,9 +46,6 @@ public class IssueCategoryExcel { @Excel(name = "分类id") private String categoryId; - @Excel(name = "分类名称") - private String categoryName; - @Excel(name = "分类对应的所有上级,英文逗号隔开") private String categoryPids; 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 index 8ac01ddb81..4c7b39c7d6 100644 --- 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 @@ -58,11 +58,6 @@ public class ProjectCategoryDTO implements Serializable { */ private String categoryId; - /** - * 分类名称 - */ - private String categoryName; - /** * 分类对应的所有上级,英文逗号隔开 */ 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 index ffcbb81753..ce718cc201 100644 --- 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 @@ -58,11 +58,6 @@ public class ProjectCategoryEntity extends BaseEpmetEntity { */ private String categoryId; - /** - * 分类名称 - */ - private String categoryName; - /** * 分类对应的所有上级,英文逗号隔开 */ 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 index fe471b49cd..515c2ddf7e 100644 --- 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 @@ -46,9 +46,6 @@ public class ProjectCategoryExcel { @Excel(name = "分类id") private String categoryId; - @Excel(name = "分类名称") - private String categoryName; - @Excel(name = "分类对应的所有上级,英文逗号隔开") private String categoryPids; From 11d79aac71e1b61da29a3690a968e4ff5dd443ba Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 8 Dec 2020 17:11:30 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E8=AF=A6=E6=83=85-?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E5=88=86=E7=B1=BB=E6=9F=A5=E8=AF=A2-?= =?UTF-8?q?=E4=B8=A4=E7=AB=AF=E5=85=AC=E5=85=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/CategoryTagListFormDTO.java | 21 +++++++++++++ .../controller/IssueCategoryController.java | 17 +++++++++++ .../java/com/epmet/dao/IssueCategoryDao.java | 11 ++++++- .../main/java/com/epmet/dao/IssueTagsDao.java | 11 ++++++- .../epmet/service/IssueCategoryService.java | 11 +++++++ .../impl/IssueCategoryServiceImpl.java | 30 +++++++++++++++++++ .../resources/mapper/IssueCategoryDao.xml | 15 +++++++++- .../main/resources/mapper/IssueTagsDao.xml | 13 +++++++- .../dto/result/CategoryTagListResultDTO.java | 27 +++++++++++++++++ .../dto/result/CategoryTagResultDTO.java | 25 ++++++++++++++++ 10 files changed, 177 insertions(+), 4 deletions(-) create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CategoryTagListFormDTO.java create mode 100644 epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CategoryTagListResultDTO.java create mode 100644 epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CategoryTagResultDTO.java diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CategoryTagListFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CategoryTagListFormDTO.java new file mode 100644 index 0000000000..0cece7cac2 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CategoryTagListFormDTO.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 CategoryTagListFormDTO implements Serializable { + + private static final long serialVersionUID = 2599592072265715951L; + @NotBlank(message = "议题ID不能为空",groups = {CategoryTagListFormDTO.CategoryTag.class}) + private String issueId; + + public interface CategoryTag{} + +} 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 index ad5fd11583..aaf37deea0 100644 --- 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 @@ -26,6 +26,11 @@ 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.IssueCategoryDTO; +import com.epmet.dto.form.CategoryTagListFormDTO; +import com.epmet.dto.form.ClosedProjectIssueListFormDTO; +import com.epmet.dto.form.MyShiftIssueTopicsFormDTO; +import com.epmet.dto.result.CategoryTagListResultDTO; +import com.epmet.dto.result.LatestListResultDTO; import com.epmet.excel.IssueCategoryExcel; import com.epmet.service.IssueCategoryService; import org.springframework.beans.factory.annotation.Autowired; @@ -91,4 +96,16 @@ public class IssueCategoryController { ExcelUtils.exportExcelToTarget(response, null, list, IssueCategoryExcel.class); } + /** + * @param formDTO + * @return + * @Description 获取议题的分类、标签列表 + * @Author sun + **/ + @PostMapping("categorytaglist") + public Result categoryTagList(@RequestBody CategoryTagListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, CategoryTagListFormDTO.CategoryTag.class); + return new Result().ok(issueCategoryService.categoryTagList(formDTO)); + } + } \ 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 index 94e91b086b..8fc966c738 100644 --- 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 @@ -18,8 +18,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.CategoryTagResultDTO; import com.epmet.entity.IssueCategoryEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 议题所属分类表 @@ -29,5 +33,10 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IssueCategoryDao extends BaseDao { - + + /** + * @Description 查询议题绑定的分类名称,按排序升序 + * @Author sun + **/ + List selectIssueCategoryList(@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/dao/IssueTagsDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueTagsDao.java index 1cd8838351..89c3d9ef69 100644 --- 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 @@ -18,8 +18,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.CategoryTagResultDTO; import com.epmet.entity.IssueTagsEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 议题关联标签表 @@ -29,5 +33,10 @@ import org.apache.ibatis.annotations.Mapper; */ @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/service/IssueCategoryService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueCategoryService.java index 92b700daa0..167621df74 100644 --- 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 @@ -20,6 +20,8 @@ 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.CategoryTagListFormDTO; +import com.epmet.dto.result.CategoryTagListResultDTO; import com.epmet.entity.IssueCategoryEntity; import java.util.List; @@ -92,4 +94,13 @@ public interface IssueCategoryService extends BaseService { * @date 2020-12-08 */ void delete(String[] ids); + + /** + * @param formDTO + * @return + * @Description 获取议题的分类、标签列表 + * @Author sun + **/ + CategoryTagListResultDTO categoryTagList(CategoryTagListFormDTO formDTO); + } \ 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 index 4e2a457af7..0d9ae06927 100644 --- 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 @@ -20,11 +20,16 @@ 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.NumConstant; 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.IssueCategoryDao; +import com.epmet.dao.IssueTagsDao; import com.epmet.dto.IssueCategoryDTO; +import com.epmet.dto.form.CategoryTagListFormDTO; +import com.epmet.dto.result.CategoryTagListResultDTO; +import com.epmet.dto.result.CategoryTagResultDTO; import com.epmet.entity.IssueCategoryEntity; import com.epmet.redis.IssueCategoryRedis; import com.epmet.service.IssueCategoryService; @@ -33,6 +38,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -48,6 +54,8 @@ public class IssueCategoryServiceImpl extends BaseServiceImpl page(Map params) { @@ -101,4 +109,26 @@ public class IssueCategoryServiceImpl extends BaseServiceImpl 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; + } + } \ 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 index 20f349dad8..465833cee1 100644 --- 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 @@ -3,6 +3,19 @@ - + \ 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 index d34e3bef22..ca008c94f6 100644 --- 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 @@ -3,6 +3,17 @@ - + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CategoryTagListResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CategoryTagListResultDTO.java new file mode 100644 index 0000000000..ee6186e3aa --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CategoryTagListResultDTO.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 CategoryTagListResultDTO 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/CategoryTagResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CategoryTagResultDTO.java new file mode 100644 index 0000000000..2b4aa63fbe --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CategoryTagResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 获取议题的分类、标签列表-接口返参 + * @Author sun + */ +@Data +public class CategoryTagResultDTO implements Serializable { + + private static final long serialVersionUID = 5957826616179876849L; + + /** + * 分类或标签Id + */ + private String id; + /** + * 分类或标签名称 + */ + private String name; + +} From 4840bf722fd6d0d45bbe49160a99387dc5286f53 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 8 Dec 2020 18:07:11 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AF=A6=E6=83=85-?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E5=88=86=E7=B1=BB=E6=9F=A5=E8=AF=A2-?= =?UTF-8?q?=E4=B8=A4=E7=AB=AF=E5=85=B1=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ....java => IssueCategoryTagListFormDTO.java} | 4 +- .../IssueCategoryTagListResultDTO.java} | 6 +-- .../result/IssueCategoryTagResultDTO.java} | 2 +- .../epmet/feign/GovIssueOpenFeignClient.java | 9 +++- .../GovIssueOpenFeignClientFallBack.java | 11 ++++- .../controller/IssueCategoryController.java | 27 ++++++++---- .../java/com/epmet/dao/IssueCategoryDao.java | 13 +++++- .../main/java/com/epmet/dao/IssueTagsDao.java | 4 +- .../epmet/service/IssueCategoryService.java | 14 +++++-- .../impl/IssueCategoryServiceImpl.java | 29 +++++++++---- .../resources/mapper/IssueCategoryDao.xml | 19 ++++++++- .../main/resources/mapper/IssueTagsDao.xml | 14 +++---- .../form/ProjectCategoryTagListFormDTO.java | 22 ++++++++++ .../ProjectCategoryTagListResultDTO.java | 27 ++++++++++++ .../result/ProjectCategoryTagResultDTO.java | 25 +++++++++++ .../controller/ProjectCategoryController.java | 16 ++++++- .../com/epmet/dao/ProjectCategoryDao.java | 11 ++++- .../java/com/epmet/dao/ProjectTagsDao.java | 11 ++++- .../epmet/service/ProjectCategoryService.java | 10 +++++ .../impl/ProjectCategoryServiceImpl.java | 42 ++++++++++++++++++- .../resources/mapper/ProjectCategoryDao.xml | 10 ++++- .../main/resources/mapper/ProjectTagsDao.xml | 13 +++++- 22 files changed, 292 insertions(+), 47 deletions(-) rename epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/{CategoryTagListFormDTO.java => IssueCategoryTagListFormDTO.java} (66%) rename epmet-module/{gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CategoryTagListResultDTO.java => gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueCategoryTagListResultDTO.java} (63%) rename epmet-module/{gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CategoryTagResultDTO.java => gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueCategoryTagResultDTO.java} (84%) create mode 100644 epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectCategoryTagListFormDTO.java create mode 100644 epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectCategoryTagListResultDTO.java create mode 100644 epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectCategoryTagResultDTO.java diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CategoryTagListFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueCategoryTagListFormDTO.java similarity index 66% rename from epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CategoryTagListFormDTO.java rename to epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueCategoryTagListFormDTO.java index 0cece7cac2..d9339a0e97 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CategoryTagListFormDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueCategoryTagListFormDTO.java @@ -10,10 +10,10 @@ import java.io.Serializable; * @Author sun */ @Data -public class CategoryTagListFormDTO implements Serializable { +public class IssueCategoryTagListFormDTO implements Serializable { private static final long serialVersionUID = 2599592072265715951L; - @NotBlank(message = "议题ID不能为空",groups = {CategoryTagListFormDTO.CategoryTag.class}) + @NotBlank(message = "议题ID不能为空",groups = {ProjectCategoryTagListFormDTO.CategoryTag.class}) private String issueId; public interface CategoryTag{} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CategoryTagListResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueCategoryTagListResultDTO.java similarity index 63% rename from epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CategoryTagListResultDTO.java rename to epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueCategoryTagListResultDTO.java index ee6186e3aa..cd78b59aaf 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CategoryTagListResultDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueCategoryTagListResultDTO.java @@ -11,17 +11,17 @@ import java.util.List; * @Author sun */ @Data -public class CategoryTagListResultDTO implements Serializable { +public class IssueCategoryTagListResultDTO implements Serializable { private static final long serialVersionUID = 5957826616179876849L; /** * 类别集合 */ - private List categoryList = new ArrayList<>(); + private List categoryList = new ArrayList<>(); /** * 标签集合 */ - private List tagList = new ArrayList<>(); + private List tagList = new ArrayList<>(); } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CategoryTagResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueCategoryTagResultDTO.java similarity index 84% rename from epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CategoryTagResultDTO.java rename to epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueCategoryTagResultDTO.java index 2b4aa63fbe..23ac6afece 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CategoryTagResultDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueCategoryTagResultDTO.java @@ -9,7 +9,7 @@ import java.io.Serializable; * @Author sun */ @Data -public class CategoryTagResultDTO implements Serializable { +public class IssueCategoryTagResultDTO implements Serializable { private static final long serialVersionUID = 5957826616179876849L; 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/controller/IssueCategoryController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCategoryController.java index aaf37deea0..83aa6560d7 100644 --- 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 @@ -23,14 +23,12 @@ 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.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.IssueCategoryDTO; -import com.epmet.dto.form.CategoryTagListFormDTO; -import com.epmet.dto.form.ClosedProjectIssueListFormDTO; -import com.epmet.dto.form.MyShiftIssueTopicsFormDTO; -import com.epmet.dto.result.CategoryTagListResultDTO; -import com.epmet.dto.result.LatestListResultDTO; +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; @@ -103,9 +101,20 @@ public class IssueCategoryController { * @Author sun **/ @PostMapping("categorytaglist") - public Result categoryTagList(@RequestBody CategoryTagListFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO, CategoryTagListFormDTO.CategoryTag.class); - return new Result().ok(issueCategoryService.categoryTagList(formDTO)); + 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/dao/IssueCategoryDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueCategoryDao.java index 8fc966c738..b1929c55f7 100644 --- 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 @@ -18,7 +18,8 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.result.CategoryTagResultDTO; +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; @@ -38,5 +39,13 @@ public interface IssueCategoryDao extends BaseDao { * @Description 查询议题绑定的分类名称,按排序升序 * @Author sun **/ - List selectIssueCategoryList(@Param("issueId") String issueId); + List selectIssueCategoryList(@Param("issueId") String issueId); + + /** + * @param categoryIdList + * @return + * @Description 查询分类Id对应的分类名称,按分类升序排列 + * @Author sun + **/ + List selectProjectCategoryList(List categoryIdList); } \ 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 index 89c3d9ef69..e4c1e9e81d 100644 --- 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 @@ -18,7 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.result.CategoryTagResultDTO; +import com.epmet.dto.result.IssueCategoryTagResultDTO; import com.epmet.entity.IssueTagsEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -38,5 +38,5 @@ public interface IssueTagsDao extends BaseDao { * @Description 查询议题绑定的标签,按绑定时间升序 * @Author sun **/ - List selectIssueTagList(@Param("issueId") String issueId); + 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/service/IssueCategoryService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueCategoryService.java index 167621df74..6a3324c908 100644 --- 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 @@ -20,8 +20,9 @@ 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.CategoryTagListFormDTO; -import com.epmet.dto.result.CategoryTagListResultDTO; +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; @@ -101,6 +102,13 @@ public interface IssueCategoryService extends BaseService { * @Description 获取议题的分类、标签列表 * @Author sun **/ - CategoryTagListResultDTO categoryTagList(CategoryTagListFormDTO formDTO); + 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/impl/IssueCategoryServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueCategoryServiceImpl.java index 0d9ae06927..82405538d6 100644 --- 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 @@ -20,16 +20,17 @@ 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.commons.tools.constant.FieldConstant; import com.epmet.dao.IssueCategoryDao; import com.epmet.dao.IssueTagsDao; import com.epmet.dto.IssueCategoryDTO; -import com.epmet.dto.form.CategoryTagListFormDTO; -import com.epmet.dto.result.CategoryTagListResultDTO; -import com.epmet.dto.result.CategoryTagResultDTO; +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; @@ -38,7 +39,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -116,19 +116,30 @@ public class IssueCategoryServiceImpl extends BaseServiceImpl categoryList = baseDao.selectIssueCategoryList(formDTO.getIssueId()); + List categoryList = baseDao.selectIssueCategoryList(formDTO.getIssueId()); if (categoryList.size() > NumConstant.ZERO) { resultDTO.setCategoryList(categoryList); } //2.查询议题绑定的标签,按绑定时间升序 - List tagList = issueTagsDao.selectIssueTagList(formDTO.getIssueId()); + 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/resources/mapper/IssueCategoryDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueCategoryDao.xml index 465833cee1..833bd4df11 100644 --- 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 @@ -3,7 +3,7 @@ - SELECT ic.category_id AS "id", ip.category_name AS "name" @@ -18,4 +18,21 @@ ip.sort ASC + + \ 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 index ca008c94f6..9e15021e6d 100644 --- 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 @@ -3,17 +3,17 @@ - SELECT - it.tag_id AS "id", - it.tag_name AS "name" + tag_id AS "id", + tag_name AS "name" FROM - issue_tags it + issue_tags WHERE - it.del_flag = '0' - AND it.issue_id = #{issueId} + del_flag = '0' + AND issue_id = #{issueId} ORDER BY - it.created_time ASC + created_time ASC \ 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/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 index 505d54c529..c773ece4f9 100644 --- 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 @@ -23,9 +23,11 @@ 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.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; @@ -91,4 +93,16 @@ public class ProjectCategoryController { 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/dao/ProjectCategoryDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectCategoryDao.java index 8186178086..ac041659f7 100644 --- 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 @@ -20,6 +20,9 @@ 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; /** * 项目所属分类表 @@ -29,5 +32,11 @@ import org.apache.ibatis.annotations.Mapper; */ @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 index 2b4435ab5f..da5b1d39c9 100644 --- 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 @@ -18,8 +18,12 @@ 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; /** * 项目关联标签表 @@ -29,5 +33,10 @@ import org.apache.ibatis.annotations.Mapper; */ @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/service/ProjectCategoryService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectCategoryService.java index 551b77ffbb..e31a951784 100644 --- 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 @@ -20,6 +20,8 @@ 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; @@ -92,4 +94,12 @@ public interface ProjectCategoryService extends BaseService page(Map params) { @@ -101,4 +114,31 @@ public class ProjectCategoryServiceImpl extends BaseServiceImpl 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/resources/mapper/ProjectCategoryDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectCategoryDao.xml index 5689229906..da4a2d332e 100644 --- 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 @@ -3,6 +3,14 @@ - + \ 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 index 50ed689ab5..0936bcc4d4 100644 --- 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 @@ -3,6 +3,17 @@ - + \ No newline at end of file From 281404050b1c4500d0adadaa0873f0fa02952fe5 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 9 Dec 2020 10:46:15 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E5=88=86=E7=B1=BB=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/CustomerCategoryListFormDTO.java | 22 +++++++++++++ .../IssueProjectCategoryDictController.java | 28 +++++++++++++---- .../dao/IssueProjectCategoryDictDao.java | 16 +++++++++- .../IssueProjectCategoryDictService.java | 10 ++++++ .../IssueProjectCategoryDictServiceImpl.java | 18 +++++++++-- .../mapper/IssueProjectCategoryDictDao.xml | 31 +++++++++++++++++++ .../result/CustomerCategoryListResultDTO.java | 31 +++++++++++++++++++ 7 files changed, 147 insertions(+), 9 deletions(-) create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CustomerCategoryListFormDTO.java create mode 100644 epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CustomerCategoryListResultDTO.java 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-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 index 4f09b23bc1..87a31f658f 100644 --- 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 @@ -26,6 +26,10 @@ 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; @@ -45,24 +49,24 @@ import java.util.Map; @RestController @RequestMapping("issueprojectcategorydict") public class IssueProjectCategoryDictController { - + @Autowired private IssueProjectCategoryDictService issueProjectCategoryDictService; @GetMapping("page") - public Result> page(@RequestParam Map params){ + 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){ + public Result get(@PathVariable("id") String id) { IssueProjectCategoryDictDTO data = issueProjectCategoryDictService.get(id); return new Result().ok(data); } @PostMapping - public Result save(@RequestBody IssueProjectCategoryDictDTO dto){ + public Result save(@RequestBody IssueProjectCategoryDictDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); issueProjectCategoryDictService.save(dto); @@ -70,7 +74,7 @@ public class IssueProjectCategoryDictController { } @PutMapping - public Result update(@RequestBody IssueProjectCategoryDictDTO dto){ + public Result update(@RequestBody IssueProjectCategoryDictDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); issueProjectCategoryDictService.update(dto); @@ -78,7 +82,7 @@ public class IssueProjectCategoryDictController { } @DeleteMapping - public Result delete(@RequestBody String[] ids){ + public Result delete(@RequestBody String[] ids) { //效验数据 AssertUtils.isArrayEmpty(ids, "id"); issueProjectCategoryDictService.delete(ids); @@ -91,4 +95,16 @@ public class IssueProjectCategoryDictController { 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/dao/IssueProjectCategoryDictDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectCategoryDictDao.java index bd770671d5..485fef9b4b 100644 --- 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 @@ -18,8 +18,12 @@ 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; /** * 议题项目分类字典 @@ -29,5 +33,15 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IssueProjectCategoryDictDao extends BaseDao { - + + /** + * @Description 客户分类列表查询,按分类升序排列 + * @Author sun + **/ + List selectCustomerCategoryList(@Param("customerId") String customerId); + /** + * @Description 查询某个分类的下级分类 + * @Author sun + **/ + List subCategoryList(@Param("categoryId") String categoryId); } \ 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 index 5937393e1a..41a807cd40 100644 --- 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 @@ -20,6 +20,8 @@ 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; @@ -92,4 +94,12 @@ public interface IssueProjectCategoryDictService extends BaseService 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/impl/IssueProjectCategoryDictServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java index 1bdb075c24..3aa823b8d3 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java @@ -25,6 +25,8 @@ 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; @@ -65,8 +67,8 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + 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); @@ -101,4 +103,16 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl 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/resources/mapper/IssueProjectCategoryDictDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml index 8be2371d88..26caac2d50 100644 --- 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 @@ -3,6 +3,37 @@ + + + + + + + + + + \ No newline at end of file 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; + +} From 42fa70c787ac3275c78181b4fbb5a59157e0e13f Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 9 Dec 2020 13:52:08 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E6=A0=87=E7=AD=BEkey=20=20=20=20=20?= =?UTF-8?q?=E6=A0=87=E7=AD=BEredis=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/GovIssueRedisKeys.java | 12 +++++++++ .../epmet/redis/IssueProjectTagDictRedis.java | 27 +++++++++++++++++++ 2 files changed, 39 insertions(+) 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/redis/IssueProjectTagDictRedis.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueProjectTagDictRedis.java index 7c9f56bd38..662b85402c 100644 --- 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 @@ -18,9 +18,14 @@ 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; + /** * 议题、项目标签字典表 * @@ -28,6 +33,7 @@ import org.springframework.stereotype.Component; * @since v1.0.0 2020-12-08 */ @Component +@Slf4j public class IssueProjectTagDictRedis { @Autowired private RedisUtils redisUtils; @@ -44,4 +50,25 @@ public class IssueProjectTagDictRedis { 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 From 2533e106f0152d19849fbbe17d34afecdf05034c Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 9 Dec 2020 14:16:09 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=87=AA=E6=B5=8B?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dao/IssueCategoryDao.java | 2 +- .../com/epmet/dao/IssueProjectCategoryDictDao.java | 2 +- .../src/main/resources/mapper/IssueCategoryDao.xml | 4 ++-- .../resources/mapper/IssueProjectCategoryDictDao.xml | 12 ++++++------ 4 files changed, 10 insertions(+), 10 deletions(-) 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 index b1929c55f7..ad55b96802 100644 --- 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 @@ -47,5 +47,5 @@ public interface IssueCategoryDao extends BaseDao { * @Description 查询分类Id对应的分类名称,按分类升序排列 * @Author sun **/ - List selectProjectCategoryList(List categoryIdList); + 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 index 485fef9b4b..c3e44340e4 100644 --- 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 @@ -43,5 +43,5 @@ public interface IssueProjectCategoryDictDao extends BaseDao subCategoryList(@Param("categoryId") String categoryId); + List subCategoryList(@Param("id") String categoryId); } \ 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 index 833bd4df11..875e1c755b 100644 --- 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 @@ -26,13 +26,13 @@ issue_project_category_dict WHERE del_flag = '0' - + id = #{id} ORDER BY - ip.sort ASC + sort ASC \ 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 index 26caac2d50..e638fec0b8 100644 --- 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 @@ -5,16 +5,16 @@ - - + + - + SELECT id AS "id", - category_type AS "name" + category_name AS "name" FROM issue_project_category_dict WHERE del_flag = '0' - AND pid = #{categoryId} + AND pid = #{id} ORDER BY sort ASC