Browse Source

Merge branch 'dev_issue_category' into dev_temp

master
sunyuchao 5 years ago
parent
commit
ec313e3810
  1. 96
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueCategoryDTO.java
  2. 106
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueProjectCategoryDictDTO.java
  3. 101
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueProjectTagDictDTO.java
  4. 96
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueTagsDTO.java
  5. 22
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CustomerCategoryListFormDTO.java
  6. 21
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueCategoryTagListFormDTO.java
  7. 27
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueCategoryTagListResultDTO.java
  8. 25
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueCategoryTagResultDTO.java
  9. 9
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java
  10. 11
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java
  11. 12
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/GovIssueRedisKeys.java
  12. 120
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCategoryController.java
  13. 110
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java
  14. 94
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectTagDictController.java
  15. 94
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueTagsController.java
  16. 51
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueCategoryDao.java
  17. 47
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectCategoryDictDao.java
  18. 33
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectTagDictDao.java
  19. 42
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueTagsDao.java
  20. 66
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueCategoryEntity.java
  21. 76
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueProjectCategoryDictEntity.java
  22. 71
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueProjectTagDictEntity.java
  23. 66
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueTagsEntity.java
  24. 71
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/IssueCategoryExcel.java
  25. 77
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/IssueProjectCategoryDictExcel.java
  26. 74
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/IssueProjectTagDictExcel.java
  27. 71
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/IssueTagsExcel.java
  28. 47
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueCategoryRedis.java
  29. 47
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueProjectCategoryDictRedis.java
  30. 74
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueProjectTagDictRedis.java
  31. 47
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueTagsRedis.java
  32. 114
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueCategoryService.java
  33. 105
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java
  34. 95
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectTagDictService.java
  35. 95
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueTagsService.java
  36. 145
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueCategoryServiceImpl.java
  37. 118
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java
  38. 104
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectTagDictServiceImpl.java
  39. 104
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueTagsServiceImpl.java
  40. 38
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueCategoryDao.xml
  41. 39
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml
  42. 8
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectTagDictDao.xml
  43. 19
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueTagsDao.xml
  44. 96
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectCategoryDTO.java
  45. 91
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectTagsDTO.java
  46. 22
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectCategoryTagListFormDTO.java
  47. 31
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CustomerCategoryListResultDTO.java
  48. 27
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectCategoryTagListResultDTO.java
  49. 25
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectCategoryTagResultDTO.java
  50. 108
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectCategoryController.java
  51. 94
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTagsController.java
  52. 42
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectCategoryDao.java
  53. 42
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectTagsDao.java
  54. 66
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectCategoryEntity.java
  55. 61
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectTagsEntity.java
  56. 71
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectCategoryExcel.java
  57. 68
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectTagsExcel.java
  58. 47
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/redis/ProjectCategoryRedis.java
  59. 47
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/redis/ProjectTagsRedis.java
  60. 105
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectCategoryService.java
  61. 95
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTagsService.java
  62. 144
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectCategoryServiceImpl.java
  63. 104
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTagsServiceImpl.java
  64. 16
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectCategoryDao.xml
  65. 19
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectTagsDao.xml

96
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

106
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

101
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueProjectTagDictDTO.java

@ -0,0 +1,101 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 议题项目标签字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-08
*/
@Data
public class IssueProjectTagDictDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 标签名称
*/
private String tagName;
/**
* 分类id, 用户自己添加的标签此列可为空
*/
private String categoryId;
/**
* 是否是默认标签(0: 1:)
*/
private String isDefault;
/**
* 议题对标签的引用次数
*/
private Integer issueUseCount;
/**
* 项目对标签的引用次数
*/
private Integer projectUseCount;
/**
* 删除标识 0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

96
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

22
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{}
}

21
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueCategoryTagListFormDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 获取议题的分类标签列表-接口入参
* @Author sun
*/
@Data
public class IssueCategoryTagListFormDTO implements Serializable {
private static final long serialVersionUID = 2599592072265715951L;
@NotBlank(message = "议题ID不能为空",groups = {ProjectCategoryTagListFormDTO.CategoryTag.class})
private String issueId;
public interface CategoryTag{}
}

27
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueCategoryTagListResultDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @Description 获取议题的分类标签列表-接口返参
* @Author sun
*/
@Data
public class IssueCategoryTagListResultDTO implements Serializable {
private static final long serialVersionUID = 5957826616179876849L;
/**
* 类别集合
*/
private List<IssueCategoryTagResultDTO> categoryList = new ArrayList<>();
/**
* 标签集合
*/
private List<IssueCategoryTagResultDTO> tagList = new ArrayList<>();
}

25
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueCategoryTagResultDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 获取议题的分类标签列表-接口返参
* @Author sun
*/
@Data
public class IssueCategoryTagResultDTO implements Serializable {
private static final long serialVersionUID = 5957826616179876849L;
/**
* 分类或标签Id
*/
private String id;
/**
* 分类或标签名称
*/
private String name;
}

9
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<List<UserPubAuditingIssueResDTO>> queryUserPubAuditingIssues(@RequestBody UserPubAuditingIssueFormDTO fomrDTO);
/**
* @description 调用issue库查询分类Id对应的分类名称按分类升序排列
* @author sun
**/
@PostMapping(value = "/gov/issue/issuecategory/projectcategorylist")
Result<List<ProjectCategoryTagResultDTO>> projectCategoryList(@RequestBody List<String> categoryIdList);
}

11
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<List<UserPubAuditingIssueResDTO>> queryUserPubAuditingIssues(UserPubAuditingIssueFormDTO fomrDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "queryUserPubAuditingIssues", fomrDTO);
}
/**
* @description 调用issue库查询分类Id对应的分类名称按分类升序排列
* @author sun
**/
@Override
public Result<List<ProjectCategoryTagResultDTO>> projectCategoryList(List<String> categoryIdList) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "projectCategoryList", categoryIdList);
}
}

12
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);
}
}

120
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCategoryController.java

@ -0,0 +1,120 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.controller;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IssueCategoryDTO;
import com.epmet.dto.form.IssueCategoryTagListFormDTO;
import com.epmet.dto.result.IssueCategoryTagListResultDTO;
import com.epmet.dto.result.ProjectCategoryTagResultDTO;
import com.epmet.excel.IssueCategoryExcel;
import com.epmet.service.IssueCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 议题所属分类表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-08
*/
@RestController
@RequestMapping("issuecategory")
public class IssueCategoryController {
@Autowired
private IssueCategoryService issueCategoryService;
@GetMapping("page")
public Result<PageData<IssueCategoryDTO>> page(@RequestParam Map<String, Object> params){
PageData<IssueCategoryDTO> page = issueCategoryService.page(params);
return new Result<PageData<IssueCategoryDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<IssueCategoryDTO> get(@PathVariable("id") String id){
IssueCategoryDTO data = issueCategoryService.get(id);
return new Result<IssueCategoryDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
List<IssueCategoryDTO> list = issueCategoryService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, IssueCategoryExcel.class);
}
/**
* @param formDTO
* @return
* @Description 获取议题的分类标签列表
* @Author sun
**/
@PostMapping("categorytaglist")
public Result<IssueCategoryTagListResultDTO> categoryTagList(@RequestBody IssueCategoryTagListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, IssueCategoryTagListFormDTO.CategoryTag.class);
return new Result<IssueCategoryTagListResultDTO>().ok(issueCategoryService.categoryTagList(formDTO));
}
/**
* @param categoryIdList
* @return
* @Description 查询分类Id集合对应的分类名称按分类升序排列
* @Author sun
**/
@PostMapping("projectcategorylist")
public Result<List<ProjectCategoryTagResultDTO>> projectCategoryList(@RequestBody List<String> categoryIdList) {
return new Result<List<ProjectCategoryTagResultDTO>>().ok(issueCategoryService.projectCategoryList(categoryIdList));
}
}

110
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java

@ -0,0 +1,110 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.controller;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IssueProjectCategoryDictDTO;
import com.epmet.dto.form.CustomerCategoryListFormDTO;
import com.epmet.dto.form.IssueCategoryTagListFormDTO;
import com.epmet.dto.result.CustomerCategoryListResultDTO;
import com.epmet.dto.result.ProjectCategoryTagResultDTO;
import com.epmet.excel.IssueProjectCategoryDictExcel;
import com.epmet.service.IssueProjectCategoryDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 议题项目分类字典
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-08
*/
@RestController
@RequestMapping("issueprojectcategorydict")
public class IssueProjectCategoryDictController {
@Autowired
private IssueProjectCategoryDictService issueProjectCategoryDictService;
@GetMapping("page")
public Result<PageData<IssueProjectCategoryDictDTO>> page(@RequestParam Map<String, Object> params) {
PageData<IssueProjectCategoryDictDTO> page = issueProjectCategoryDictService.page(params);
return new Result<PageData<IssueProjectCategoryDictDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<IssueProjectCategoryDictDTO> get(@PathVariable("id") String id) {
IssueProjectCategoryDictDTO data = issueProjectCategoryDictService.get(id);
return new Result<IssueProjectCategoryDictDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
List<IssueProjectCategoryDictDTO> list = issueProjectCategoryDictService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, IssueProjectCategoryDictExcel.class);
}
/**
* @param formDTO
* @return
* @Description 客户分类列表查询按分类升序排列
* @Author sun
**/
@PostMapping("list")
public Result<List<CustomerCategoryListResultDTO>> categoryList(@RequestBody CustomerCategoryListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, CustomerCategoryListFormDTO.Category.class);
return new Result<List<CustomerCategoryListResultDTO>>().ok(issueProjectCategoryDictService.categoryList(formDTO));
}
}

94
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<PageData<IssueProjectTagDictDTO>> page(@RequestParam Map<String, Object> params){
PageData<IssueProjectTagDictDTO> page = issueProjectTagDictService.page(params);
return new Result<PageData<IssueProjectTagDictDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<IssueProjectTagDictDTO> get(@PathVariable("id") String id){
IssueProjectTagDictDTO data = issueProjectTagDictService.get(id);
return new Result<IssueProjectTagDictDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
List<IssueProjectTagDictDTO> list = issueProjectTagDictService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, IssueProjectTagDictExcel.class);
}
}

94
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<PageData<IssueTagsDTO>> page(@RequestParam Map<String, Object> params){
PageData<IssueTagsDTO> page = issueTagsService.page(params);
return new Result<PageData<IssueTagsDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<IssueTagsDTO> get(@PathVariable("id") String id){
IssueTagsDTO data = issueTagsService.get(id);
return new Result<IssueTagsDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
List<IssueTagsDTO> list = issueTagsService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, IssueTagsExcel.class);
}
}

51
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueCategoryDao.java

@ -0,0 +1,51 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.IssueCategoryTagResultDTO;
import com.epmet.dto.result.ProjectCategoryTagResultDTO;
import com.epmet.entity.IssueCategoryEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 议题所属分类表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-08
*/
@Mapper
public interface IssueCategoryDao extends BaseDao<IssueCategoryEntity> {
/**
* @Description 查询议题绑定的分类名称按排序升序
* @Author sun
**/
List<IssueCategoryTagResultDTO> selectIssueCategoryList(@Param("issueId") String issueId);
/**
* @param categoryIdList
* @return
* @Description 查询分类Id对应的分类名称按分类升序排列
* @Author sun
**/
List<ProjectCategoryTagResultDTO> selectProjectCategoryList(@Param("categoryIdList") List<String> categoryIdList);
}

47
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectCategoryDictDao.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.CustomerCategoryListResultDTO;
import com.epmet.entity.IssueProjectCategoryDictEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 议题项目分类字典
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-08
*/
@Mapper
public interface IssueProjectCategoryDictDao extends BaseDao<IssueProjectCategoryDictEntity> {
/**
* @Description 客户分类列表查询按分类升序排列
* @Author sun
**/
List<CustomerCategoryListResultDTO> selectCustomerCategoryList(@Param("customerId") String customerId);
/**
* @Description 查询某个分类的下级分类
* @Author sun
**/
List<CustomerCategoryListResultDTO> subCategoryList(@Param("id") String categoryId);
}

33
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<IssueProjectTagDictEntity> {
}

42
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueTagsDao.java

@ -0,0 +1,42 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.IssueCategoryTagResultDTO;
import com.epmet.entity.IssueTagsEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 议题关联标签表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-08
*/
@Mapper
public interface IssueTagsDao extends BaseDao<IssueTagsEntity> {
/**
* @Description 查询议题绑定的标签按绑定时间升序
* @Author sun
**/
List<IssueCategoryTagResultDTO> selectIssueTagList(@Param("issueId") String issueId);
}

66
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

76
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

71
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueProjectTagDictEntity.java

@ -0,0 +1,71 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 议题项目标签字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-08
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("issue_project_tag_dict")
public class IssueProjectTagDictEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 标签名称
*/
private String tagName;
/**
* 分类id, 用户自己添加的标签此列可为空
*/
private String categoryId;
/**
* 是否是默认标签(0: 1:)
*/
private String isDefault;
/**
* 议题对标签的引用次数
*/
private Integer issueUseCount;
/**
* 项目对标签的引用次数
*/
private Integer projectUseCount;
}

66
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

71
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

77
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

74
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/IssueProjectTagDictExcel.java

@ -0,0 +1,74 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 议题项目标签字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-08
*/
@Data
public class IssueProjectTagDictExcel {
@Excel(name = "主键ID")
private String id;
@Excel(name = "客户ID")
private String customerId;
@Excel(name = "标签名称")
private String tagName;
@Excel(name = "分类id, 用户自己添加的标签此列可为空")
private String categoryId;
@Excel(name = "是否是默认标签(0:是 1:否)")
private String isDefault;
@Excel(name = "议题对标签的引用次数")
private Integer issueUseCount;
@Excel(name = "项目对标签的引用次数")
private Integer projectUseCount;
@Excel(name = "删除标识 0.未删除 1.已删除")
private Integer delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

71
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

47
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}
}

47
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}
}

74
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueProjectTagDictRedis.java

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

47
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}
}

114
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueCategoryService.java

@ -0,0 +1,114 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IssueCategoryDTO;
import com.epmet.dto.form.IssueCategoryTagListFormDTO;
import com.epmet.dto.result.IssueCategoryTagListResultDTO;
import com.epmet.dto.result.ProjectCategoryTagResultDTO;
import com.epmet.entity.IssueCategoryEntity;
import java.util.List;
import java.util.Map;
/**
* 议题所属分类表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-08
*/
public interface IssueCategoryService extends BaseService<IssueCategoryEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<IssueCategoryDTO>
* @author generator
* @date 2020-12-08
*/
PageData<IssueCategoryDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<IssueCategoryDTO>
* @author generator
* @date 2020-12-08
*/
List<IssueCategoryDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return IssueCategoryDTO
* @author generator
* @date 2020-12-08
*/
IssueCategoryDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-12-08
*/
void save(IssueCategoryDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-12-08
*/
void update(IssueCategoryDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-12-08
*/
void delete(String[] ids);
/**
* @param formDTO
* @return
* @Description 获取议题的分类标签列表
* @Author sun
**/
IssueCategoryTagListResultDTO categoryTagList(IssueCategoryTagListFormDTO formDTO);
/**
* @param categoryIdList
* @return
* @Description 查询分类Id集合对应的分类名称按分类升序排列
* @Author sun
**/
List<ProjectCategoryTagResultDTO> projectCategoryList(List<String> categoryIdList);
}

105
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java

@ -0,0 +1,105 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IssueProjectCategoryDictDTO;
import com.epmet.dto.form.CustomerCategoryListFormDTO;
import com.epmet.dto.result.CustomerCategoryListResultDTO;
import com.epmet.entity.IssueProjectCategoryDictEntity;
import java.util.List;
import java.util.Map;
/**
* 议题项目分类字典
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-08
*/
public interface IssueProjectCategoryDictService extends BaseService<IssueProjectCategoryDictEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<IssueProjectCategoryDictDTO>
* @author generator
* @date 2020-12-08
*/
PageData<IssueProjectCategoryDictDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<IssueProjectCategoryDictDTO>
* @author generator
* @date 2020-12-08
*/
List<IssueProjectCategoryDictDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return IssueProjectCategoryDictDTO
* @author generator
* @date 2020-12-08
*/
IssueProjectCategoryDictDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-12-08
*/
void save(IssueProjectCategoryDictDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-12-08
*/
void update(IssueProjectCategoryDictDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-12-08
*/
void delete(String[] ids);
/**
* @param formDTO
* @return
* @Description 客户分类列表查询按分类升序排列
* @Author sun
**/
List<CustomerCategoryListResultDTO> categoryList(CustomerCategoryListFormDTO formDTO);
}

95
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<IssueProjectTagDictEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<IssueProjectTagDictDTO>
* @author generator
* @date 2020-12-08
*/
PageData<IssueProjectTagDictDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<IssueProjectTagDictDTO>
* @author generator
* @date 2020-12-08
*/
List<IssueProjectTagDictDTO> list(Map<String, Object> 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);
}

95
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<IssueTagsEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<IssueTagsDTO>
* @author generator
* @date 2020-12-08
*/
PageData<IssueTagsDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<IssueTagsDTO>
* @author generator
* @date 2020-12-08
*/
List<IssueTagsDTO> list(Map<String, Object> 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);
}

145
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueCategoryServiceImpl.java

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

118
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java

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

104
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<IssueProjectTagDictDao, IssueProjectTagDictEntity> implements IssueProjectTagDictService {
@Autowired
private IssueProjectTagDictRedis issueProjectTagDictRedis;
@Override
public PageData<IssueProjectTagDictDTO> page(Map<String, Object> params) {
IPage<IssueProjectTagDictEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, IssueProjectTagDictDTO.class);
}
@Override
public List<IssueProjectTagDictDTO> list(Map<String, Object> params) {
List<IssueProjectTagDictEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, IssueProjectTagDictDTO.class);
}
private QueryWrapper<IssueProjectTagDictEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<IssueProjectTagDictEntity> 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));
}
}

104
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<IssueTagsDao, IssueTagsEntity> implements IssueTagsService {
@Autowired
private IssueTagsRedis issueTagsRedis;
@Override
public PageData<IssueTagsDTO> page(Map<String, Object> params) {
IPage<IssueTagsEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, IssueTagsDTO.class);
}
@Override
public List<IssueTagsDTO> list(Map<String, Object> params) {
List<IssueTagsEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, IssueTagsDTO.class);
}
private QueryWrapper<IssueTagsEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<IssueTagsEntity> 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));
}
}

38
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueCategoryDao.xml

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.IssueCategoryDao">
<select id="selectIssueCategoryList" resultType="com.epmet.dto.result.IssueCategoryTagResultDTO">
SELECT
ic.category_id AS "id",
ip.category_name AS "name"
FROM
issue_category ic
INNER JOIN issue_project_category_dict ip ON ic.category_id = ip.id
WHERE
ic.del_flag = '0'
AND ip.del_flag = '0'
AND ic.issue_id = #{issueId}
ORDER BY
ip.sort ASC
</select>
<select id="selectProjectCategoryList" resultType="com.epmet.dto.result.ProjectCategoryTagResultDTO">
SELECT
id AS "id",
category_name AS "name"
FROM
issue_project_category_dict
WHERE
del_flag = '0'
<if test="categoryIdList != null and categoryIdList.size() > 0">
<foreach collection="categoryIdList" item="id" open="AND( " separator=" OR " index="index" close=")">
id = #{id}
</foreach>
</if>
ORDER BY
sort ASC
</select>
</mapper>

39
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.IssueProjectCategoryDictDao">
<!-- sql递归 查询客户议题项目的分类信息以及递归查询二级分类信息 start-->
<resultMap id="categoryTree" type="com.epmet.dto.result.CustomerCategoryListResultDTO">
<id column="id" property="id"/>
<result column="name" property="name"/>
<collection property="subCategory" column="id" ofType="com.epmet.dto.result.CustomerCategoryListResultDTO" select="subCategoryList">
</collection>
</resultMap>
<select id="selectCustomerCategoryList" resultMap="categoryTree">
SELECT
id AS "id",
category_name AS "name"
FROM
issue_project_category_dict
WHERE
del_flag = '0'
AND category_type = '1'
AND customer_id = #{customerId}
ORDER BY sort ASC
</select>
<select id="subCategoryList" resultMap="categoryTree">
SELECT
id AS "id",
category_name AS "name"
FROM
issue_project_category_dict
WHERE
del_flag = '0'
AND pid = #{id}
ORDER BY sort ASC
</select>
<!-- sql递归 查询客户议题项目的分类信息以及递归查询二级分类信息 end-->
</mapper>

8
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectTagDictDao.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.IssueProjectTagDictDao">
</mapper>

19
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueTagsDao.xml

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.IssueTagsDao">
<select id="selectIssueTagList" resultType="com.epmet.dto.result.IssueCategoryTagResultDTO">
SELECT
tag_id AS "id",
tag_name AS "name"
FROM
issue_tags
WHERE
del_flag = '0'
AND issue_id = #{issueId}
ORDER BY
created_time ASC
</select>
</mapper>

96
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

91
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

22
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{}
}

31
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<CustomerCategoryListResultDTO> subCategory;
}

27
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<ProjectCategoryTagResultDTO> categoryList = new ArrayList<>();
/**
* 标签集合
*/
private List<ProjectCategoryTagResultDTO> tagList = new ArrayList<>();
}

25
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;
}

108
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectCategoryController.java

@ -0,0 +1,108 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.controller;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.ProjectCategoryDTO;
import com.epmet.dto.form.ProjectCategoryTagListFormDTO;
import com.epmet.dto.result.ProjectCategoryTagListResultDTO;
import com.epmet.excel.ProjectCategoryExcel;
import com.epmet.service.ProjectCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 项目所属分类表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-08
*/
@RestController
@RequestMapping("projectcategory")
public class ProjectCategoryController {
@Autowired
private ProjectCategoryService projectCategoryService;
@GetMapping("page")
public Result<PageData<ProjectCategoryDTO>> page(@RequestParam Map<String, Object> params){
PageData<ProjectCategoryDTO> page = projectCategoryService.page(params);
return new Result<PageData<ProjectCategoryDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<ProjectCategoryDTO> get(@PathVariable("id") String id){
ProjectCategoryDTO data = projectCategoryService.get(id);
return new Result<ProjectCategoryDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
List<ProjectCategoryDTO> list = projectCategoryService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, ProjectCategoryExcel.class);
}
/**
* @param formDTO
* @return
* @Description 获取项目的分类标签列表
* @Author sun
**/
@PostMapping("categorytaglist")
public Result<ProjectCategoryTagListResultDTO> categoryTagList(@RequestBody ProjectCategoryTagListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ProjectCategoryTagListFormDTO.CategoryTag.class);
return new Result<ProjectCategoryTagListResultDTO>().ok(projectCategoryService.categoryTagList(formDTO));
}
}

94
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<PageData<ProjectTagsDTO>> page(@RequestParam Map<String, Object> params){
PageData<ProjectTagsDTO> page = projectTagsService.page(params);
return new Result<PageData<ProjectTagsDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<ProjectTagsDTO> get(@PathVariable("id") String id){
ProjectTagsDTO data = projectTagsService.get(id);
return new Result<ProjectTagsDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
List<ProjectTagsDTO> list = projectTagsService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, ProjectTagsExcel.class);
}
}

42
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectCategoryDao.java

@ -0,0 +1,42 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.ProjectCategoryEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 项目所属分类表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-08
*/
@Mapper
public interface ProjectCategoryDao extends BaseDao<ProjectCategoryEntity> {
/**
* @Description 查询项目绑定的分类Id集合
* @Author sun
**/
List<String> selectProjectCategoryIdList(@Param("projectId") String projectId);
}

42
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectTagsDao.java

@ -0,0 +1,42 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.ProjectCategoryTagResultDTO;
import com.epmet.entity.ProjectTagsEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 项目关联标签表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-08
*/
@Mapper
public interface ProjectTagsDao extends BaseDao<ProjectTagsEntity> {
/**
* @Description 查询项目绑定的标签按绑定时间升序
* @Author sun
**/
List<ProjectCategoryTagResultDTO> selectProjectTagList(@Param("projectId") String projectId);
}

66
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

61
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

71
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

68
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

47
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}
}

47
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}
}

105
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectCategoryService.java

@ -0,0 +1,105 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.ProjectCategoryDTO;
import com.epmet.dto.form.ProjectCategoryTagListFormDTO;
import com.epmet.dto.result.ProjectCategoryTagListResultDTO;
import com.epmet.entity.ProjectCategoryEntity;
import java.util.List;
import java.util.Map;
/**
* 项目所属分类表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-08
*/
public interface ProjectCategoryService extends BaseService<ProjectCategoryEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ProjectCategoryDTO>
* @author generator
* @date 2020-12-08
*/
PageData<ProjectCategoryDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ProjectCategoryDTO>
* @author generator
* @date 2020-12-08
*/
List<ProjectCategoryDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return ProjectCategoryDTO
* @author generator
* @date 2020-12-08
*/
ProjectCategoryDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-12-08
*/
void save(ProjectCategoryDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-12-08
*/
void update(ProjectCategoryDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-12-08
*/
void delete(String[] ids);
/**
* @param formDTO
* @return
* @Description 获取项目的分类标签列表
* @Author sun
**/
ProjectCategoryTagListResultDTO categoryTagList(ProjectCategoryTagListFormDTO formDTO);
}

95
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<ProjectTagsEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ProjectTagsDTO>
* @author generator
* @date 2020-12-08
*/
PageData<ProjectTagsDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ProjectTagsDTO>
* @author generator
* @date 2020-12-08
*/
List<ProjectTagsDTO> list(Map<String, Object> 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);
}

144
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectCategoryServiceImpl.java

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

104
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<ProjectTagsDao, ProjectTagsEntity> implements ProjectTagsService {
@Autowired
private ProjectTagsRedis projectTagsRedis;
@Override
public PageData<ProjectTagsDTO> page(Map<String, Object> params) {
IPage<ProjectTagsEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ProjectTagsDTO.class);
}
@Override
public List<ProjectTagsDTO> list(Map<String, Object> params) {
List<ProjectTagsEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ProjectTagsDTO.class);
}
private QueryWrapper<ProjectTagsEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<ProjectTagsEntity> 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));
}
}

16
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectCategoryDao.xml

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.ProjectCategoryDao">
<select id="selectProjectCategoryIdList" resultType="java.lang.String">
SELECT
CATEGORY_ID
FROM
project_category
WHERE
DEL_FLAG = '0'
AND PROJECT_ID = #{projectId}
</select>
</mapper>

19
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectTagsDao.xml

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.ProjectTagsDao">
<select id="selectProjectTagList" resultType="com.epmet.dto.result.ProjectCategoryTagResultDTO">
SELECT
tag_id AS "id",
tag_name AS "name"
FROM
project_tags
WHERE
del_flag = '0'
AND project_id = #{projectId}
ORDER BY
created_time ASC
</select>
</mapper>
Loading…
Cancel
Save