Browse Source

1118 代码回滚

feature/dangjian
李鹏飞 6 years ago
parent
commit
abf2bdadbf
  1. 52
      esua-epdc/doc/db/dev_youhua/esua_epdc_user.sql
  2. 4
      esua-epdc/docker-compose/prod/master/application/10.5.34.162-master/docker-compose.yml
  3. 14
      esua-epdc/docker-compose/prod/nginx/docker-compose.yml
  4. 15
      esua-epdc/docker-compose/test/nginx/docker-compose.yml
  5. 15
      esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/constant/RoleTypeKeyConstant.java
  6. 50
      esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/DeptLevelAndLeaderDTO.java
  7. 10
      esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysRoleDTO.java
  8. 4
      esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysSimpleDictDTO.java
  9. 4
      esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/UserSysDeptInfoFormDTO.java
  10. 6
      esua-epdc/epdc-admin/epdc-admin-server/pom.xml
  11. 48
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java
  12. 8
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysRoleController.java
  13. 34
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysUserController.java
  14. 36
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysDeptDao.java
  15. 18
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysRoleDao.java
  16. 63
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/feign/EventFeignClient.java
  17. 41
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/feign/fallback/EventFeignClientFallback.java
  18. 37
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysDeptService.java
  19. 3
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysRoleService.java
  20. 130
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java
  21. 2
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDictServiceImpl.java
  22. 123
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysRoleServiceImpl.java
  23. 2
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysUserServiceImpl.java
  24. 91
      esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysDeptDao.xml
  25. 15
      esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysRoleDao.xml
  26. 6
      esua-epdc/epdc-commons/epdc-common-clienttoken/pom.xml
  27. 12
      esua-epdc/epdc-commons/epdc-common-clienttoken/src/main/java/com/elink/esua/epdc/common/token/dto/TokenDto.java
  28. 20
      esua-epdc/epdc-commons/epdc-common-clienttoken/src/main/java/com/elink/esua/epdc/common/token/util/CpUserDetailRedis.java
  29. 178
      esua-epdc/epdc-commons/epdc-common-clienttoken/src/main/java/com/elink/esua/epdc/common/token/util/IdentityNoAnalysisUtil.java
  30. 36
      esua-epdc/epdc-commons/epdc-commons-mybatis/src/main/java/com/elink/esua/epdc/commons/mybatis/entity/DeptScope.java
  31. 74
      esua-epdc/epdc-commons/epdc-commons-mybatis/src/main/java/com/elink/esua/epdc/commons/mybatis/utils/DeptEntityUtils.java
  32. 2
      esua-epdc/epdc-commons/epdc-commons-tools-wx-ma/pom.xml
  33. 12
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NacosConfigConstant.java
  34. 12
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NumConstant.java
  35. 13
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/PointsConstant.java
  36. 10
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/ServiceConstant.java
  37. 41
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/StrConstant.java
  38. 35
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/UserAuthTypeEnum.java
  39. 28
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/UserTagEnum.java
  40. 40
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsBehaviorCodeEnum.java
  41. 27
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsLimitTimeEnum.java
  42. 24
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsOperationEnum.java
  43. 34
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsOperationModeEnum.java
  44. 26
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsRuleAvailableEnum.java
  45. 36
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsRuleCodeEnum.java
  46. 28
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsUpperLimitEnum.java
  47. 56
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/redis/RedisKeys.java
  48. 5
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/DateUtils.java
  49. 271
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/GPSUtils.java
  50. 51
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/LocalDateUtils.java
  51. 69
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/ModuleUtils.java
  52. 26
      esua-epdc/epdc-gateway/pom.xml
  53. 9
      esua-epdc/epdc-gateway/src/main/resources/application.yml
  54. 0
      esua-epdc/epdc-module/epdc-analysis/db/oracle.sql
  55. 0
      esua-epdc/epdc-module/epdc-analysis/db/postgresql.sql
  56. 0
      esua-epdc/epdc-module/epdc-analysis/db/sqlserver.sql
  57. 64
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/issue/result/IssueResultDTO.java
  58. 63
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/item/result/ItemResultDTO.java
  59. 61
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/topic/result/TopicResultDTO.java
  60. 205
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/pom.xml
  61. 31
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/AnalysisApplication.java
  62. 26
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/config/ModuleConfigImpl.java
  63. 22
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/datasources/DataSourceNames.java
  64. 41
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/datasources/DynamicDataSource.java
  65. 111
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/datasources/DynamicDataSourceConfig.java
  66. 17
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/datasources/annotation/DataSource.java
  67. 61
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/datasources/aspect/DataSourceAspect.java
  68. 52
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/issue/controller/IssueController.java
  69. 31
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/issue/service/IssueService.java
  70. 59
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/IssueServiceImpl.java
  71. 59
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/item/controller/ItemController.java
  72. 24
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemService.java
  73. 41
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java
  74. 71
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/topic/controller/TopicController.java
  75. 49
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/topic/service/TopicService.java
  76. 61
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/topic/service/impl/TopicServiceImpl.java
  77. 21
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/utils/ModuleConstant.java
  78. 74
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/application-dev.yml
  79. 74
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/application-prod.yml
  80. 74
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/application-test.yml
  81. 62
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/application.yml
  82. 1
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/i18n/messages.properties
  83. 1
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/i18n/messages_en_US.properties
  84. 1
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/i18n/messages_zh_CN.properties
  85. 1
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/i18n/messages_zh_TW.properties
  86. 1
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/i18n/validation.properties
  87. 1
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/i18n/validation_en_US.properties
  88. 1
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/i18n/validation_zh_CN.properties
  89. 1
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/i18n/validation_zh_TW.properties
  90. 106
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/issue/IssueDao.xml
  91. 53
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/item/ItemDao.xml
  92. 96
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/topic/TopicDao.xml
  93. 21
      esua-epdc/epdc-module/epdc-analysis/pom.xml
  94. 51
      esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppActUserCancelsignupDTO.java
  95. 80
      esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppActUserClockLogDTO.java
  96. 1
      esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcCompleteUserInfoFormDTO.java
  97. 48
      esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcAppClockListDTO.java
  98. 68
      esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcAppVolunteerRankDTO.java
  99. 12
      esua-epdc/epdc-module/epdc-api/epdc-api-server/pom.xml
  100. 12
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/ApiApplication.java

52
esua-epdc/doc/db/dev_youhua/esua_epdc_user.sql

@ -0,0 +1,52 @@
--------线
ALTER TABLE esua_epdc_user.epdc_party_authentication_failed MODIFY COLUMN `STATE` VARCHAR(1) NULL COMMENT '状态 0-认证失败';
ALTER TABLE esua_epdc_user.epdc_party_authentication_failed MODIFY COLUMN `CADRE_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 0 NULL COMMENT '干部下沉标识 0-否,1-是';
ALTER TABLE esua_epdc_user.epdc_user_authenticate_history ADD AUTHENTICATED_TYPE varchar(2) NOT NULL COMMENT '认证类别(0-居民认证,1-党员认证,2-志愿者认证)';
------------------------------------------------
CREATE TABLE `epdc_handle_category` (
`ID` varchar(32) NOT NULL COMMENT '主键',
`CATEGORY_VAL` int(11) NOT NULL COMMENT '处理类别值',
`CATEGORY_LABEL` varchar(20) NOT NULL COMMENT '处理类别显示信息',
`AVAILABLE` varchar(1) NOT NULL DEFAULT '1' COMMENT '可用状态(0-不可用,1-可用)',
`SORT` int(11) NOT NULL DEFAULT '0' COMMENT '排序',
`REVISION` int(11) DEFAULT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建人',
`CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新人',
`UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间',
`DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识 0:未删除,1:已删除',
`CATEGORY_CODE` varchar(32) NOT NULL COMMENT '处理类型编码',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='处理类别表'
CREATE TABLE `epdc_role_category` (
`ID` varchar(32) NOT NULL COMMENT '主键',
`ROLE_ID` varchar(32) NOT NULL COMMENT '角色ID',
`CATEGORY_ID` varchar(32) NOT NULL COMMENT '处理类别ID',
`REVISION` int(11) DEFAULT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建人',
`CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新人',
`UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间',
`DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识 0:未删除,1:已删除',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色和处理类别关系表'
ALTER TABLE EPDC_HANDLE_ROLE_CATEGORY COMMENT '角色和处理类别关系表';;
CREATE TABLE EPDC_HANDLE_ROLE_DEPT(
ID VARCHAR(32) NOT NULL COMMENT '主键' ,
ROLE_ID VARCHAR(32) NOT NULL COMMENT '角色ID' ,
DEPT_ID VARCHAR(32) NOT NULL COMMENT '部门ID' ,
DEPT_TYPE VARCHAR(50) NOT NULL COMMENT '部门机构类型' ,
REVISION INT COMMENT '乐观锁' ,
CREATED_BY VARCHAR(32) COMMENT '创建人' ,
CREATED_TIME DATETIME COMMENT '创建时间' ,
UPDATED_BY VARCHAR(32) COMMENT '更新人' ,
UPDATED_TIME DATETIME COMMENT '更新时间' ,
PRIMARY KEY (ID)
) COMMENT = '处理部门角色权限表 处理部门角色权限表';;
ALTER TABLE EPDC_HANDLE_ROLE_DEPT COMMENT '处理部门角色权限表';;

4
esua-epdc/docker-compose/prod/master/application/10.5.34.162-master/docker-compose.yml

@ -6,8 +6,8 @@ services:
- 443:443
volumes:
- /mnt/nginx/html:/usr/share/nginx/html
- /mnt/nginx/conf/nginx.conf:/etc/nginx/nginx.conf
- /mnt/nginx/conf.d:/etc/nginx/conf.d
- /mnt/nginx/conf/nginx.conf:/etc/nginx/nginx.conf:ro
- /mnt/nginx/conf.d:/etc/nginx/conf.d:ro
- /mnt/nginx/logs:/var/log/nginx
restart: always
container_name: nginx_master

14
esua-epdc/docker-compose/prod/nginx/docker-compose.yml

@ -0,0 +1,14 @@
version: '3.7'
services:
web:
image: nginx
ports:
- 443:443
volumes:
- /mnt/nginx/html:/usr/share/nginx/html
- /mnt/nginx/conf/nginx.conf:/etc/nginx/nginx.conf:ro
- /mnt/nginx/conf.d:/etc/nginx/conf.d:ro
- /mnt/nginx/logs:/var/log/nginx
restart: always
container_name: nginx_master

15
esua-epdc/docker-compose/test/nginx/docker-compose.yml

@ -0,0 +1,15 @@
version: '3.7'
services:
web:
image: nginx
ports:
- 443:443
volumes:
- /opt/docker/nginx/html:/usr/share/nginx/html
- /opt/docker/nginx/conf/nginx.conf:/etc/nginx/nginx.conf:ro
- /opt/docker/nginx/conf.d:/etc/nginx/conf.d:ro
- /opt/docker/nginx/logs:/var/log/nginx
- /opt/docker/nginx/cert:/etc/nginx/cert:ro
restart: always
container_name: nginx_master

15
esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/constant/RoleTypeKeyConstant.java

@ -0,0 +1,15 @@
package com.elink.esua.epdc.constant;
/**
* TypeKey 常量
*
* @author work@yujt.net.cn
* @date 2019/12/18 10:10
*/
public interface RoleTypeKeyConstant {
/**
* 角色网格长
*/
String ROLE_GRID_LEADER = "gridLeader";
}

50
esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/DeptLevelAndLeaderDTO.java

@ -0,0 +1,50 @@
package com.elink.esua.epdc.dto;
import lombok.Data;
import java.io.Serializable;
/**
* 机构层级关系与机构负责人
*
* @author work@yujt.net.cn
* @date 2019/12/18 10:55
*/
@Data
public class DeptLevelAndLeaderDTO implements Serializable {
private static final long serialVersionUID = 8264059305193996215L;
/**
* 部门ID
*/
private Long deptId;
/**
* 部门名称
*/
private String deptName;
/**
* 父所有部门ID
*/
private String parentDeptIds;
/**
* 父所有部门
*/
private String parentDeptNames;
/**
* 所有部门ID
*/
private String allDeptIds;
/**
* 所有部门名称
*/
private String allDeptNames;
/**
* 部门负责人名称
*/
private String leaderName;
/**
* 部门负责人名称
*/
private String typeKey;
}

10
esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysRoleDTO.java

@ -72,4 +72,14 @@ public class SysRoleDTO implements Serializable {
* app菜单ID列表
*/
private List<Long> appMenuIdList;
/**
* 项目处理类型授权id列表
*/
private List<String> categoryIdList;
/**
* 吹哨部门id列表
*/
private List<Long> whistleDeptIdList;
}

4
esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysSimpleDictDTO.java

@ -28,4 +28,6 @@ public class SysSimpleDictDTO implements Serializable {
@ApiModelProperty(value = "字典值")
private String dictValue;
}
@ApiModelProperty(value = "备注")
private String remark;
}

4
esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/UserSysDeptInfoFormDTO.java

@ -16,14 +16,10 @@ public class UserSysDeptInfoFormDTO implements Serializable {
/**
* 主键集合
*/
// @NotEmpty(message = "deptIdList不能为空")
// @Valid
private List<Long> deptIdList;
/**
* 部门类型键值
*/
// @NotEmpty(message = "部门类型不能为空")
// @Valid
private List<String> typeKeyList;
}

6
esua-epdc/epdc-admin/epdc-admin-server/pom.xml

@ -62,6 +62,12 @@
<artifactId>feign-httpclient</artifactId>
<version>10.3.0</version>
</dependency>
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-events-client</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

48
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java

@ -131,6 +131,7 @@ public class SysDeptController {
public Result<CompleteDeptDTO> getCompleteDept(@PathVariable("gridId") String gridId) {
return sysDeptService.getCompleteDept(gridId);
}
/**
* 通过网格ID获取该网格所有上级机构
*
@ -141,7 +142,7 @@ public class SysDeptController {
*/
@GetMapping("getParentAndAllDept/{deptId}")
public Result<ParentAndAllDeptDTO> getParentAndAllDept(@PathVariable("deptId") String deptId) {
return sysDeptService.getParentAndAllDept(deptId);
return new Result().ok(sysDeptService.getParentAndAllDept(deptId));
}
/**
@ -234,4 +235,49 @@ public class SysDeptController {
PageData<CompleteDeptDTO> page = sysDeptService.listCompleteDeptDTO(params);
return new Result<PageData<CompleteDeptDTO>>().ok(page);
}
/***
* 获取所有网格 kpi模块原始数据
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @author qushutong
* @date 2019/12/12 17:26
*/
@GetMapping("listAllGridId")
public Result listAllGridId() {
return sysDeptService.listAllGridId();
}
/**
* 按部门类型分页查询部门列表
*
* @param typeKey 部门类型
* @param pageSize 页容量
* @param pageIndex 页码
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @author work@yujt.net.cn
* @date 2019/12/17 16:03
*/
@GetMapping("pageDeptIdByTypeKey/{typeKey}/{pageSize}/{pageIndex}")
public Result<List<Long>> pageDeptIdByTypeKey(@PathVariable("typeKey") String typeKey,
@PathVariable("pageSize") Integer pageSize,
@PathVariable("pageIndex") Integer pageIndex) {
return sysDeptService.pageDeptIdByTypeKey(typeKey, pageSize, pageIndex);
}
/**
* 根据部门id获取部门层级关系获取部门领导姓名
*
* @param deptId 部门id
* @param leaderFlag 是否需要查询网格长姓名 0 1
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.DeptLevelAndLeaderDTO>
* @author work@yujt.net.cn
* @date 2019/12/18 11:04
*/
@GetMapping("getDeptInfoById/{deptId}/{leaderFlag}")
public Result<DeptLevelAndLeaderDTO> getDeptInfoById(@PathVariable("deptId") Long deptId,
@PathVariable("leaderFlag") String leaderFlag) {
DeptLevelAndLeaderDTO dto = sysDeptService.getDeptInfoById(deptId, leaderFlag);
return new Result<DeptLevelAndLeaderDTO>().ok(dto);
}
}

8
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysRoleController.java

@ -93,6 +93,14 @@ public class SysRoleController {
List<Long> appMenuIdList = appRoleMenuService.getAppMenuIdList(id);
data.setAppMenuIdList(appMenuIdList);
//查询角色对应的项目处理类型权限
List<String> categoryIdList = sysRoleService.getCategoryIdList(id);
data.setCategoryIdList(categoryIdList);
//查询角色对应的吹哨部门
List<Long> whistleDeptIdList=sysRoleService.getWhistleDeptIdList(id);
data.setWhistleDeptIdList(whistleDeptIdList);
return new Result<SysRoleDTO>().ok(data);
}

34
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysUserController.java

@ -88,6 +88,20 @@ public class SysUserController {
return new Result<SysUserDTO>().ok(data);
}
/**
* @param userId
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < java.lang.Long>>
* @Author yinzuomei
* @Description 查询用户角色Id
* @Date 2020/2/3 8:13
**/
@GetMapping("getRoleIdList/{userId}")
public Result<List<Long>> getRoleIdList(@PathVariable("userId") Long userId) {
//用户角色列表
List<Long> roleIdList = sysRoleUserService.getRoleIdList(userId);
return new Result<List<Long>>().ok(roleIdList);
}
@GetMapping("info")
@ApiOperation("登录用户信息")
public Result<SysUserDTO> info(@ApiIgnore UserDetail user) {
@ -285,8 +299,6 @@ public class SysUserController {
/**
* 组装用户部门多层结构
* <p>auth模块调用用户登录时获取用户机构权限返回页面组装下拉菜单所需数据保存在redis</p>
* <p>组装三层街道-社区-网格</p>
*
* @param userId
* @return com.elink.esua.epdc.commons.tools.utils.Result
@ -301,8 +313,6 @@ public class SysUserController {
/**
* 获取用户部门多层结构用户前端显示请求需携带token
* <p>调接口从redis获取{@link SysUserController#packageUserDeptOption(Long)}接口生成的数据</p>
* <p>此接口展示三级机构层级街道-社区-网格不包括区级</p>
*
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.DeptOption>
* @author work@yujt.net.cn
@ -315,8 +325,6 @@ public class SysUserController {
/**
* 获取用户部门多层结构完整层级结构包括顶级部门用户前端显示请求需携带token
* <p>新闻通知发布选择机构可多选且展示完整层级结构市区-街道-社区-网格</p>
* <P>新闻通知页面主动触发不在用户登录是自动调用</P>
*
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.DeptOption>
* @author work@yujt.net.cn
@ -328,20 +336,6 @@ public class SysUserController {
return new Result().ok(option);
}
/**
* 用户数据分析pc端页面获取用户街道-社区层级关系前端显示请求需携带token
* <p>网格开通情况与用户排名分析页面用只组装街道-社区两级</p>
*
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.DeptOption>
* @author work@yujt.net.cn
* @date 2020/2/10 14:45
*/
@GetMapping("deptOptions/getMiddleByLoginUser")
public Result<DeptOption> getMiddleByLoginUser() {
DeptOption option = sysDeptService.getMiddleByLoginUser();
return new Result().ok(option);
}
/**
* 退出登录
*

36
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysDeptDao.java

@ -9,6 +9,7 @@
package com.elink.esua.epdc.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.CompleteDeptDTO;
import com.elink.esua.epdc.dto.DeptTreeDTO;
import com.elink.esua.epdc.dto.SysDeptDTO;
@ -156,4 +157,39 @@ public interface SysDeptDao extends BaseDao<SysDeptEntity> {
List<CompleteDeptDTO> selectListCompleteDeptDTO(Map<String, Object> params);
List<DeptTreeDTO> selectListDeptTreeForEpiDemic();
/***
* 查询所有网格
* @param
* @return java.util.List<java.lang.Long>
* @author qushutong
* @date 2019/12/12 18:12
*/
List<Long> selectListAllGridId();
/**
* 按部门类型分页查询部门列表
*
* @param typeKey 部门类型
* @param pageSize 页容量
* @param pageIndex 页码
* @return java.util.List<java.lang.Long>
* @author work@yujt.net.cn
* @date 2019/12/17 16:11
*/
List<Long> pageDeptIdByTypeKey(@Param("typeKey") String typeKey,
@Param("pageSize") Integer pageSize,
@Param("pageIndex") Integer pageIndex);
/**
* 根据部门id查询该部门指定角色的用户姓名
*
* @param deptId 部门id
* @param roleType 角色类型
* @return java.lang.String
* @author work@yujt.net.cn
* @date 2019/12/18 13:45
*/
String selectDeptLeaderName(@Param("deptId") Long deptId, @Param("roleType") String roleType);
}

18
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysRoleDao.java

@ -1,8 +1,8 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
*
* <p>
* https://www.renren.io
*
* <p>
* 版权所有侵权必究
*/
@ -12,6 +12,10 @@ import com.elink.esua.epdc.entity.SysRoleEntity;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.entity.SysRoleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 角色管理
@ -22,4 +26,14 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface SysRoleDao extends BaseDao<SysRoleEntity> {
/**
* 根据角色类型获取机构的此类角色数量
*
* @param roleType
* @param deptIdList
* @return java.util.List<java.util.Map < java.lang.String, java.lang.Object>>
* @author work@yujt.net.cn
* @date 2019/12/18 10:20
*/
List<Map<String, Object>> selectAmountByRoleTpye(@Param("roleType") String roleType, @Param("deptIdList") List<Long> deptIdList);
}

63
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/feign/EventFeignClient.java

@ -0,0 +1,63 @@
package com.elink.esua.epdc.feign;
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.handleroledept.form.HandleRoleDeptFormDTO;
import com.elink.esua.epdc.dto.rulecategory.form.HandleRoleCategoryFormDTO;
import com.elink.esua.epdc.feign.fallback.EventFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import java.util.List;
/**
* @Auther: yinzuomei
* @Date: 2019/12/24 09:28
* @Description: 事件接口
*/
@FeignClient(name = ServiceConstant.EPDC_EVENTS_SERVER, fallback = EventFeignClientFallback.class)
public interface EventFeignClient {
/**
* @param orgTypeFormDTO
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @Author yinzuomei
* @Description 保存项目处理类型权限
* @Date 2019/12/24 17:17
**/
@PostMapping(value = "events/handlerolecategory/saveOrUpdate", consumes = MediaType.APPLICATION_JSON_VALUE)
Result saveOrUpdateHandleCategory(HandleRoleCategoryFormDTO orgTypeFormDTO);
/**
* @param roleId
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < java.lang.String>>
* @Author yinzuomei
* @Description 查询角色对应的项目处理类型权限
* @Date 2019/12/24 17:17
**/
@GetMapping(value = "events/handlerolecategory/queryCategoryIdList/{roleId}")
Result<List<String>> queryCategoryIdList(@PathVariable("roleId") Long roleId);
/**
* @param formDTO
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @Author yinzuomei
* @Description 保存角色对应可吹哨部门权限
* @Date 2019/12/26 14:09
**/
@PostMapping(value = "events/handleroledept/saveOrUpdate", consumes = MediaType.APPLICATION_JSON_VALUE)
Result saveOrUpdateHandleRoleDept(HandleRoleDeptFormDTO formDTO);
/**
* @param roleId
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < java.lang.Long>>
* @Author yinzuomei
* @Description 查询角色对应可吹哨部门权限
* @Date 2019/12/26 14:09
**/
@GetMapping(value = "events/handleroledept/queryWhistleDeptIdList/{roleId}")
Result<List<Long>> queryWhistleDeptIdList(@PathVariable("roleId")Long roleId);
}

41
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/feign/fallback/EventFeignClientFallback.java

@ -0,0 +1,41 @@
package com.elink.esua.epdc.feign.fallback;
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant;
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.handleroledept.form.HandleRoleDeptFormDTO;
import com.elink.esua.epdc.dto.rulecategory.form.HandleRoleCategoryFormDTO;
import com.elink.esua.epdc.feign.EventFeignClient;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @Description
* @Author yinzuomei
* @Date 2019/12/24 9:45
*/
@Component
public class EventFeignClientFallback implements EventFeignClient {
@Override
public Result saveOrUpdateHandleCategory(HandleRoleCategoryFormDTO orgTypeFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "saveOrUpdate", orgTypeFormDTO);
}
@Override
public Result<List<String>> queryCategoryIdList(Long roleId) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "queryCategoryIdList", roleId);
}
@Override
public Result saveOrUpdateHandleRoleDept(HandleRoleDeptFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "saveOrUpdate", formDTO);
}
@Override
public Result<List<Long>> queryWhistleDeptIdList(Long roleId) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "queryWhistleDeptIdList", roleId);
}
}

37
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysDeptService.java

@ -79,11 +79,11 @@ public interface SysDeptService extends BaseService<SysDeptEntity> {
* 通过网格ID获取该网格所有上级机构
*
* @param deptId
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.CompleteDeptDTO>
* @return com.elink.esua.epdc.dto.CompleteDeptDTO
* @author yujintao
* @date 2019/9/7 09:13
*/
Result<ParentAndAllDeptDTO> getParentAndAllDept(String deptId);
ParentAndAllDeptDTO getParentAndAllDept(String deptId);
/**
* 通过街道ID获取项目可流转部门
@ -172,7 +172,6 @@ public interface SysDeptService extends BaseService<SysDeptEntity> {
**/
List<UserSysDeptInfoResultDTO> listUserSysDeptInfoResultDTO(UserSysDeptInfoFormDTO formDTO);
/***
* 组装所有部门
* @param
@ -212,18 +211,40 @@ public interface SysDeptService extends BaseService<SysDeptEntity> {
/**
* 获取用户部门多层结构完整层级结构包括顶级部门用户前端显示请求需携带token
*
* @return com.elink.esua.epdc.dto.DeptOption
* @author work@yujt.net.cn
* @date 2020/1/28 10:40
*/
DeptOption getAllDeptOptionByLoginUser();
/***
* 获取所有网格
* @param
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < java.lang.Long>>
* @author qushutong
* @date 2019/12/12 17:29
*/
Result<List<Long>> listAllGridId();
/**
* 按部门类型分页查询部门列表
*
* @param typeKey 部门类型
* @param pageSize 页容量
* @param pageIndex 页码
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < java.lang.Long>>
* @author work@yujt.net.cn
* @date 2019/12/17 16:05
*/
Result<List<Long>> pageDeptIdByTypeKey(String typeKey, Integer pageSize, Integer pageIndex);
/**
* 获取用户部门层级结构街道-社区用户前端显示请求需携带token
* 根据部门id获取部门层级关系获取部门领导姓名
*
* @return com.elink.esua.epdc.dto.DeptOption
* @param deptId 部门id
* @param leaderFlag 是否需要查询网格长姓名 0 1
* @return com.elink.esua.epdc.dto.DeptLevelAndLeaderDTO
* @author work@yujt.net.cn
* @date 2020/2/10 13:38
* @date 2019/12/18 11:05
*/
DeptOption getMiddleByLoginUser();
DeptLevelAndLeaderDTO getDeptInfoById(Long deptId, String leaderFlag);
}

3
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysRoleService.java

@ -36,4 +36,7 @@ public interface SysRoleService extends BaseService<SysRoleEntity> {
void delete(Long[] ids);
List<String> getCategoryIdList(Long id);
List<Long> getWhistleDeptIdList(Long id);
}

130
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java

@ -18,7 +18,9 @@ import com.elink.esua.epdc.commons.tools.constant.Constant;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.constant.NumConstant;
import com.elink.esua.epdc.commons.tools.constant.OrganizationTypeConstant;
import com.elink.esua.epdc.commons.tools.constant.*;
import com.elink.esua.epdc.commons.tools.enums.SuperAdminEnum;
import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum;
import com.elink.esua.epdc.commons.tools.exception.ErrorCode;
import com.elink.esua.epdc.commons.tools.exception.RenException;
import com.elink.esua.epdc.commons.tools.page.PageData;
@ -30,6 +32,7 @@ import com.elink.esua.epdc.commons.tools.security.user.UserDetail;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.utils.TreeUtils;
import com.elink.esua.epdc.constant.RoleTypeKeyConstant;
import com.elink.esua.epdc.dao.SysDeptDao;
import com.elink.esua.epdc.dto.*;
import com.elink.esua.epdc.dto.epdc.GridForLeaderRegisterDTO;
@ -249,7 +252,7 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit
}
@Override
public Result<ParentAndAllDeptDTO> getParentAndAllDept(String deptId) {
public ParentAndAllDeptDTO getParentAndAllDept(String deptId) {
Long deptIdL = null;
try {
deptIdL = Long.parseLong(deptId.trim());
@ -257,7 +260,7 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit
log.error("->getCompleteDept:::部门ID格式转换异常:::deptId->{}", deptId);
}
if (null == deptIdL) {
return new Result().error("参数格式异常");
throw new RenException("参数格式异常");
}
CompleteDeptDTO completeDept = this.baseDao.getParentAndAllDept(deptIdL);
ParentAndAllDeptDTO parentAndAllDeptDTO = new ParentAndAllDeptDTO();
@ -280,11 +283,11 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit
parentAndAllDeptDTO.setAllDeptIds(deptIds);
parentAndAllDeptDTO.setAllDeptNames(deptNames);
} else {
return new Result().error("部门Id错误");
throw new RenException("部门Id错误");
}
return new Result().ok(parentAndAllDeptDTO);
return parentAndAllDeptDTO;
}
@Override
@ -357,56 +360,6 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit
return (DeptOption) obj;
}
@Override
public DeptOption getMiddleByLoginUser() {
Long userId = SecurityUser.getUserId();
String deptOptionKey = RedisKeys.getAdminUserDeptOptionKey(userId);
Object obj = redisUtils.get(deptOptionKey);
if (null == obj) {
this.packageUserDeptOption(userId);
obj = redisUtils.get(deptOptionKey);
}
DeptOption result = (DeptOption) obj;
List<JSONObject> options = result.getOptions();
if (options.isEmpty()) {
return result;
}
// 代表存在子级机构的json key
String childJsonOptionKey = "children";
// 一个街道机构
JSONObject streetOption;
// 一个街道下所有社区机构
JSONArray communityOptionArray;
// 一个社区机构
JSONObject communityOption;
// 循环所有街道
for (int i = options.size() - NumConstant.ONE; i >= NumConstant.ZERO; i--) {
// 取出一个街道
streetOption = options.get(i);
// 街道有children,代表有下级社区(没有children的,其实是区直)
if (null != streetOption.get(childJsonOptionKey)) {
// 获取该街道的所有社区
communityOptionArray = streetOption.getJSONArray(childJsonOptionKey);
if (!communityOptionArray.isEmpty()) {
// 社区不为空,循环所有社区
for (int j = 0; j < communityOptionArray.size(); j++) {
// 取出一个社区
communityOption = communityOptionArray.getJSONObject(j);
// 社区有children,代表有下级网格,
if (null != communityOption.get(childJsonOptionKey)) {
// 移除网格
communityOption.remove(childJsonOptionKey);
}
}
}
} else {
// 移除区直机构
options.remove(i);
}
}
return result;
}
/**
* @param formDTO
* @return java.util.List<com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO>
@ -462,7 +415,7 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit
packageDeptOptionByUser(userId, false);
}
private void packageAllUserDeptOption(Long userId) {
public void packageAllUserDeptOption(Long userId) {
packageDeptOptionByUser(userId, true);
}
@ -784,4 +737,71 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit
List<CompleteDeptDTO> userDtoList = this.baseDao.selectListCompleteDeptDTO(params);
return new PageData<>(userDtoList, iPage.getTotal());
}
@Override
public Result<List<Long>> listAllGridId() {
List<Long> gridIdList = baseDao.selectListAllGridId();
return new Result<List<Long>>().ok(gridIdList);
}
@Override
public Result<List<Long>> pageDeptIdByTypeKey(String typeKey, Integer pageSize, Integer pageIndex) {
if (null == pageSize || null == pageIndex || pageSize < NumConstant.ONE || pageIndex < NumConstant.ONE) {
return new Result().error("参数错误");
}
pageIndex = (pageIndex - NumConstant.ONE) * pageSize;
List<Long> deptIdList = baseDao.pageDeptIdByTypeKey(typeKey, pageSize, pageIndex);
return new Result().ok(deptIdList);
}
@Override
public DeptLevelAndLeaderDTO getDeptInfoById(Long deptId, String leaderFlag) {
if (null == deptId || null == leaderFlag) {
return null;
}
SysDeptEntity sysDeptEntity = baseDao.selectById(deptId);
if (null == sysDeptEntity) {
return null;
}
String deptName = sysDeptEntity.getName();
String pids = sysDeptEntity.getPids();
// 上级机构id
String parentDeptIds = NumConstant.ZERO_STR.equals(pids) ? "" : pids;
// 全部机构id
String allDeptIds = StringUtils.isBlank(pids) ? String.valueOf(deptId) :
pids.concat(StrConstant.COMMA).concat(String.valueOf(deptId));
// 上级机构名称
String parentDeptNames = "";
if (StringUtils.isNotBlank(parentDeptIds)) {
String[] pidArray = parentDeptIds.split(StrConstant.COMMA);
List<String> deptNameList = Lists.newArrayList();
SysDeptEntity dept;
for (int i = 0; i < pidArray.length; i++) {
dept = baseDao.selectById(Long.parseLong(pidArray[i]));
deptNameList.add(dept.getName());
}
parentDeptNames = StringUtils.join(deptNameList, StrConstant.HYPHEN);
}
// 全部机构名称
String allDeptNames = StringUtils.isBlank(parentDeptNames) ? deptName : parentDeptNames.concat(StrConstant.HYPHEN).concat(deptName);
DeptLevelAndLeaderDTO deptLevel = new DeptLevelAndLeaderDTO();
deptLevel.setDeptId(deptId);
deptLevel.setDeptName(deptName);
deptLevel.setParentDeptIds(parentDeptIds);
deptLevel.setParentDeptNames(parentDeptNames);
deptLevel.setAllDeptIds(allDeptIds);
deptLevel.setAllDeptNames(allDeptNames);
deptLevel.setTypeKey(sysDeptEntity.getTypeKey());
if (YesOrNoEnum.YES.value().equals(leaderFlag)) {
String leaderName = baseDao.selectDeptLeaderName(deptId, RoleTypeKeyConstant.ROLE_GRID_LEADER);
deptLevel.setLeaderName(leaderName);
}
redisUtils.set(RedisKeys.getDeptOptionKey(deptId), deptLevel);
return deptLevel;
}
}

2
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDictServiceImpl.java

@ -134,7 +134,7 @@ public class SysDictServiceImpl extends BaseServiceImpl<SysDictDao, SysDictEntit
}
QueryWrapper<SysDictEntity> sdWrapper = new QueryWrapper<>();
sdWrapper.select("dict_value", "dict_name");
sdWrapper.select("dict_value", "dict_name","remark");
sdWrapper.eq("dict_type", dictType);
sdWrapper.ne("dict_value", "");
sdWrapper.isNotNull("dict_value");

123
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysRoleServiceImpl.java

@ -8,25 +8,40 @@
package com.elink.esua.epdc.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.enums.DelFlagEnum;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.Constant;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.constant.NumConstant;
import com.elink.esua.epdc.commons.tools.constant.OrganizationTypeConstant;
import com.elink.esua.epdc.commons.tools.enums.SuperAdminEnum;
import com.elink.esua.epdc.commons.tools.exception.RenException;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser;
import com.elink.esua.epdc.commons.tools.security.user.UserDetail;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dao.SysDeptDao;
import com.elink.esua.epdc.constant.RoleTypeKeyConstant;
import com.elink.esua.epdc.dao.SysRoleDao;
import com.elink.esua.epdc.dto.ParentAndAllDeptDTO;
import com.elink.esua.epdc.dto.SysRoleDTO;
import com.elink.esua.epdc.dto.handleroledept.HandleRoleDeptDTO;
import com.elink.esua.epdc.dto.handleroledept.form.HandleRoleDeptFormDTO;
import com.elink.esua.epdc.dto.rulecategory.form.HandleRoleCategoryFormDTO;
import com.elink.esua.epdc.entity.SysDeptEntity;
import com.elink.esua.epdc.entity.SysRoleEntity;
import com.elink.esua.epdc.feign.EventFeignClient;
import com.elink.esua.epdc.service.*;
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.ArrayList;
import java.util.List;
import java.util.Map;
@ -49,6 +64,12 @@ public class SysRoleServiceImpl extends BaseServiceImpl<SysRoleDao, SysRoleEntit
@Autowired
private AppRoleMenuService appRoleMenuService;
@Autowired
private EventFeignClient eventFeignClient;
@Autowired
private SysDeptDao sysDeptDao;
@Override
public PageData<SysRoleDTO> page(Map<String, Object> params) {
IPage<SysRoleEntity> page = baseDao.selectPage(
@ -101,6 +122,8 @@ public class SysRoleServiceImpl extends BaseServiceImpl<SysRoleDao, SysRoleEntit
public void save(SysRoleDTO dto) {
SysRoleEntity entity = ConvertUtils.sourceToTarget(dto, SysRoleEntity.class);
checkDeptRoleAmount(dto.getTypeKey(), dto.getDeptIdList());
//保存角色
insert(entity);
@ -112,6 +135,51 @@ public class SysRoleServiceImpl extends BaseServiceImpl<SysRoleDao, SysRoleEntit
//保存角色与app菜单关系
appRoleMenuService.saveOrUpdate(entity.getId(), dto.getAppMenuIdList());
//保存角色与项目处理类型关系
HandleRoleCategoryFormDTO categoryFormDTO = new HandleRoleCategoryFormDTO();
categoryFormDTO.setRoleId(entity.getId());
categoryFormDTO.setCategoryIdList(dto.getCategoryIdList());
eventFeignClient.saveOrUpdateHandleCategory(categoryFormDTO);
//保存角色对应的可吹哨部门权限
this.saveOrUpdateWhistleDeptId(entity.getId(), dto.getWhistleDeptIdList());
}
/**
* 根据角色类型获取机构的此类角色数量
*
* @param roleType 角色类型
* @param deptidList 机构id列表
* @return void
* @author work@yujt.net.cn
* @date 2019/12/18 10:14
*/
private void checkDeptRoleAmount(String roleType, List<Long> deptidList) {
if (RoleTypeKeyConstant.ROLE_GRID_LEADER.equals(roleType)) {
List<Map<String, Object>> resultList = baseDao.selectAmountByRoleTpye(roleType, deptidList);
if (CollUtil.isEmpty(resultList)) {
return;
}
Map<String, Object> map;
String mapValue;
for (int i = 0; i < resultList.size(); i++) {
map = resultList.get(i);
mapValue = map.get("typeKey").toString();
if (!mapValue.equals(OrganizationTypeConstant.ORG_TYPE_GRID_PARTY)) {
continue;
}
mapValue = map.get("amount").toString();
if (Integer.parseInt(mapValue) <= NumConstant.THREE) {
continue;
}
mapValue = map.get("id").toString();
ParentAndAllDeptDTO parentAndAllDept = sysDeptService.getParentAndAllDept(mapValue);
throw new RenException("保存失败:" + parentAndAllDept.getAllDeptNames() + ",网格长多于3人");
}
}
}
@Override
@ -130,6 +198,15 @@ public class SysRoleServiceImpl extends BaseServiceImpl<SysRoleDao, SysRoleEntit
//更新角色与app菜单关系
appRoleMenuService.saveOrUpdate(entity.getId(), dto.getAppMenuIdList());
//保存角色与项目处理类型关系
HandleRoleCategoryFormDTO categoryFormDTO = new HandleRoleCategoryFormDTO();
categoryFormDTO.setRoleId(entity.getId());
categoryFormDTO.setCategoryIdList(dto.getCategoryIdList());
eventFeignClient.saveOrUpdateHandleCategory(categoryFormDTO);
//保存角色对应的可吹哨部门权限
this.saveOrUpdateWhistleDeptId(entity.getId(), dto.getWhistleDeptIdList());
}
@Override
@ -144,4 +221,50 @@ public class SysRoleServiceImpl extends BaseServiceImpl<SysRoleDao, SysRoleEntit
//[角色菜单关系、角色数据权限关系、App菜单授权],需要保留,不然逻辑删除就变成物理删除了
}
/**
* @param id
* @return java.util.List<java.lang.String>
* @Author yinzuomei
* @Description 查询角色对应的项目处理类型权限
* @Date 2019/12/24 16:03
**/
@Override
public List<String> getCategoryIdList(Long id) {
Result<List<String>> result = eventFeignClient.queryCategoryIdList(id);
return result.getData();
}
@Override
public List<Long> getWhistleDeptIdList(Long id) {
Result<List<Long>> result = eventFeignClient.queryWhistleDeptIdList(id);
return result.getData();
}
/**
* @param roleId
* @param whistleDeptIdList
* @return void
* @Author yinzuomei
* @Description
* @Date 2019/12/26 13:22
**/
private void saveOrUpdateWhistleDeptId(Long roleId, List<Long> whistleDeptIdList) {
HandleRoleDeptFormDTO formDTO = new HandleRoleDeptFormDTO();
formDTO.setRoleId(roleId.toString());
QueryWrapper<SysDeptEntity> wrapper = new QueryWrapper<>();
wrapper.in(FieldConstant.ID, whistleDeptIdList);
List<SysDeptEntity> deptEntityList = sysDeptDao.selectList(wrapper);
List<HandleRoleDeptDTO> formDTOList = new ArrayList<>();
for (SysDeptEntity dept : deptEntityList) {
HandleRoleDeptDTO handleRoleDeptDTO = new HandleRoleDeptDTO();
handleRoleDeptDTO.setDeptId(dept.getId().toString());
handleRoleDeptDTO.setDeptName(dept.getName());
handleRoleDeptDTO.setDeptType(dept.getTypeKey());
handleRoleDeptDTO.setRoleId(roleId.toString());
formDTOList.add(handleRoleDeptDTO);
}
formDTO.setHandleRoleDeptDTOList(formDTOList);
eventFeignClient.saveOrUpdateHandleRoleDept(formDTO);
}
}

2
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysUserServiceImpl.java

@ -191,7 +191,7 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit
@Override
public Result<GridLeaderRegisterDTO> listGridWhileLeaderRegister(String mobile) {
//TODO:该方法的获取组织结构不灵活,得重构 create by rongchao
QueryWrapper<SysUserEntity> wrapper = new QueryWrapper<>();
wrapper.eq(FieldConstant.MOBILE, mobile)
.eq(FieldConstant.DEL_FLAG, DelFlagEnum.NORMAL.value());

91
esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysDeptDao.xml

@ -5,7 +5,7 @@
<select id="getList" resultType="com.elink.esua.epdc.entity.SysDeptEntity">
select t1.*,(select t2.name from sys_dept t2 where t2.id=t1.pid)parentName from sys_dept t1
where t1.del_flag = 0
where t1.del_flag = 0
<if test="deptIdList != null">
and t1.id in
<foreach item="id" collection="deptIdList" open="(" separator="," close=")">
@ -138,7 +138,7 @@
sys_dept d
LEFT JOIN sys_dept d1 ON d.pids LIKE CONCAT( '%', d1.id, '%' )
WHERE
d.id IN <foreach collection="dataScopeDeptList" item="deptId" open="(" separator="," close=")" > #{deptId} </foreach>
d.id IN <foreach collection="dataScopeDeptList" item="deptId" open="(" separator="," close=")">#{deptId}</foreach>
AND d1.pid = 0
GROUP BY d1.id
ORDER BY d1.create_date ASC
@ -147,8 +147,8 @@
SELECT
tem2.*
FROM
( SELECT * FROM sys_dept d1 WHERE d1.id IN <foreach collection="dataScopeDeptList" item="item" open="(" separator="," close=")" > #{item} </foreach> ) tem1,
( SELECT * FROM sys_dept d2 WHERE d2.pid IN <foreach collection="parentDeptIdList" item="deptId" open="(" separator="," close=")" > #{deptId} </foreach>) tem2
( SELECT * FROM sys_dept d1 WHERE d1.id IN <foreach collection="dataScopeDeptList" item="item" open="(" separator="," close=")">#{item}</foreach> ) tem1,
( SELECT * FROM sys_dept d2 WHERE d2.pid IN <foreach collection="parentDeptIdList" item="deptId" open="(" separator="," close=")">#{deptId}</foreach>) tem2
WHERE
( tem1.PIDS LIKE CONCAT( '%', tem2.id, '%' ) OR tem1.PID = tem2.ID )
OR ( tem2.ID = tem1.ID AND NOT EXISTS ( SELECT 1 FROM sys_dept d WHERE d.PID = tem2.ID ) )
@ -160,35 +160,66 @@
<select id="selectListUserSysDeptInfo" parameterType="com.elink.esua.epdc.dto.epdc.form.UserSysDeptInfoFormDTO"
resultType="com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO">
SELECT
sd.id,
sd.NAME,
sd.pid,
p.NAME AS parentName,
sd.pids,
NULL AS parentNames,
null as street,
null as community,
(case
when sd.type_key='grid_party' then sd.name
else null
end) as grid
sd.id,
sd.NAME,
sd.pid,
p.NAME AS parentName,
sd.pids,
NULL AS parentNames,
null as street,
null as community,
(case
when sd.type_key='grid_party' then sd.name
else null
end) as grid
FROM
sys_dept sd
LEFT JOIN sys_dept p ON ( sd.pid = p.id )
WHERE
sd.del_flag = '0'
<if test="typeKeyList!=null and typeKeyList.size()>0">
AND sd.type_key in
<foreach collection="typeKeyList" item="typeKey" index="index" open="(" close=")" separator=",">
#{typeKey}
</foreach>
</if>
<if test="deptIdList!=null and deptIdList.size()>0">
AND sd.id IN
<foreach collection="deptIdList" item="deptId" index="index" open="(" close=")" separator=",">
#{deptId}
</foreach>
</if>
</select>
<!--查询所有网格-->
<select id="selectListAllGridId" resultType="Long">
SELECT
sd.id
FROM
sys_dept sd
LEFT JOIN sys_dept p ON ( sd.pid = p.id )
WHERE
sd.del_flag = '0'
<if test="typeKeyList!=null and typeKeyList.size()>0">
AND sd.type_key in
<foreach collection="typeKeyList" item="typeKey" index="index" open="(" close=")" separator=",">
#{typeKey}
</foreach>
</if>
<if test="deptIdList!=null and deptIdList.size()>0">
AND sd.id IN
<foreach collection="deptIdList" item="deptId" index="index" open="(" close=")" separator=",">
#{deptId}
</foreach>
</if>
sd.type_key = 'grid_party'
</select>
<select id="pageDeptIdByTypeKey" resultType="java.lang.Long">
SELECT d.id FROM sys_dept d
WHERE d.type_key = #{typeKey} AND d.del_flag = '0' AND d.id != 0
ORDER BY d.create_date ASC
LIMIT #{pageIndex},#{pageSize}
</select>
<select id="selectDeptLeaderName" resultType="java.lang.String">
SELECT
GROUP_CONCAT( u.real_name ) gridLeader
FROM
sys_dept d
LEFT JOIN sys_role_data_scope rds ON rds.dept_id = d.id
LEFT JOIN sys_role r ON rds.role_id = r.id
LEFT JOIN sys_role_user ru ON ru.role_id = r.id
LEFT JOIN sys_user u ON u.id = ru.user_id
WHERE
r.type_key = #{roleType} AND d.id = #{deptId} AND u.id != ''
GROUP BY d.id
</select>
<!--获取所有部门tree-->

15
esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysRoleDao.xml

@ -3,4 +3,19 @@
<mapper namespace="com.elink.esua.epdc.dao.SysRoleDao">
<select id="selectAmountByRoleTpye" resultType="java.util.Map">
SELECT
d.id, d.type_key typeKey, count( u.real_name) amount
FROM
sys_dept d
LEFT JOIN sys_role_data_scope rds ON rds.dept_id = d.id
LEFT JOIN sys_role r ON rds.role_id = r.id
LEFT JOIN sys_role_user ru ON ru.role_id = r.id
LEFT JOIN sys_user u ON u.id = ru.user_id
WHERE
r.type_key = #{roleType} AND u.id != ''
AND d.id in (<foreach collection="deptIdList" item="item" separator=",">#{item}</foreach>)
GROUP BY
d.id
</select>
</mapper>

6
esua-epdc/epdc-commons/epdc-common-clienttoken/pom.xml

@ -23,6 +23,12 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-user-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>

12
esua-epdc/epdc-commons/epdc-common-clienttoken/src/main/java/com/elink/esua/epdc/common/token/dto/TokenDto.java

@ -1,8 +1,11 @@
package com.elink.esua.epdc.common.token.dto;
import com.elink.esua.epdc.dto.UserTagInfo;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 用户token
@ -46,7 +49,12 @@ public class TokenDto implements Serializable {
private Long gridId;
/**
* 党员标识 01
* 性别(女性-0男性-1)
*/
private String partyFlag;
private String sex;
/**
* 用户标签信息列表
*/
private List<UserTagInfo> userTagInfos;
}

20
esua-epdc/epdc-commons/epdc-common-clienttoken/src/main/java/com/elink/esua/epdc/common/token/util/CpUserDetailRedis.java

@ -40,6 +40,26 @@ public class CpUserDetailRedis {
redisUtils.hMSet(key, map, expire);
}
/**
* 缓存用户信息不同于{@link CpUserDetailRedis#set(TokenDto, long)}之处在于存放进redis时拼接key的后缀可以自定义
*
* @param user 用户信息
* @param expire 超时时长
* @param redisKeySuffix redis的key的后缀
* @return void
* @author work@yujt.net.cn
* @date 2020/1/31 15:13
*/
public void set(TokenDto user, long expire, String redisKeySuffix) {
if (user == null) {
return;
}
String key = RedisKeys.getCpUserKey(redisKeySuffix);
//bean to map
Map<String, Object> map = BeanUtil.beanToMap(user, false, true);
redisUtils.hMSet(key, map, expire);
}
/**
* 获取token信息
*

178
esua-epdc/epdc-commons/epdc-common-clienttoken/src/main/java/com/elink/esua/epdc/common/token/util/IdentityNoAnalysisUtil.java

@ -0,0 +1,178 @@
package com.elink.esua.epdc.common.token.util;
import org.apache.commons.lang3.StringUtils;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
/**
* 用户工具类
*
* @author wanggongfeng
* @Date 19-12-16
*/
public class IdentityNoAnalysisUtil {
/**
* 15位身份证号
*/
private static final Integer FIFTEEN_ID_CARD=15;
/**
* 18位身份证号
*/
private static final Integer EIGHTEEN_ID_CARD=18;
private static SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
/**
* 从身份证号码中获取生日
* @param idno
* @return null表示idno错误未获取到生日
*/
public static Date getBirthDay(String idno){
if(!isValid(idno)){
return null;
}
return toBirthDay(idno.substring(6, 14));
}
/**
* 根据身份证号获取性别
* @param IDCard
* @return
*/
public static String getSex(String IDCard){
String sex ="";
if (StringUtils.isNotBlank(IDCard)){
//15位身份证号
if (IDCard.length() == FIFTEEN_ID_CARD){
if (Integer.parseInt(IDCard.substring(14, 15)) % 2 == 0) {
sex = "女";
} else {
sex = "男";
}
//18位身份证号
}else if(IDCard.length() == EIGHTEEN_ID_CARD){
// 判断性别
if (Integer.parseInt(IDCard.substring(16).substring(0, 1)) % 2 == 0) {
sex = "女";
} else {
sex = "男";
}
}
}
return sex;
}
/**
* 根据身份证号获取年龄
* @param IDCard
* @return
*/
public static Integer getAge(String IDCard){
Integer age = 0;
Date date = new Date();
if (StringUtils.isNotBlank(IDCard)&& isValid(IDCard)){
//15位身份证号
if (IDCard.length() == FIFTEEN_ID_CARD){
// 身份证上的年份(15位身份证为1980年前的)
String uyear = "19" + IDCard.substring(6, 8);
// 身份证上的月份
String uyue = IDCard.substring(8, 10);
// 当前年份
String fyear = format.format(date).substring(0, 4);
// 当前月份
String fyue = format.format(date).substring(5, 7);
if (Integer.parseInt(uyue) <= Integer.parseInt(fyue)) {
age = Integer.parseInt(fyear) - Integer.parseInt(uyear) + 1;
// 当前用户还没过生
} else {
age = Integer.parseInt(fyear) - Integer.parseInt(uyear);
}
//18位身份证号
}else if(IDCard.length() == EIGHTEEN_ID_CARD){
// 身份证上的年份
String year = IDCard.substring(6).substring(0, 4);
// 身份证上的月份
String yue = IDCard.substring(10).substring(0, 2);
// 当前年份
String fyear = format.format(date).substring(0, 4);
// 当前月份
String fyue = format.format(date).substring(5, 7);
// 当前月份大于用户出身的月份表示已过生日
if (Integer.parseInt(yue) <= Integer.parseInt(fyue)) {
age = Integer.parseInt(fyear) - Integer.parseInt(year) + 1;
// 当前用户还没过生日
} else {
age = Integer.parseInt(fyear) - Integer.parseInt(year);
}
}
}
return age;
}
/**
* 身份证验证
* @param id 号码内容
* @return 是否有效
*/
public static boolean isValid(String id){
Boolean validResult = true;
//校验长度只能为15或18
int len = id.length();
if (len != FIFTEEN_ID_CARD && len != EIGHTEEN_ID_CARD){
validResult = false;
}
//校验生日
if (!validDate(id)){
validResult = false;
}
return validResult;
}
/**
* 校验生日
* @param id
* @return
*/
private static boolean validDate(String id)
{
try
{
String birth = id.length() == 15 ? "19" + id.substring(6, 12) : id.substring(6, 14);
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
Date birthDate = sdf.parse(birth);
if (!birth.equals(sdf.format(birthDate))){
return false;
}
}
catch (ParseException e)
{
return false;
}
return true;
}
/**
* 转换成日期
* @param birthday
* @return
*/
private static Date toBirthDay(String birthday){
try{
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR, Integer.parseInt(birthday.substring(0, 4)));
calendar.set(Calendar.MONTH, Integer.parseInt(birthday.substring(4, 6)) - 1);//月份从0开始,所以减1
calendar.set(Calendar.DAY_OF_MONTH, Integer.parseInt(birthday.substring(6, 8)));
//以下设置意义不大
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
return calendar.getTime();
}catch (Exception e){
return null;
}
}
}

36
esua-epdc/epdc-commons/epdc-commons-mybatis/src/main/java/com/elink/esua/epdc/commons/mybatis/entity/DeptScope.java

@ -0,0 +1,36 @@
package com.elink.esua.epdc.commons.mybatis.entity;
import lombok.Data;
import java.io.Serializable;
/**
* 部门冗余字段基类
*
* @author rongchao
* @Date 19-12-18
*/
@Data
public abstract class DeptScope extends BaseEpdcEntity implements Serializable {
/***
*所有部门名称
*/
private String allDeptNames;
/***
*所有部门ID
*/
private String allDeptIds;
/***
*父所有部门
*/
private String parentDeptNames;
/***
*父所有部门
*/
private String parentDeptIds;
}

74
esua-epdc/epdc-commons/epdc-commons-mybatis/src/main/java/com/elink/esua/epdc/commons/mybatis/utils/DeptEntityUtils.java

@ -0,0 +1,74 @@
package com.elink.esua.epdc.commons.mybatis.utils;
import com.elink.esua.epdc.commons.mybatis.entity.DeptScope;
import lombok.Data;
/**
* 部门信息实体工具类
*
* @author rongchao
* @Date 19-12-18
*/
public class DeptEntityUtils {
@Data
public static class DeptDto {
/**
* 父所有部门ID
*/
private String parentDeptIds;
/**
* 父所有部门
*/
private String parentDeptNames;
/**
* 所有部门ID
*/
private String allDeptIds;
/**
* 所有部门
*/
private String allDeptNames;
}
/**
* 装载部门信息
*
* @param dto
* @param entityClass
* @return T
* @author rongchao
* @since 2019-12-18
*/
public static <T extends DeptScope> T loadDeptInfo(DeptDto dto, Class<T> entityClass) {
try {
T t = entityClass.newInstance();
t.setAllDeptIds(dto.getAllDeptIds());
t.setAllDeptNames(dto.getAllDeptNames());
t.setParentDeptIds(dto.getParentDeptIds());
t.setParentDeptNames(dto.getParentDeptNames());
return t;
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
return null;
}
/**
* 装载部门信息
*
* @param dto
* @param entity
* @return void
* @author rongchao
* @since 2019-12-18
*/
public static <T extends DeptScope> void loadDeptInfo(DeptDto dto, T entity) {
entity.setAllDeptIds(dto.getAllDeptIds());
entity.setAllDeptNames(dto.getAllDeptNames());
entity.setParentDeptIds(dto.getParentDeptIds());
entity.setParentDeptNames(dto.getParentDeptNames());
}
}

2
esua-epdc/epdc-commons/epdc-commons-tools-wx-ma/pom.xml

@ -31,4 +31,4 @@
</dependency>
</dependencies>
</project>
</project>

12
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NacosConfigConstant.java

@ -0,0 +1,12 @@
package com.elink.esua.epdc.commons.tools.constant;
/**
* Nacos配置中心相关常量
*
* @author rongchao
* @Date 20-1-15
*/
public interface NacosConfigConstant {
String CONFIG_GROUP = "EPDC_CONFIG_GROUP";
}

12
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NumConstant.java

@ -9,17 +9,21 @@ package com.elink.esua.epdc.commons.tools.constant;
*/
public interface NumConstant {
int TWO_NEG = -2;
int ONE_NEG = -1;
int ZERO = 0;
int ONE = 1;
int TWO = 2;
int THREE = 3;
int FOUR = 4;
int SIX = 6;
int ONE_NEG = -1;
int TWO_NEG = -2;
int SEVEN = 7;
int EIGHT = 8;
int NINE = 9;
int TEN = 10;
int ELEVEN = 11;
int TWELVE = 12;
int FIFTEEN = 15;
int TWENTY = 20;
int THIRTY = 30;

13
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/PointsConstant.java

@ -0,0 +1,13 @@
package com.elink.esua.epdc.commons.tools.constant;
/**
* @Auther: yinzuomei
* @Date: 2019/12/16 19:38
* @Description: 积分用
*/
public interface PointsConstant {
/**
* 手动调整积分编码
*/
String ruleCode ="hand_regulation";
}

10
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/ServiceConstant.java

@ -84,4 +84,14 @@ public interface ServiceConstant {
* 定制功能模块
*/
String EPDC_CUSTOM_SERVER = "epdc-custom-server";
/**
* 积分模块
*/
String EPDC_POINTS_SERVER = "epdc-points-server";
/**
* 开放接口模块
*/
String EPDC_API_SERVER = "epdc-api-server";
}

41
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/StrConstant.java

@ -0,0 +1,41 @@
package com.elink.esua.epdc.commons.tools.constant;
import org.apache.commons.codec.CharEncoding;
import org.springframework.http.MediaType;
/**
* 字符串常量
*
* @author work@yujt.net.cn
* @date 2019/12/13 11:19
*/
public interface StrConstant {
String UTF_8 = CharEncoding.UTF_8;
String ISO_8859_1 = CharEncoding.ISO_8859_1;
String JAVASCRIPT = "javascript";
String APPLICATION_JSON_UTF8_VALUE = MediaType.APPLICATION_JSON_UTF8_VALUE;
String EXCEL_SUFFIX_2003 = ".xls";
String EXCEL_SUFFIX_2007 = ".xlsx";
/**
* 连字符号短杠
*/
String HYPHEN = "-";
/**
* 英文逗号
*/
String COMMA = ",";
/**
* 冒号
*/
String COLON = ":";
}

35
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/UserAuthTypeEnum.java

@ -0,0 +1,35 @@
package com.elink.esua.epdc.commons.tools.enums;
/**
* 用户认证类别枚举类
*
* @author rongchao
* @Date 19-12-19
*/
public enum UserAuthTypeEnum {
/**
* 居民认证
*/
RESIDENT_AUTH("0"),
/**
* 党员认证
*/
PARTY_AUTH("1"),
/**
* 志愿者认证
*/
VOLUNTEER_AUTH("2");
private String value;
UserAuthTypeEnum(String value) {
this.value = value;
}
public String value() {
return this.value;
}
}

28
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/UserTagEnum.java

@ -0,0 +1,28 @@
package com.elink.esua.epdc.commons.tools.enums;
/**
* @Auther: yinzuomei
* @Date: 2019/12/17 19:11
* @Description: 用户身份枚举类
*/
public enum UserTagEnum {
/**
* 党员
*/
PARTY_MEMBER("partymember"),
/**
* 志愿者
*/
VOLUNTEER("volunteer");
private String value;
UserTagEnum(String value) {
this.value = value;
}
public String value() {
return this.value;
}
}

40
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsBehaviorCodeEnum.java

@ -0,0 +1,40 @@
package com.elink.esua.epdc.commons.tools.enums.pointsenum;
/**
* @Auther: yinzuomei
* @Date: 2020/2/6 14:01
* @Description: 积分行为编码
*/
public enum PointsBehaviorCodeEnum {
LIKE("like", "赞"),
DISLIKE("dislike", "踩"),
SHARE("share", "分享"),
CLOCK("clock", "打卡"),
COMMENT("comment", "评论"),
BREAK_PROMISE("break_promise", "爽约"),
JOIN_ACT("join_act", "活动积分");
private String behaviorCode;
private String name;
PointsBehaviorCodeEnum(String behaviorCode, String name) {
this.behaviorCode = behaviorCode;
this.name = name;
}
public String getBehaviorCode() {
return behaviorCode;
}
public void setBehaviorCode(String behaviorCode) {
this.behaviorCode = behaviorCode;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

27
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsLimitTimeEnum.java

@ -0,0 +1,27 @@
package com.elink.esua.epdc.commons.tools.enums.pointsenum;
/**
* @Auther: yinzuomei
* @Date: 2019/12/13 09:43
* @Description: 积分规则限制时限枚举类
*/
public enum PointsLimitTimeEnum {
/**
* 限制时限(0-分钟1-小时2-3-4-)
*/
LIMIT_TIME_MINUTE("0"),
LIMIT_TIME_HOUR("1"),
LIMIT_TIME_DAY("2"),
LIMIT_TIME_MONTH("3"),
LIMIT_TIME_YEAR("4");
private String value;
PointsLimitTimeEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
}

24
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsOperationEnum.java

@ -0,0 +1,24 @@
package com.elink.esua.epdc.commons.tools.enums.pointsenum;
/**
* @Auther: yinzuomei
* @Date: 2019/12/13 09:31
* @Description: 积分操作类型枚举类
*/
public enum PointsOperationEnum {
/**
* 规则操作类型(0-减积分1-加积分)
*/
OPERATION_TYPE_ADD("1"),
OPERATION_TYPE_SUBSTRACT("0");
private String operationType;
PointsOperationEnum(String operationType) {
this.operationType = operationType;
}
public String getOperationType() {
return operationType;
}
}

34
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsOperationModeEnum.java

@ -0,0 +1,34 @@
package com.elink.esua.epdc.commons.tools.enums.pointsenum;
/**
* @Auther: yinzuomei
* @Date: 2019/12/13 09:33
* @Description: 积分操作方式枚举类
*/
public enum PointsOperationModeEnum {
/**
* user-用户操作
*/
OPERATION_MODE_USER("user"),
/**
* admin-管理员操作
*/
OPERATION_MODE_ADMIN("admin"),
/**
* sys-系统操作
*/
OPERATION_MODE_SYS("sys");
private String operationMode;
PointsOperationModeEnum(String operationMode) {
this.operationMode = operationMode;
}
public String getOperationMode() {
return operationMode;
}
}

26
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsRuleAvailableEnum.java

@ -0,0 +1,26 @@
package com.elink.esua.epdc.commons.tools.enums.pointsenum;
/**
* @Auther: yinzuomei
* @Date: 2019/12/12 15:04
* @Description: 积分规则可用标志枚举类
*/
public enum PointsRuleAvailableEnum {
/**
* 可用标记(0-不可用1-可用)
*/
AVAILABLE_TRUE("1"),
AVAILABLE_FALSE("0");
private String value;
PointsRuleAvailableEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
}

36
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsRuleCodeEnum.java

@ -0,0 +1,36 @@
package com.elink.esua.epdc.commons.tools.enums.pointsenum;
/**
* @Auther: yinzuomei
* @Date: 2020/2/6 14:00
* @Description: 积分规则编码
*/
public enum PointsRuleCodeEnum {
CANCEL_ACT("cancel_act", "取消报名系统扣减积分"),
CONFIRM_JOIN_ACT("confirm_join_act", "参与活动确认积分");
private String ruleCode;
private String name;
PointsRuleCodeEnum(String ruleCode, String name) {
this.ruleCode = ruleCode;
this.name = name;
}
public String getRuleCode() {
return ruleCode;
}
public void setRuleCode(String ruleCode) {
this.ruleCode = ruleCode;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

28
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsUpperLimitEnum.java

@ -0,0 +1,28 @@
package com.elink.esua.epdc.commons.tools.enums.pointsenum;
/**
* @Auther: yinzuomei
* @Date: 2019/12/13 09:48
* @Description: 积分是否有上限限制 枚举类
*/
public enum PointsUpperLimitEnum {
/**
*
*/
YES("1"),
/**
*
*/
NO("0");
private String value;
PointsUpperLimitEnum(String value) {
this.value = value;
}
public String value() {
return value;
}
}

56
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/redis/RedisKeys.java

@ -128,7 +128,7 @@ public class RedisKeys {
}
/**
* 管理员部门层级关系
* 管理员有数据权限的部门层级关系
*
* @param userId 用户id
* @return java.lang.String
@ -151,6 +151,18 @@ public class RedisKeys {
return rootPrefix.concat("options:dept:user:all:").concat(String.valueOf(userId));
}
/**
* 存放部门层级关系主要用于获取拼接后的部门id和部门名称
*
* @param deptId
* @return java.lang.String
* @author work@yujt.net.cn
* @date 2019/12/20 20:34
*/
public static String getDeptOptionKey(Long deptId) {
return rootPrefix.concat("options:dept:common:").concat(String.valueOf(deptId));
}
/**
* 事件分类
*/
@ -179,4 +191,46 @@ public class RedisKeys {
public static String getAllDeptOptionKeyForEpiDemic() {
return rootPrefix.concat("options:dept:epidemic:all:");
}
/**
* @Author wanggongfeng
* @Description常用语
*/
public static String getPhraseListKey() {
return rootPrefix.concat("heart:phrase:list");
}
/**
* @param ruleCode 积分规则编码
* @return java.lang.String
* @Author yinzuomei
* @Description 积分规则
* @Date 2019/12/12 10:02
**/
public static String getPointsRuleKey(String ruleCode) {
return rootPrefix.concat("config:points:rule:").concat(ruleCode);
}
/**
* 按项目分类设置项目响应/关闭时限
*
* @param categoryId
* @return java.lang.String
* @author work@yujt.net.cn
* @date 2019/12/20 20:38
*/
public static String getKpiItemTimeLimitKey(String categoryId) {
return rootPrefix.concat("config:kpi:itemtimelimit:").concat(categoryId);
}
/**
* 存储议题响应/关闭时限
*
* @return java.lang.String
* @author work@yujt.net.cn
* @date 2019/12/20 20:39
*/
public static String getKpiIssueTimeLimitKey() {
return rootPrefix.concat("config:kpi:itemtimelimit");
}
}

5
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/DateUtils.java

@ -25,11 +25,16 @@ import java.util.Date;
* @since 1.0.0
*/
public class DateUtils {
/** 时间格式(yyyy-MM-dd) */
public final static String DATE_PATTERN = "yyyy-MM-dd";
/** 时间格式(yyyy-MM-dd HH:mm:ss) */
public final static String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss";
/** 时间格式(yyyyMMddHHmmss) */
public final static String DATE_TIME_NO_SPLIT = "yyyyMMddHHmmss";
/**
* 日期格式化 日期格式为yyyy-MM-dd
* @param date 日期

271
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/GPSUtils.java

@ -1,146 +1,155 @@
package com.elink.esua.epdc.commons.tools.utils;
/**
* @Description TODO
* @Description
* @Author yinzuomei
* @Date 2019/12/27 10:00
*/
public class GPSUtils {
public static double pi = 3.1415926535897932384626;
public static double x_pi = 3.14159265358979324 * 3000.0 / 180.0;
public static double a = 6378245.0;
public static double ee = 0.00669342162296594323;
public static double pi = 3.1415926535897932384626;
public static double x_pi = 3.14159265358979324 * 3000.0 / 180.0;
public static double a = 6378245.0;
public static double ee = 0.00669342162296594323;
public static double transformLat(double x, double y) {
double ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y
+ 0.2 * Math.sqrt(Math.abs(x));
ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0;
ret += (20.0 * Math.sin(y * pi) + 40.0 * Math.sin(y / 3.0 * pi)) * 2.0 / 3.0;
ret += (160.0 * Math.sin(y / 12.0 * pi) + 320 * Math.sin(y * pi / 30.0)) * 2.0 / 3.0;
return ret;
}
public static double transformLat(double x, double y) {
double ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y
+ 0.2 * Math.sqrt(Math.abs(x));
ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0;
ret += (20.0 * Math.sin(y * pi) + 40.0 * Math.sin(y / 3.0 * pi)) * 2.0 / 3.0;
ret += (160.0 * Math.sin(y / 12.0 * pi) + 320 * Math.sin(y * pi / 30.0)) * 2.0 / 3.0;
return ret;
}
public static double transformLon(double x, double y) {
double ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1
* Math.sqrt(Math.abs(x));
ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0;
ret += (20.0 * Math.sin(x * pi) + 40.0 * Math.sin(x / 3.0 * pi)) * 2.0 / 3.0;
ret += (150.0 * Math.sin(x / 12.0 * pi) + 300.0 * Math.sin(x / 30.0
* pi)) * 2.0 / 3.0;
return ret;
}
public static double[] transform(double lat, double lon) {
if (outOfChina(lat, lon)) {
return new double[]{lat,lon};
}
double dLat = transformLat(lon - 105.0, lat - 35.0);
double dLon = transformLon(lon - 105.0, lat - 35.0);
double radLat = lat / 180.0 * pi;
double magic = Math.sin(radLat);
magic = 1 - ee * magic * magic;
double sqrtMagic = Math.sqrt(magic);
dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi);
dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi);
double mgLat = lat + dLat;
double mgLon = lon + dLon;
return new double[]{mgLat,mgLon};
}
public static boolean outOfChina(double lat, double lon) {
if (lon < 72.004 || lon > 137.8347)
return true;
if (lat < 0.8293 || lat > 55.8271)
return true;
return false;
}
/**
* 84 to 火星坐标系 (GCJ-02) World Geodetic System ==> Mars Geodetic System
*
* @param lat
* @param lon
* @return
*/
public static double[] gps84_To_Gcj02(double lat, double lon) {
if (outOfChina(lat, lon)) {
return new double[]{lat,lon};
}
double dLat = transformLat(lon - 105.0, lat - 35.0);
double dLon = transformLon(lon - 105.0, lat - 35.0);
double radLat = lat / 180.0 * pi;
double magic = Math.sin(radLat);
magic = 1 - ee * magic * magic;
double sqrtMagic = Math.sqrt(magic);
dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi);
dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi);
double mgLat = lat + dLat;
double mgLon = lon + dLon;
return new double[]{mgLat, mgLon};
}
public static double transformLon(double x, double y) {
double ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1
* Math.sqrt(Math.abs(x));
ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0;
ret += (20.0 * Math.sin(x * pi) + 40.0 * Math.sin(x / 3.0 * pi)) * 2.0 / 3.0;
ret += (150.0 * Math.sin(x / 12.0 * pi) + 300.0 * Math.sin(x / 30.0
* pi)) * 2.0 / 3.0;
return ret;
}
/**
* * 火星坐标系 (GCJ-02) to 84 * * @param lon * @param lat * @return
* */
public static double[] gcj02_To_Gps84(double lat, double lon) {
double[] gps = transform(lat, lon);
double lontitude = lon * 2 - gps[1];
double latitude = lat * 2 - gps[0];
return new double[]{latitude, lontitude};
}
/**
* 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换算法 GCJ-02 坐标转换成 BD-09 坐标
*
* @param lat
* @param lon
*/
public static double[] gcj02_To_Bd09(double lat, double lon) {
double x = lon, y = lat;
double z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi);
double theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi);
double tempLon = z * Math.cos(theta) + 0.0065;
double tempLat = z * Math.sin(theta) + 0.006;
double[] gps = {tempLat,tempLon};
return gps;
}
public static double[] transform(double lat, double lon) {
if (outOfChina(lat, lon)) {
return new double[]{lat, lon};
}
double dLat = transformLat(lon - 105.0, lat - 35.0);
double dLon = transformLon(lon - 105.0, lat - 35.0);
double radLat = lat / 180.0 * pi;
double magic = Math.sin(radLat);
magic = 1 - ee * magic * magic;
double sqrtMagic = Math.sqrt(magic);
dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi);
dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi);
double mgLat = lat + dLat;
double mgLon = lon + dLon;
return new double[]{mgLat, mgLon};
}
/**
* * 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换算法 * * BD-09 坐标转换成GCJ-02 坐标 * * @param
* bd_lat * @param bd_lon * @return
*/
public static double[] bd09_To_Gcj02(double lat, double lon) {
double x = lon - 0.0065, y = lat - 0.006;
double z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi);
double theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi);
double tempLon = z * Math.cos(theta);
double tempLat = z * Math.sin(theta);
double[] gps = {tempLat,tempLon};
return gps;
}
public static boolean outOfChina(double lat, double lon) {
if (lon < 72.004 || lon > 137.8347)
return true;
if (lat < 0.8293 || lat > 55.8271)
return true;
return false;
}
/**将gps84转为bd09
* @param lat
* @param lon
* @return
*/
public static double[] gps84_To_bd09(double lat,double lon){
double[] gcj02 = gps84_To_Gcj02(lat,lon);
double[] bd09 = gcj02_To_Bd09(gcj02[0],gcj02[1]);
return bd09;
}
public static double[] bd09_To_gps84(double lat,double lon){
double[] gcj02 = bd09_To_Gcj02(lat, lon);
double[] gps84 = gcj02_To_Gps84(gcj02[0], gcj02[1]);
//保留小数点后六位
gps84[0] = retain6(gps84[0]);
gps84[1] = retain6(gps84[1]);
return gps84;
}
/**
* 84 to 火星坐标系 (GCJ-02) World Geodetic System ==> Mars Geodetic System
*
* @param lat
* @param lon
* @return
*/
public static double[] gps84_To_Gcj02(double lat, double lon) {
if (outOfChina(lat, lon)) {
return new double[]{lat, lon};
}
double dLat = transformLat(lon - 105.0, lat - 35.0);
double dLon = transformLon(lon - 105.0, lat - 35.0);
double radLat = lat / 180.0 * pi;
double magic = Math.sin(radLat);
magic = 1 - ee * magic * magic;
double sqrtMagic = Math.sqrt(magic);
dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi);
dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi);
double mgLat = lat + dLat;
double mgLon = lon + dLon;
return new double[]{mgLat, mgLon};
}
/**保留小数点后六位
* @param num
* @return
*/
private static double retain6(double num){
String result = String .format("%.6f", num);
return Double.valueOf(result);
}
/**
* * 火星坐标系 (GCJ-02) to 84 * * @param lon * @param lat * @return
*/
public static double[] gcj02_To_Gps84(double lat, double lon) {
double[] gps = transform(lat, lon);
double lontitude = lon * 2 - gps[1];
double latitude = lat * 2 - gps[0];
return new double[]{latitude, lontitude};
}
/**
* 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换算法 GCJ-02 坐标转换成 BD-09 坐标
*
* @param lat
* @param lon
*/
public static double[] gcj02_To_Bd09(double lat, double lon) {
double x = lon, y = lat;
double z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi);
double theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi);
double tempLon = z * Math.cos(theta) + 0.0065;
double tempLat = z * Math.sin(theta) + 0.006;
double[] gps = {tempLat, tempLon};
return gps;
}
/**
* * 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换算法 * * BD-09 坐标转换成GCJ-02 坐标 * * @param
* bd_lat * @param bd_lon * @return
*/
public static double[] bd09_To_Gcj02(double lat, double lon) {
double x = lon - 0.0065, y = lat - 0.006;
double z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi);
double theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi);
double tempLon = z * Math.cos(theta);
double tempLat = z * Math.sin(theta);
double[] gps = {tempLat, tempLon};
return gps;
}
/**
* 将gps84转为bd09
*
* @param lat
* @param lon
* @return
*/
public static double[] gps84_To_bd09(double lat, double lon) {
double[] gcj02 = gps84_To_Gcj02(lat, lon);
double[] bd09 = gcj02_To_Bd09(gcj02[0], gcj02[1]);
return bd09;
}
public static double[] bd09_To_gps84(double lat, double lon) {
double[] gcj02 = bd09_To_Gcj02(lat, lon);
double[] gps84 = gcj02_To_Gps84(gcj02[0], gcj02[1]);
//保留小数点后六位
gps84[0] = retain6(gps84[0]);
gps84[1] = retain6(gps84[1]);
return gps84;
}
/**
* 保留小数点后六位
*
* @param num
* @return
*/
private static double retain6(double num) {
String result = String.format("%.6f", num);
return Double.valueOf(result);
}
}

51
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/LocalDateUtils.java

@ -0,0 +1,51 @@
package com.elink.esua.epdc.commons.tools.utils;
import java.time.*;
import java.util.Date;
/**
* @author work@yujt.net.cn
* @date 2019/12/13 15:05
*/
public class LocalDateUtils {
public static LocalDateTime dateToLocalDateTime(Date date) {
Instant instant = date.toInstant();
ZoneId zone = ZoneId.systemDefault();
return LocalDateTime.ofInstant(instant, zone);
}
public static LocalDate dateToLocalDate(Date date) {
Instant instant = date.toInstant();
ZoneId zone = ZoneId.systemDefault();
LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, zone);
return localDateTime.toLocalDate();
}
public static YearMonth dateToYearMonth(Date date) {
LocalDate localDate = dateToLocalDate(date);
return YearMonth.of(localDate.getYear(), localDate.getMonthValue());
}
public static LocalTime dateToLocalTime(Date date) {
Instant instant = date.toInstant();
ZoneId zone = ZoneId.systemDefault();
LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, zone);
return localDateTime.toLocalTime();
}
public static Date localDateTimeToDate(LocalDateTime localDateTime) {
ZoneId zone = ZoneId.systemDefault();
Instant instant = localDateTime.atZone(zone).toInstant();
return Date.from(instant);
}
public static Date localDateToDate(LocalDate localDate) {
ZoneId zone = ZoneId.systemDefault();
Instant instant = localDate.atStartOfDay().atZone(zone).toInstant();
return Date.from(instant);
}
}

69
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/ModuleUtils.java

@ -1,8 +1,16 @@
package com.elink.esua.epdc.commons.tools.utils;
import com.alibaba.fastjson.JSON;
import com.elink.esua.epdc.commons.tools.constant.StrConstant;
import com.elink.esua.epdc.commons.tools.exception.RenException;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.CharEncoding;
import org.springframework.util.Base64Utils;
import org.springframework.util.StringUtils;
import java.io.UnsupportedEncodingException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.UUID;
/**
@ -40,7 +48,66 @@ public class ModuleUtils {
* @date 2019/9/5 14:44
*/
public static String generateUUID() {
return UUID.randomUUID().toString().replace("-", "");
return UUID.randomUUID().toString().replace(StrConstant.HYPHEN, "");
}
/**
* 字符串转换为base64
*
* @param params
* @return java.lang.String
* @author work@yujt.net.cn
* @date 2020/2/6 16:39
*/
public static String encodeByBase64(String params) {
if (StringUtils.isEmpty(params)) {
return null;
}
try {
return Base64Utils.encodeToUrlSafeString(params.getBytes(CharEncoding.UTF_8));
} catch (UnsupportedEncodingException e) {
throw new RenException("字符串编码方法异常");
}
}
/**
* base64解码
*
* @param base64Str
* @return java.lang.String
* @author work@yujt.net.cn
* @date 2020/2/6 16:48
*/
public static String decodeFromBase64(String base64Str) {
if (StringUtils.isEmpty(base64Str)) {
return null;
}
try {
return new String(Base64Utils.decodeFromUrlSafeString(base64Str), CharEncoding.UTF_8);
} catch (UnsupportedEncodingException e) {
throw new RenException("字符串编码方法异常");
}
}
/**
* 验证字符串是否是日期格式
*
* @param str 被验证的字符串
* @param dateFormat 指定日期格式
* @return boolean
* @author work@yujt.net.cn
* @date 2020/2/7 10:53
*/
public static boolean isValidDate(String str, String dateFormat) {
boolean convertSuccess = true;
// 指定日期格式
SimpleDateFormat format = new SimpleDateFormat(dateFormat);
try {
format.setLenient(false);
format.parse(str);
} catch (ParseException e) {
convertSuccess = false;
}
return convertSuccess;
}
}

26
esua-epdc/epdc-gateway/pom.xml

@ -99,12 +99,12 @@
<!-- gateway routes -->
<gateway.routes.epdc-auth-server.uri>lb://epdc-auth-server</gateway.routes.epdc-auth-server.uri>
<!-- <gateway.routes.epdc-admin-server.uri>lb://epdc-admin-server</gateway.routes.epdc-admin-server.uri>-->
<gateway.routes.epdc-admin-server.uri>http://127.0.0.1:9092</gateway.routes.epdc-admin-server.uri>
<gateway.routes.epdc-admin-server.uri>lb://epdc-admin-server</gateway.routes.epdc-admin-server.uri>
<!-- <gateway.routes.epdc-admin-server.uri>http://127.0.0.1:9092</gateway.routes.epdc-admin-server.uri>-->
<gateway.routes.epdc-activiti-server.uri>lb://epdc-activiti-server
</gateway.routes.epdc-activiti-server.uri>
<gateway.routes.epdc-api-server.uri>lb://epdc-api-server</gateway.routes.epdc-api-server.uri>
<!-- <gateway.routes.epdc-api-server.uri>http://127.0.0.1:9040</gateway.routes.epdc-api-server.uri>-->
<!--<gateway.routes.epdc-api-server.uri>lb://epdc-api-server</gateway.routes.epdc-api-server.uri>-->
<gateway.routes.epdc-api-server.uri>http://127.0.0.1:9040</gateway.routes.epdc-api-server.uri>
<gateway.routes.epdc-app-server.uri>lb://epdc-app-server</gateway.routes.epdc-app-server.uri>
<!-- <gateway.routes.epdc-app-server.uri>http://127.0.0.1:9058</gateway.routes.epdc-app-server.uri>-->
<gateway.routes.epdc-heart-server.uri>lb://epdc-heart-server</gateway.routes.epdc-heart-server.uri>
@ -127,11 +127,11 @@
<gateway.routes.epdc-group-server.uri>http://127.0.0.1:9063</gateway.routes.epdc-group-server.uri>
<!--<gateway.routes.epdc-group-server.uri>lb://epdc-group-server</gateway.routes.epdc-group-server.uri>-->
<gateway.routes.epdc-websocket-server.uri>lb://epdc-websocket-server</gateway.routes.epdc-websocket-server.uri>
<gateway.routes.epdc-kpi-server.uri>lb://epdc-kpi-server</gateway.routes.epdc-kpi-server.uri>
<!-- <gateway.routes.epdc-custom-server.uri>http://127.0.0.1:9076</gateway.routes.epdc-kpi-server.uri>-->
<gateway.routes.epdc-custom-server.uri>lb://epdc-custom-server</gateway.routes.epdc-custom-server.uri>
<!-- <gateway.routes.epdc-analysis-server.uri>http://127.0.0.1:9077</gateway.routes.epdc-analysis-server.uri>-->
<gateway.routes.epdc-analysis-server.uri>lb://epdc-analysis-server</gateway.routes.epdc-analysis-server.uri>
<gateway.routes.epdc-points-server.uri>lb://epdc-points-server</gateway.routes.epdc-points-server.uri>
<!-- <gateway.routes.epdc-kpi-server.uri>lb://epdc-kpi-server</gateway.routes.epdc-kpi-server.uri>-->
<gateway.routes.epdc-kpi-server.uri>http://127.0.0.1:9069</gateway.routes.epdc-kpi-server.uri>
<!-- nacos -->
<nacos.register-enabled>false</nacos.register-enabled>
<nacos.server-addr>47.104.224.45:8848</nacos.server-addr>
@ -169,10 +169,11 @@
<gateway.routes.epdc-user-server.uri>lb://epdc-user-server</gateway.routes.epdc-user-server.uri>
<gateway.routes.epdc-demo-server.uri>lb://epdc-demo-server</gateway.routes.epdc-demo-server.uri>
<gateway.routes.epdc-group-server.uri>lb://epdc-group-server</gateway.routes.epdc-group-server.uri>
<gateway.routes.epdc-websocket-server.uri>lb://epdc-websocket-server</gateway.routes.epdc-websocket-server.uri>
<gateway.routes.epdc-websocket-server.uri>lb://epdc-websocket-server
</gateway.routes.epdc-websocket-server.uri>
<gateway.routes.epdc-kpi-server.uri>lb://epdc-kpi-server</gateway.routes.epdc-kpi-server.uri>
<gateway.routes.epdc-custom-server.uri>lb://epdc-custom-server</gateway.routes.epdc-custom-server.uri>
<gateway.routes.epdc-analysis-server.uri>lb://epdc-analysis-server</gateway.routes.epdc-analysis-server.uri>
<gateway.routes.epdc-points-server.uri>lb://epdc-points-server</gateway.routes.epdc-points-server.uri>
<!-- nacos -->
<nacos.register-enabled>true</nacos.register-enabled>
@ -206,10 +207,11 @@
<gateway.routes.epdc-user-server.uri>lb://epdc-user-server</gateway.routes.epdc-user-server.uri>
<gateway.routes.epdc-demo-server.uri>lb://epdc-demo-server</gateway.routes.epdc-demo-server.uri>
<gateway.routes.epdc-group-server.uri>lb://epdc-group-server</gateway.routes.epdc-group-server.uri>
<gateway.routes.epdc-websocket-server.uri>lb://epdc-websocket-server</gateway.routes.epdc-websocket-server.uri>
<gateway.routes.epdc-websocket-server.uri>lb://epdc-websocket-server
</gateway.routes.epdc-websocket-server.uri>
<gateway.routes.epdc-kpi-server.uri>lb://epdc-kpi-server</gateway.routes.epdc-kpi-server.uri>
<gateway.routes.epdc-custom-server.uri>lb://epdc-custom-server</gateway.routes.epdc-custom-server.uri>
<gateway.routes.epdc-analysis-server.uri>lb://epdc-analysis-server</gateway.routes.epdc-analysis-server.uri>
<gateway.routes.epdc-points-server.uri>lb://epdc-points-server</gateway.routes.epdc-points-server.uri>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
@ -249,7 +251,6 @@
<gateway.routes.epdc-websocket-server.uri>lb://epdc-websocket-server</gateway.routes.epdc-websocket-server.uri>
<gateway.routes.epdc-kpi-server.uri>lb://epdc-kpi-server</gateway.routes.epdc-kpi-server.uri>
<gateway.routes.epdc-custom-server.uri>lb://epdc-custom-server</gateway.routes.epdc-custom-server.uri>
<gateway.routes.epdc-analysis-server.uri>lb://epdc-analysis-server</gateway.routes.epdc-analysis-server.uri>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
@ -290,7 +291,6 @@
<gateway.routes.epdc-websocket-server.uri>lb://epdc-websocket-server</gateway.routes.epdc-websocket-server.uri>
<gateway.routes.epdc-kpi-server.uri>lb://epdc-kpi-server</gateway.routes.epdc-kpi-server.uri>
<gateway.routes.epdc-custom-server.uri>lb://epdc-custom-server</gateway.routes.epdc-custom-server.uri>
<gateway.routes.epdc-analysis-server.uri>lb://epdc-analysis-server</gateway.routes.epdc-analysis-server.uri>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>

9
esua-epdc/epdc-gateway/src/main/resources/application.yml

@ -162,12 +162,12 @@ spring:
- Path=${server.servlet.context-path}/custom/**
filters:
- StripPrefix=1
#数据分析模块
- id: epdc-analysis-server
uri: @gateway.routes.epdc-analysis-server.uri@
#积分管理
- id: epdc-points-server
uri: @gateway.routes.epdc-points-server.uri@
order: 18
predicates:
- Path=${server.servlet.context-path}/analysis/**
- Path=${server.servlet.context-path}/points/**
filters:
- StripPrefix=1
nacos:
@ -222,7 +222,6 @@ renren:
- /activiti/service/**
- /activiti/editor-app/**
- /message/sms/sendCode #发送验证码
- /heart/**
- /oss/file/download
- /ws/**
workLoginUrls:

0
esua-epdc/epdc-module/epdc-analysis/db/oracle.sql

0
esua-epdc/epdc-module/epdc-analysis/db/postgresql.sql

0
esua-epdc/epdc-module/epdc-analysis/db/sqlserver.sql

64
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/issue/result/IssueResultDTO.java

@ -1,64 +0,0 @@
package com.elink.esua.epdc.dto.issue.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Description 议题列表DTO
* @Author yinzuomei
* @Date 2020/2/10 15:58
*/
@Data
public class IssueResultDTO implements Serializable {
/**
* epdc_issue主键
*/
private String id;
/**
* 议题内容
*/
private String issueContent;
/**
* 来源网格-所有部门
*/
private String allDeptNames;
/**
* 用户昵称
*/
private String nickName;
/**
* 发布时间
*/
private Date createdTime;
/**
* 支持-点赞次数
*/
private Integer approveNum;
/**
* 反对-踩次数
*/
private Integer opposeNum;
/**
* 评论数
*/
private Integer commentNum;
/**
* 浏览数
*/
private Integer browseNum;
/**
* 表达态度评论+回复+浏览
*/
private Integer expressAttitudeNum;
}

63
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/item/result/ItemResultDTO.java

@ -1,63 +0,0 @@
package com.elink.esua.epdc.dto.item.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Description 项目列表DTO
* @Author yinzuomei
* @Date 2020/2/10 13:44
*/
@Data
public class ItemResultDTO implements Serializable {
/**
* epdc_item表主键
*/
private String id;
/**
* 议题内容-项目摘要
*/
private String itemContent;
/**
* 所有部门
*/
private String allDeptNames;
/**
* 发布人用户昵称
*/
private String nickName;
/**
* 发布时间
*/
private Date releaseTime;
/**
* 支持-点赞次数
*/
private Integer approveNum;
/**
* 反对-踩次数
*/
private Integer opposeNum;
/**
* 评论数
*/
private Integer commentNum;
/**
* 浏览数
*/
private Integer browseNum;
/**
* 表达态度评论+回复+浏览
*/
private Integer expressAttitudeNum;
}

61
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/topic/result/TopicResultDTO.java

@ -1,61 +0,0 @@
package com.elink.esua.epdc.dto.topic.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Description 话题列表DTO
* @Author yinzuomei
* @Date 2020/2/10 11:31
*/
@Data
public class TopicResultDTO implements Serializable {
private static final long serialVersionUID = -1938141144074477454L;
/**
* 主键
*/
private String id;
/**
* 话题摘要
*/
private String topicContent;
/**
* 所有部门
*/
private String allDeptNames;
/**
* 网格来源群名称
*/
private String groupName;
/**
* 话题发布人姓名
*/
private String nickName;
/**
* 发布时间
*/
private Date releaseTime;
/**
* 评论数评论+回复
*/
private Integer commentNum;
/**
* 浏览数
*/
private Integer browseNum;
/**
* 表达态度评论+回复+浏览
*/
private Integer expressAttitudeNum;
}

205
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/pom.xml

@ -1,205 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-analysis</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>epdc-analysis-server</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-analysis-client</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-commons-tools</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-commons-mybatis</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>${spring.boot.admin.version}</version>
</dependency>
<!-- nacos start -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- nacos end -->
<!--版本控制-->
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-commons-api-version-control</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
</plugin>
</plugins>
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
<resources>
<resource>
<filtering>true</filtering>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>**/application*.yml</include>
<include>**/*.properties</include>
<include>logback-spring.xml</include>
<include>registry.conf</include>
</includes>
</resource>
<resource>
<directory>${basedir}/src/main/resources</directory>
<excludes>
<exclude>**/application*.yml</exclude>
<exclude>**/*.properties</exclude>
<exclude>logback-spring.xml</exclude>
<exclude>registry.conf</exclude>
</excludes>
</resource>
</resources>
</build>
<profiles>
<profile>
<id>dev</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<spring.profiles.active>dev</spring.profiles.active>
<server.port>9077</server.port>
<spring.redis.index>2</spring.redis.index>
<spring.redis.host>47.104.224.45</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>elink@888</spring.redis.password>
<nacos.register-enabled>false</nacos.register-enabled>
<nacos.server-addr>47.104.224.45:8848</nacos.server-addr>
</properties>
</profile>
<profile>
<id>test</id>
<properties>
<spring.profiles.active>test</spring.profiles.active>
<server.port>9077</server.port>
<spring.redis.index>2</spring.redis.index>
<spring.redis.host>47.104.224.45</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>elink@888</spring.redis.password>
<nacos.register-enabled>true</nacos.register-enabled>
<nacos.server-addr>47.104.224.45:8848</nacos.server-addr>
</properties>
</profile>
<profile>
<id>prod</id>
<properties>
<spring.profiles.active>prod</spring.profiles.active>
<server.port>9077</server.port>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>10.5.34.164</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>Elink@833066</spring.redis.password>
<!-- nacos -->
<nacos.register-enabled>true</nacos.register-enabled>
<nacos.server-addr>10.5.34.164:8848</nacos.server-addr>
</properties>
</profile>
<profile>
<id>prod_kongcun</id>
<properties>
<spring.profiles.active>prod</spring.profiles.active>
<server.port>9077</server.port>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>172.16.1.238</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>Elink833066</spring.redis.password>
<!-- nacos -->
<nacos.register-enabled>true</nacos.register-enabled>
<nacos.server-addr>172.16.1.238:8848</nacos.server-addr>
</properties>
</profile>
<profile>
<id>prod_shibei_aliyun</id>
<properties>
<spring.profiles.active>prod</spring.profiles.active>
<server.port>9077</server.port>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>172.16.0.54</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>Elink833066</spring.redis.password>
<!-- nacos -->
<nacos.register-enabled>true</nacos.register-enabled>
<nacos.server-addr>172.16.0.52:8848</nacos.server-addr>
</properties>
</profile>
</profiles>
</project>

31
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/AnalysisApplication.java

@ -1,31 +0,0 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有侵权必究
*/
package com.elink.esua.epdc;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
/**
* 模块
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
public class AnalysisApplication {
public static void main(String[] args) {
SpringApplication.run(AnalysisApplication.class, args);
}
}

26
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/config/ModuleConfigImpl.java

@ -1,26 +0,0 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
* <p>
* https://www.renren.io
* <p>
* 版权所有侵权必究
*/
package com.elink.esua.epdc.config;
import com.elink.esua.epdc.commons.tools.config.ModuleConfig;
import org.springframework.stereotype.Service;
/**
* 模块配置信息
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
@Service
public class ModuleConfigImpl implements ModuleConfig {
@Override
public String getName() {
return "analysis";
}
}

22
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/datasources/DataSourceNames.java

@ -1,22 +0,0 @@
package com.elink.esua.epdc.datasources;
/**
*
* 增加多数据源在此配置
*
* @Authorliuchuang
* @Date2020/2/9 14:50
*/
public interface DataSourceNames {
String FIRST = "first";
String SECOND = "second";
String THIRD = "third";
String FOURTH = "fourth";
String FIFTH = "fifth";
String SIXTH = "sixth";
String SEVENTH = "seventh";
String EIGHTH = "eighth";
String NINTH = "ninth";
String TENTH = "tenth";
String ELEVENTH = "eleventh";
}

41
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/datasources/DynamicDataSource.java

@ -1,41 +0,0 @@
package com.elink.esua.epdc.datasources;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
import javax.sql.DataSource;
import java.util.Map;
/**
*
* 动态数据源
*
* @Authorliuchuang
* @Date2020/2/9 14:59
*/
public class DynamicDataSource extends AbstractRoutingDataSource {
private static final ThreadLocal<String> contextHolder = new ThreadLocal<>();
public DynamicDataSource(DataSource defaultTargetDataSource, Map<Object, Object> targetDataSources) {
super.setDefaultTargetDataSource(defaultTargetDataSource);
super.setTargetDataSources(targetDataSources);
super.afterPropertiesSet();
}
@Override
protected Object determineCurrentLookupKey() {
return getDataSource();
}
public static void setDataSource(String dataSource) {
contextHolder.set(dataSource);
}
public static String getDataSource() {
return contextHolder.get();
}
public static void clearDataSource() {
contextHolder.remove();
}
}

111
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/datasources/DynamicDataSourceConfig.java

@ -1,111 +0,0 @@
package com.elink.esua.epdc.datasources;
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import javax.sql.DataSource;
import java.util.HashMap;
import java.util.Map;
/**
*
* 配置多数据源
*
* @Authorliuchuang
* @Date2020/2/9 15:04
*/
@Configuration
public class DynamicDataSourceConfig {
@Bean
@ConfigurationProperties("spring.datasource.druid.first")
public DataSource firstDataSource() {
return DruidDataSourceBuilder.create().build();
}
@Bean
@ConfigurationProperties("spring.datasource.druid.second")
public DataSource secondDataSource() {
return DruidDataSourceBuilder.create().build();
}
@Bean
@ConfigurationProperties("spring.datasource.druid.third")
public DataSource thirdDataSource() {
return DruidDataSourceBuilder.create().build();
}
@Bean
@ConfigurationProperties("spring.datasource.druid.fourth")
public DataSource fourthDataSource() {
return DruidDataSourceBuilder.create().build();
}
@Bean
@ConfigurationProperties("spring.datasource.druid.fifth")
public DataSource fifthDataSource() {
return DruidDataSourceBuilder.create().build();
}
@Bean
@ConfigurationProperties("spring.datasource.druid.sixth")
public DataSource sixthDataSource() {
return DruidDataSourceBuilder.create().build();
}
@Bean
@ConfigurationProperties("spring.datasource.druid.seventh")
public DataSource seventhDataSource() {
return DruidDataSourceBuilder.create().build();
}
@Bean
@ConfigurationProperties("spring.datasource.druid.eighth")
public DataSource eighthDataSource() {
return DruidDataSourceBuilder.create().build();
}
@Bean
@ConfigurationProperties("spring.datasource.druid.ninth")
public DataSource ninthDataSource() {
return DruidDataSourceBuilder.create().build();
}
@Bean
@ConfigurationProperties("spring.datasource.druid.tenth")
public DataSource tenthDataSource() {
return DruidDataSourceBuilder.create().build();
}
@Bean
@ConfigurationProperties("spring.datasource.druid.eleventh")
public DataSource eleventhDataSource() {
return DruidDataSourceBuilder.create().build();
}
@Bean
@Primary
public DynamicDataSource dataSource(DataSource firstDataSource, DataSource secondDataSource,
DataSource thirdDataSource, DataSource fourthDataSource,
DataSource fifthDataSource, DataSource sixthDataSource,
DataSource seventhDataSource, DataSource eighthDataSource,
DataSource ninthDataSource, DataSource tenthDataSource,
DataSource eleventhDataSource) {
Map<Object, Object> targetDataSources = new HashMap<>();
targetDataSources.put(DataSourceNames.FIRST, firstDataSource);
targetDataSources.put(DataSourceNames.SECOND, secondDataSource);
targetDataSources.put(DataSourceNames.THIRD, thirdDataSource);
targetDataSources.put(DataSourceNames.FOURTH, fourthDataSource);
targetDataSources.put(DataSourceNames.FIFTH, fifthDataSource);
targetDataSources.put(DataSourceNames.SIXTH, sixthDataSource);
targetDataSources.put(DataSourceNames.SEVENTH, seventhDataSource);
targetDataSources.put(DataSourceNames.EIGHTH, eighthDataSource);
targetDataSources.put(DataSourceNames.NINTH, ninthDataSource);
targetDataSources.put(DataSourceNames.TENTH, tenthDataSource);
targetDataSources.put(DataSourceNames.ELEVENTH, eleventhDataSource);
return new DynamicDataSource(firstDataSource, targetDataSources);
}
}

17
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/datasources/annotation/DataSource.java

@ -1,17 +0,0 @@
package com.elink.esua.epdc.datasources.annotation;
import java.lang.annotation.*;
/**
*
* 多数据源注解
*
* @Authorliuchuang
* @Date2020/2/9 14:50
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface DataSource {
String name() default "";
}

61
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/datasources/aspect/DataSourceAspect.java

@ -1,61 +0,0 @@
package com.elink.esua.epdc.datasources.aspect;
import com.elink.esua.epdc.datasources.DataSourceNames;
import com.elink.esua.epdc.datasources.DynamicDataSource;
import com.elink.esua.epdc.datasources.annotation.DataSource;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.Ordered;
import org.springframework.stereotype.Component;
import java.lang.reflect.Method;
/**
*
* 多数据源切面处理类
*
* @Authorliuchuang
* @Date2020/2/9 15:12
*/
@Aspect
@Component
public class DataSourceAspect implements Ordered {
protected Logger logger = LoggerFactory.getLogger(getClass());
@Pointcut("@annotation(com.elink.esua.epdc.datasources.annotation.DataSource)")
public void dataSourcePointCut() {
}
@Around("dataSourcePointCut()")
public Object around(ProceedingJoinPoint point) throws Throwable {
MethodSignature signature = (MethodSignature) point.getSignature();
Method method = signature.getMethod();
DataSource ds = method.getAnnotation(DataSource.class);
if(ds == null){
DynamicDataSource.setDataSource(DataSourceNames.FIRST);
logger.debug("set datasource is " + DataSourceNames.FIRST);
}else {
DynamicDataSource.setDataSource(ds.name());
logger.debug("set datasource is " + ds.name());
}
try {
return point.proceed();
} finally {
DynamicDataSource.clearDataSource();
logger.debug("clean datasource");
}
}
@Override
public int getOrder() {
return 1;
}
}

52
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/issue/controller/IssueController.java

@ -1,52 +0,0 @@
package com.elink.esua.epdc.modules.issue.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.issue.result.IssueResultDTO;
import com.elink.esua.epdc.modules.issue.service.IssueService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* @Description 议题相关
* @Author yinzuomei
* @Date 2020/2/10 16:06
*/
@RestController
@RequestMapping("issue")
public class IssueController {
@Autowired
private IssueService issueService;
/**
* @param params
* @return com.elink.esua.epdc.dto.issue.result.IssueResultDTO
* @Author yinzuomei
* @Description 最热议题列表
* @Date 2020/2/10 16:15
**/
@GetMapping("pageHottestIssue")
public Result<PageData<IssueResultDTO>> pageHottestIssue(@RequestParam Map<String, Object> params) {
PageData<IssueResultDTO> page = issueService.listHottestIssue(params);
return new Result<PageData<IssueResultDTO>>().ok(page);
}
/**
* @param params
* @return com.elink.esua.epdc.dto.issue.result.IssueResultDTO
* @Author yinzuomei
* @Description 最新议题列表
* @Date 2020/2/10 16:15
**/
@GetMapping("pageLatestIssue")
public Result<PageData<IssueResultDTO>> pageLatestIssue(@RequestParam Map<String, Object> params) {
PageData<IssueResultDTO> page = issueService.listLatestIssue(params);
return new Result<PageData<IssueResultDTO>>().ok(page);
}
}

31
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/issue/service/IssueService.java

@ -1,31 +0,0 @@
package com.elink.esua.epdc.modules.issue.service;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.dto.issue.result.IssueResultDTO;
import java.util.Map;
/**
* @Description 议题相关
* @Author yinzuomei
* @Date 2020/2/10 16:06
*/
public interface IssueService {
/**
* @param params
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.issue.result.IssueResultDTO>
* @Author yinzuomei
* @Description 最热议题列表
* @Date 2020/2/10 16:16
**/
PageData<IssueResultDTO> listHottestIssue(Map<String, Object> params);
/**
* @param params
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.issue.result.IssueResultDTO>
* @Author yinzuomei
* @Description 最新议题列表
* @Date 2020/2/10 16:16
**/
PageData<IssueResultDTO> listLatestIssue(Map<String, Object> params);
}

59
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/IssueServiceImpl.java

@ -1,59 +0,0 @@
package com.elink.esua.epdc.modules.issue.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser;
import com.elink.esua.epdc.commons.tools.security.user.UserDetail;
import com.elink.esua.epdc.datasources.DataSourceNames;
import com.elink.esua.epdc.datasources.annotation.DataSource;
import com.elink.esua.epdc.dto.issue.result.IssueResultDTO;
import com.elink.esua.epdc.modules.issue.dao.IssueDao;
import com.elink.esua.epdc.modules.issue.service.IssueService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* @Description 议题相关
* @Author yinzuomei
* @Date 2020/2/10 16:06
*/
@Service
public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueResultDTO> implements IssueService {
/**
* @param params
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.issue.result.IssueResultDTO>
* @Author yinzuomei
* @Description 最热议题列表
* @Date 2020/2/10 16:17
**/
@DataSource(name = DataSourceNames.FOURTH)
@Override
public PageData<IssueResultDTO> listHottestIssue(Map<String, Object> params) {
UserDetail userDetail= SecurityUser.getUser();
params.put("deptIdList",userDetail.getDeptIdList());
IPage<IssueResultDTO> page = getPage(params);
List<IssueResultDTO> list = baseDao.selectListHottestIssue(params);
return new PageData<>(list, page.getTotal());
}
/**
* @param params
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.issue.result.IssueResultDTO>
* @Author yinzuomei
* @Description 最新议题列表
* @Date 2020/2/10 16:17
**/
@DataSource(name = DataSourceNames.FOURTH)
@Override
public PageData<IssueResultDTO> listLatestIssue(Map<String, Object> params) {
UserDetail userDetail= SecurityUser.getUser();
params.put("deptIdList",userDetail.getDeptIdList());
IPage<IssueResultDTO> page = getPage(params);
List<IssueResultDTO> list = baseDao.selectListLatestIssue(params);
return new PageData<>(list, page.getTotal());
}
}

59
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/item/controller/ItemController.java

@ -1,59 +0,0 @@
/**
* 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.elink.esua.epdc.modules.item.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.item.result.ItemResultDTO;
import com.elink.esua.epdc.modules.item.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* 项目表 项目表
*
* @author yujintao yujintao@elink-cn.com
* @since v1.0.0 2019-09-04
*/
@RestController
@RequestMapping("item")
public class ItemController {
@Autowired
private ItemService itemService;
/**
* @param params
* @return com.elink.esua.epdc.dto.item.result.ItemResultDTO
* @Author yinzuomei
* @Description 最热项目列表查询
* @Date 2020/2/10 13:45
**/
@GetMapping("pageHottestItem")
public Result<PageData<ItemResultDTO>> pageHottestItem(@RequestParam Map<String, Object> params) {
PageData<ItemResultDTO> page = itemService.listItemResultDTO(params);
return new Result<PageData<ItemResultDTO>>().ok(page);
}
}

24
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemService.java

@ -1,24 +0,0 @@
package com.elink.esua.epdc.modules.item.service;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.dto.item.result.ItemResultDTO;
import java.util.Map;
/**
* 项目模块
*
* @Author yinzuomei
* @Date 2020/2/10 13:43
*/
public interface ItemService {
/**
* @param params
* @return com.elink.esua.epdc.dto.item.result.ItemResultDTO
* @Author yinzuomei
* @Description 最热项目列表查询
* @Date 2020/2/10 13:46
**/
PageData<ItemResultDTO> listItemResultDTO(Map<String, Object> params);
}

41
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java

@ -1,41 +0,0 @@
package com.elink.esua.epdc.modules.item.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser;
import com.elink.esua.epdc.commons.tools.security.user.UserDetail;
import com.elink.esua.epdc.datasources.DataSourceNames;
import com.elink.esua.epdc.datasources.annotation.DataSource;
import com.elink.esua.epdc.dto.item.result.ItemResultDTO;
import com.elink.esua.epdc.modules.item.dao.ItemDao;
import com.elink.esua.epdc.modules.item.service.ItemService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* @Description 项目模块
* @Author yinzuomei
* @Date 2020/2/10 13:43
*/
@Service
public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemResultDTO> implements ItemService {
/**
* @param params
* @return com.elink.esua.epdc.dto.item.result.ItemResultDTO
* @Author yinzuomei
* @Description 最热项目列表查询
* @Date 2020/2/10 13:47
**/
@DataSource(name = DataSourceNames.FOURTH)
@Override
public PageData<ItemResultDTO> listItemResultDTO(Map<String, Object> params) {
UserDetail userDetail = SecurityUser.getUser();
params.put("deptIdList", userDetail.getDeptIdList());
IPage<ItemResultDTO> page = getPage(params);
List<ItemResultDTO> list = baseDao.selectListHottestItemResultDTO(params);
return new PageData<>(list, page.getTotal());
}
}

71
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/topic/controller/TopicController.java

@ -1,71 +0,0 @@
/**
* 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.elink.esua.epdc.modules.topic.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.topic.result.TopicResultDTO;
import com.elink.esua.epdc.modules.topic.service.TopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* 话题相关接口
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-10-10
*/
@RestController
@RequestMapping("topic")
public class TopicController {
@Autowired
private TopicService topicService;
/**
* @param params
* @return com.elink.esua.epdc.dto.result.TopicResultDTO
* @Author yinzuomei
* @Description 最热话题列表查询
* @Date 2020/2/10 11:34
**/
@GetMapping("pageHottestTopic")
public Result<PageData<TopicResultDTO>> pageHottestTopic(@RequestParam Map<String, Object> params) {
PageData<TopicResultDTO> page = topicService.listHottestTopic(params);
return new Result<PageData<TopicResultDTO>>().ok(page);
}
/**
* @param params
* @return com.elink.esua.epdc.dto.result.TopicResultDTO
* @Author yinzuomei
* @Description 最新话题列表查询
* @Date 2020/2/10 12:50
**/
@GetMapping("pageLatestTopic")
public Result<PageData<TopicResultDTO>> pageLatestTopic(@RequestParam Map<String, Object> params) {
PageData<TopicResultDTO> page = topicService.listLatestTopic(params);
return new Result<PageData<TopicResultDTO>>().ok(page);
}
}

49
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/topic/service/TopicService.java

@ -1,49 +0,0 @@
/**
* 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.elink.esua.epdc.modules.topic.service;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.dto.topic.result.TopicResultDTO;
import java.util.Map;
/**
* 话题相关Service
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-10-10
*/
public interface TopicService {
/**
* @param params
* @return com.elink.esua.epdc.dto.result.TopicResultDTO
* @Author yinzuomei
* @Description 最热话题列表查询
* @Date 2020/2/10 11:34
**/
PageData<TopicResultDTO> listHottestTopic(Map<String, Object> params);
/**
* @param params
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.result.TopicResultDTO>
* @Author yinzuomei
* @Description 最新话题列表查询
* @Date 2020/2/10 12:50
**/
PageData<TopicResultDTO> listLatestTopic(Map<String, Object> params);
}

61
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/topic/service/impl/TopicServiceImpl.java

@ -1,61 +0,0 @@
package com.elink.esua.epdc.modules.topic.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser;
import com.elink.esua.epdc.commons.tools.security.user.UserDetail;
import com.elink.esua.epdc.datasources.DataSourceNames;
import com.elink.esua.epdc.datasources.annotation.DataSource;
import com.elink.esua.epdc.dto.topic.result.TopicResultDTO;
import com.elink.esua.epdc.modules.topic.dao.TopicDao;
import com.elink.esua.epdc.modules.topic.service.TopicService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* @Description 话题相关Service
* @Author yinzuomei
* @Date 2020/2/10 10:56
*/
@Service
public class TopicServiceImpl extends BaseServiceImpl<TopicDao, TopicResultDTO> implements TopicService {
/**
* @param params
* @return com.elink.esua.epdc.dto.result.HottestTopicResultDTO
* @Author yinzuomei
* @Description 最热话题列表查询
* @Date 2020/2/10 12:53
**/
@DataSource(name = DataSourceNames.FIFTH)
@Override
public PageData<TopicResultDTO> listHottestTopic(Map<String, Object> params) {
UserDetail userDetail = SecurityUser.getUser();
params.put("deptIdList", userDetail.getDeptIdList());
IPage<TopicResultDTO> page = getPage(params);
List<TopicResultDTO> list = baseDao.selectListHottestTopicDTO(params);
return new PageData<>(list, page.getTotal());
}
/**
* @param params
* @return com.elink.esua.epdc.dto.result.LatestTopicResultDTO
* @Author yinzuomei
* @Description 最新话题列表查询
* @Date 2020/2/10 12:53
**/
@DataSource(name = DataSourceNames.FIFTH)
@Override
public PageData<TopicResultDTO> listLatestTopic(Map<String, Object> params) {
UserDetail userDetail = SecurityUser.getUser();
params.put("deptIdList", userDetail.getDeptIdList());
IPage<TopicResultDTO> page = getPage(params);
List<TopicResultDTO> list = baseDao.selectListLatesttTopicDTO(params);
return new PageData<>(list, page.getTotal());
}
}

21
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/utils/ModuleConstant.java

@ -1,21 +0,0 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有侵权必究
*/
package com.elink.esua.epdc.utils;
import com.elink.esua.epdc.commons.tools.constant.Constant;
/**
* 模块常量
*
* @author Mark sunlightcs@gmail.com
* @since 1.1.0
*/
public interface ModuleConstant extends Constant {
}

74
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/application-dev.yml

@ -1,74 +0,0 @@
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.jdbc.Driver
druid:
first: #数据源1
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_admin?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: elink833066
second: #数据源2
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_api?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: elink833066
third: #数据源3
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_custom?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: elink833066
fourth: #数据源4
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_events?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: elink833066
fifth: #数据源5
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_group?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: elink833066
sixth: #数据源6
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_job?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: elink833066
seventh: #数据源7
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_kpi?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: elink833066
eighth: #数据源8
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_mutuality?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: elink833066
ninth: #数据源9
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_news?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: elink833066
tenth: #数据源10
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_points?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: elink833066
eleventh: #数据源11
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_user?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: elink833066
initial-size: 10
max-active: 100
min-idle: 10
max-wait: 60000
pool-prepared-statements: true
max-pool-prepared-statement-per-connection-size: 20
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
test-while-idle: true
test-on-borrow: false
test-on-return: false
stat-view-servlet:
enabled: true
url-pattern: /druid/*
filter:
stat:
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: false
wall:
config:
multi-statement-allow: true
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss

74
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/application-prod.yml

@ -1,74 +0,0 @@
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.jdbc.Driver
druid:
first: #数据源1
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_admin?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: Elink@833066
second: #数据源2
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_api?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: Elink@833066
third: #数据源3
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_custom?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: Elink@833066
fourth: #数据源4
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_events?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: Elink@833066
fifth: #数据源5
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_group?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: Elink@833066
sixth: #数据源6
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_job?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: Elink@833066
seventh: #数据源7
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_kpi?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: Elink@833066
eighth: #数据源8
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_mutuality?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: Elink@833066
ninth: #数据源9
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_news?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: Elink@833066
tenth: #数据源10
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_points?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: Elink@833066
eleventh: #数据源11
url: jdbc:mysql://172.16.0.52:3308/esua_epdc_user?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: Elink@833066
initial-size: 10
max-active: 100
min-idle: 10
max-wait: 60000
pool-prepared-statements: true
max-pool-prepared-statement-per-connection-size: 20
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
test-while-idle: true
test-on-borrow: false
test-on-return: false
stat-view-servlet:
enabled: true
url-pattern: /druid/*
filter:
stat:
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: false
wall:
config:
multi-statement-allow: true
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss

74
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/application-test.yml

@ -1,74 +0,0 @@
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.jdbc.Driver
druid:
first: #数据源1
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_admin?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: elink833066
second: #数据源2
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_api?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: elink833066
third: #数据源3
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_custom?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: elink833066
fourth: #数据源4
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_events?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: elink833066
fifth: #数据源5
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_group?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: elink833066
sixth: #数据源6
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_job?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: elink833066
seventh: #数据源7
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_kpi?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: elink833066
eighth: #数据源8
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_mutuality?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: elink833066
ninth: #数据源9
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_news?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: elink833066
tenth: #数据源10
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_points?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: elink833066
eleventh: #数据源11
url: jdbc:mysql://47.104.224.45:3308/esua_epdc_user?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: epdc
password: elink833066
initial-size: 10
max-active: 100
min-idle: 10
max-wait: 60000
pool-prepared-statements: true
max-pool-prepared-statement-per-connection-size: 20
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
test-while-idle: true
test-on-borrow: false
test-on-return: false
stat-view-servlet:
enabled: true
url-pattern: /druid/*
filter:
stat:
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: false
wall:
config:
multi-statement-allow: true
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss

62
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/application.yml

@ -1,62 +0,0 @@
server:
port: @server.port@
servlet:
context-path: /analysis
spring:
main:
allow-bean-definition-overriding: true
application:
name: epdc-analysis-server
# 环境 dev|test|prod
profiles:
active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages,i18n/messages_common
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
redis:
database: @spring.redis.index@
host: @spring.redis.host@
timeout: 30s
port: @spring.redis.port@
password: @spring.redis.password@
cloud:
nacos:
discovery:
server-addr: @nacos.server-addr@
register-enabled: @nacos.register-enabled@
alibaba:
seata:
tx-service-group: epdc-analysis-server-fescar-service-group
management:
endpoints:
web:
exposure:
include: "*"
endpoint:
health:
show-details: ALWAYS
mybatis-plus:
mapper-locations: classpath:/mapper/**/*.xml
#实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage: com.elink.esua.epdc.modules.*.entity
global-config:
#数据库相关配置
db-config:
#主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID";
id-type: UUID
#字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断"
field-strategy: NOT_NULL
#驼峰下划线转换
column-underline: true
banner: false
#原生配置
configuration:
map-underscore-to-camel-case: true
cache-enabled: false
call-setters-on-nulls: true

1
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/i18n/messages.properties

@ -1 +0,0 @@
#Default

1
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/i18n/messages_en_US.properties

@ -1 +0,0 @@
#English

1
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/i18n/messages_zh_CN.properties

@ -1 +0,0 @@
#\u7B80\u4F53\u4E2D\u6587

1
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/i18n/messages_zh_TW.properties

@ -1 +0,0 @@
#\u7E41\u4F53\u4E2D\u6587

1
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/i18n/validation.properties

@ -1 +0,0 @@
#Default

1
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/i18n/validation_en_US.properties

@ -1 +0,0 @@
#English

1
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/i18n/validation_zh_CN.properties

@ -1 +0,0 @@
#\u7B80\u4F53\u4E2D\u6587

1
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/i18n/validation_zh_TW.properties

@ -1 +0,0 @@
#\u7E41\u4F53\u4E2D\u6587

106
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/issue/IssueDao.xml

@ -1,106 +0,0 @@
<?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.elink.esua.epdc.modules.issue.dao.IssueDao">
<!-- 最热议题列表 -->
<select id="selectListHottestIssue" resultType="com.elink.esua.epdc.dto.issue.result.IssueResultDTO">
SELECT
ei.ID,
ei.ISSUE_CONTENT,
ei.ALL_DEPT_NAMES,
ei.NICK_NAME,
ei.CREATED_TIME,
ee.APPROVE_NUM,
ee.OPPOSE_NUM,
ee.COMMENT_NUM,
ee.BROWSE_NUM,
( ee.COMMENT_NUM + ee.BROWSE_NUM + ee.APPROVE_NUM + ee.OPPOSE_NUM ) AS expressAttitudeNum
FROM
esua_epdc_events.epdc_issue ei
LEFT JOIN esua_epdc_events.epdc_events ee ON ee.ID = ei.EVENT_ID
AND ee.DEL_FLAG = '0'
<if test="issueContent != null and issueContent != ''">
AND ei.ISSUE_CONTENT LIKE CONCAT('%',#{issueContent},'%')
</if>
<if test="streetId != null and streetId != ''">
AND (find_in_set(#{streetId},ei.PARENT_DEPT_IDS)
OR find_in_set(#{streetId},ei.ALL_DEPT_IDS))
</if>
<if test="communityId != null and communityId != ''">
AND (find_in_set(#{communityId},ei.PARENT_DEPT_IDS)
OR find_in_set(#{communityId},ei.ALL_DEPT_IDS))
</if>
<if test="gridId != null and gridId != ''">
AND (ei.GRID_ID = #{gridId}
OR find_in_set(#{gridId},ei.ALL_DEPT_IDS))
</if>
<if test="startTime != null and startTime != ''">
and DATE_FORMAT( ei.CREATED_TIME, '%Y-%m-%d' ) &gt;=#{startTime}
</if>
<if test="endTime != null and endTime != ''">
and DATE_FORMAT( ei.CREATED_TIME, '%Y-%m-%d' ) &lt;=#{endTime}
</if>
<if test="deptIdList!=null and deptIdList.size()>0">
and ei.GRID_ID in
<foreach collection="deptIdList" index="index" item="deptId" open="(" separator="," close=")">
#{deptId}
</foreach>
</if>
WHERE
ei.DEL_FLAG = '0'
AND ei.ISSUE_STATE IN ( 0, 2 )
ORDER BY
expressAttitudeNum DESC
</select>
<!-- 最新议题列表 -->
<select id="selectListLatestIssue" resultType="com.elink.esua.epdc.dto.issue.result.IssueResultDTO">
SELECT
ei.ID,
ei.ISSUE_CONTENT,
ei.ALL_DEPT_NAMES,
ei.NICK_NAME,
ei.CREATED_TIME,
ee.APPROVE_NUM,
ee.OPPOSE_NUM,
ee.COMMENT_NUM,
ee.BROWSE_NUM,
( ee.COMMENT_NUM + ee.BROWSE_NUM + ee.APPROVE_NUM + ee.OPPOSE_NUM ) AS expressAttitudeNum
FROM
esua_epdc_events.epdc_issue ei
LEFT JOIN esua_epdc_events.epdc_events ee ON ee.ID = ei.EVENT_ID
AND ee.DEL_FLAG = '0'
<if test="issueContent != null and issueContent != ''">
AND ei.ISSUE_CONTENT LIKE CONCAT('%',#{issueContent},'%')
</if>
<if test="streetId != null and streetId != ''">
AND (find_in_set(#{streetId},ei.PARENT_DEPT_IDS)
OR find_in_set(#{streetId},ei.ALL_DEPT_IDS))
</if>
<if test="communityId != null and communityId != ''">
AND (find_in_set(#{communityId},ei.PARENT_DEPT_IDS)
OR find_in_set(#{communityId},ei.ALL_DEPT_IDS))
</if>
<if test="gridId != null and gridId != ''">
AND (ei.GRID_ID = #{gridId}
OR find_in_set(#{gridId},ei.ALL_DEPT_IDS))
</if>
<if test="startTime != null and startTime != ''">
and DATE_FORMAT( ei.CREATED_TIME, '%Y-%m-%d' ) &gt;=#{startTime}
</if>
<if test="endTime != null and endTime != ''">
and DATE_FORMAT( ei.CREATED_TIME, '%Y-%m-%d' ) &lt;=#{endTime}
</if>
<if test="deptIdList!=null and deptIdList.size()>0">
and ei.GRID_ID in
<foreach collection="deptIdList" index="index" item="deptId" open="(" separator="," close=")">
#{deptId}
</foreach>
</if>
WHERE
ei.DEL_FLAG = '0'
AND ei.ISSUE_STATE IN ( 0, 2 )
ORDER BY
expressAttitudeNum DESC,CREATED_TIME desc
</select>
</mapper>

53
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/item/ItemDao.xml

@ -1,53 +0,0 @@
<?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.elink.esua.epdc.modules.item.dao.ItemDao">
<select id="selectListHottestItemResultDTO" resultType="com.elink.esua.epdc.dto.item.result.ItemResultDTO">
SELECT
ei.id,
ei.ITEM_CONTENT,
ei.ALL_DEPT_NAMES,
ei.GRID,
ei.NICK_NAME,
ei.CREATED_TIME AS releaseTime,
ee.APPROVE_NUM,
ee.OPPOSE_NUM,
ee.COMMENT_NUM,
ee.BROWSE_NUM,
(ee.APPROVE_NUM + ee.OPPOSE_NUM + ee.COMMENT_NUM + ee.BROWSE_NUM ) AS expressAttitudeNum
FROM
epdc_item ei
LEFT JOIN epdc_events ee ON ( ei.EVENT_ID = ee.ID )
WHERE
ei.DEL_FLAG = '0'
AND ee.DEL_FLAG = '0'
<if test='searchContent != null and searchContent != ""'>
AND ei.ITEM_CONTENT LIKE CONCAT('%',#{searchContent},'%')
</if>
<if test="streetId != null and streetId != ''">
AND (find_in_set(#{streetId},ei.PARENT_DEPT_IDS)
OR find_in_set(#{streetId},ei.ALL_DEPT_IDS))
</if>
<if test="communityId != null and communityId != ''">
AND (find_in_set(#{communityId},ei.PARENT_DEPT_IDS)
OR find_in_set(#{communityId},ei.ALL_DEPT_IDS))
</if>
<if test="gridId != null and gridId != ''">
AND (ei.GRID_ID = #{gridId}
OR find_in_set(#{gridId},ei.ALL_DEPT_IDS))
</if>
<if test="startTime != null and startTime != ''">
and DATE_FORMAT( ei.CREATED_TIME, '%Y-%m-%d' ) &gt;=#{startTime}
</if>
<if test="endTime != null and endTime != ''">
and DATE_FORMAT( ei.CREATED_TIME, '%Y-%m-%d' ) &lt;=#{endTime}
</if>
<if test="deptIdList!=null and deptIdList.size()>0">
and ei.GRID_ID in
<foreach collection="deptIdList" index="index" item="deptId" open="(" separator="," close=")">
#{deptId}
</foreach>
</if>
ORDER BY expressAttitudeNum DESC
</select>
</mapper>

96
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/topic/TopicDao.xml

@ -1,96 +0,0 @@
<?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.elink.esua.epdc.modules.topic.dao.TopicDao">
<!-- 最热话题列表查询 -->
<select id="selectListHottestTopicDTO" resultType="com.elink.esua.epdc.dto.topic.result.TopicResultDTO">
select
et.ID,
et.TOPIC_CONTENT,
et.ALL_DEPT_NAMES,
et.GRID,
et.GROUP_NAME,
et.NICKNAME,
et.CREATED_TIME as releaseTime,
et.COMMENT_NUM,
et.BROWSE_NUM,
et.COMMENT_NUM+et.BROWSE_NUM as expressAttitudeNum
from epdc_topic et
where et.DEL_FLAG='0'
and et.STATE='0'
<if test="topicContent != null and topicContent != ''">
and et.TOPIC_CONTENT like concat('%', #{topicContent}, '%')
</if>
<if test="streetId != null and streetId != ''">
AND (find_in_set(#{streetId},et.PARENT_DEPT_IDS)
OR find_in_set(#{streetId},et.ALL_DEPT_IDS))
</if>
<if test="communityId != null and communityId != ''">
AND (find_in_set(#{communityId},et.PARENT_DEPT_IDS)
OR find_in_set(#{communityId},et.ALL_DEPT_IDS))
</if>
<if test="gridId != null and gridId != ''">
AND (et.GRID_ID = #{gridId}
OR find_in_set(#{gridId},et.ALL_DEPT_IDS))
</if>
<if test="startTime != null and startTime != ''">
and DATE_FORMAT( et.CREATED_TIME, '%Y-%m-%d' ) &gt;=#{startTime}
</if>
<if test="endTime != null and endTime != ''">
and DATE_FORMAT( et.CREATED_TIME, '%Y-%m-%d' ) &lt;=#{endTime}
</if>
<if test="deptIdList!=null and deptIdList.size()>0">
and et.GRID_ID in
<foreach collection="deptIdList" index="index" item="deptId" open="(" separator="," close=")">
#{deptId}
</foreach>
</if>
order by expressAttitudeNum desc
</select>
<!-- 最新话题列表查询 -->
<select id="selectListLatesttTopicDTO" resultType="com.elink.esua.epdc.dto.topic.result.TopicResultDTO">
select
et.ID,
et.TOPIC_CONTENT,
et.ALL_DEPT_NAMES,
et.GRID,
et.GROUP_NAME,
et.NICKNAME,
et.CREATED_TIME as releaseTime,
et.COMMENT_NUM,
et.BROWSE_NUM,
et.COMMENT_NUM+et.BROWSE_NUM as expressAttitudeNum
from epdc_topic et
where et.DEL_FLAG='0'
and et.STATE='0'
<if test="topicContent != null and topicContent != ''">
and et.TOPIC_CONTENT like concat('%', #{topicContent}, '%')
</if>
<if test="streetId != null and streetId != ''">
AND (find_in_set(#{streetId},et.PARENT_DEPT_IDS)
OR find_in_set(#{streetId},et.ALL_DEPT_IDS))
</if>
<if test="communityId != null and communityId != ''">
AND (find_in_set(#{communityId},et.PARENT_DEPT_IDS)
OR find_in_set(#{communityId},et.ALL_DEPT_IDS))
</if>
<if test="gridId != null and gridId != ''">
AND (et.GRID_ID = #{gridId}
OR find_in_set(#{gridId},et.ALL_DEPT_IDS))
</if>
<if test="startTime != null and startTime != ''">
and DATE_FORMAT( et.CREATED_TIME, '%Y-%m-%d' ) &gt;=#{startTime}
</if>
<if test="endTime != null and endTime != ''">
and DATE_FORMAT( et.CREATED_TIME, '%Y-%m-%d' ) &lt;=#{endTime}
</if>
<if test="deptIdList!=null and deptIdList.size()>0">
and et.GRID_ID in
<foreach collection="deptIdList" index="index" item="deptId" open="(" separator="," close=")">
#{deptId}
</foreach>
</if>
order by expressAttitudeNum desc,releaseTime desc
</select>
</mapper>

21
esua-epdc/epdc-module/epdc-analysis/pom.xml

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-module</artifactId>
<version>1.0.0</version>
</parent>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-analysis</artifactId>
<packaging>pom</packaging>
<modules>
<module>epdc-analysis-client</module>
<module>epdc-analysis-server</module>
</modules>
</project>

51
esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppActUserCancelsignupDTO.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.elink.esua.epdc.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 取消报名参数
*
* @author wanggongfeng
* @since v1.0.0 2019-12-17
*/
@Data
public class EpdcAppActUserCancelsignupDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 用户ID
*/
private String userId;
/**
* 活动ID
*/
@NotBlank(message = "活动ID不能为空")
private String actId;
/**
* 取消报名原因
*/
@NotBlank(message = "取消报名原因不能为空")
private String failureReason;
}

80
esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppActUserClockLogDTO.java

@ -0,0 +1,80 @@
/**
* 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.elink.esua.epdc.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
/**
* 用户打卡参数
*
* @author wanggongfeng
* @since v1.0.0 2019-12-17
*/
@Data
public class EpdcAppActUserClockLogDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 用户ID
*/
private String userId;
/**
* 活动ID
*/
@NotBlank(message = "活动ID不能为空")
private String actId;
/**
* 打卡描述
*/
@NotBlank(message = "打卡描述不能为空")
private String clockDesc;
/**
* 打卡位置经度
*/
private BigDecimal clockLongitude;
/**
* 打卡位置纬度
*/
private BigDecimal clockLatitude;
/**
* 打卡地址
*/
@NotBlank(message = "打卡地址不能为空")
private String clockAddress;
/**
* 打卡图片
*/
private ArrayList<String> images;
/**
* 打卡类型0-打卡1-更新打卡
*/
@NotBlank(message = "打卡类型不能为空")
private String clockType;
/**
* 打卡是否有效0-1-
*/
@NotBlank(message = "打卡是否有效不能为空")
private String effectiveFlag;
}

1
esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcCompleteUserInfoFormDTO.java

@ -23,6 +23,7 @@ public class EpdcCompleteUserInfoFormDTO implements Serializable {
* 身份证号码
*/
private String identityNo;
/**
* 手机号
*/

48
esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcAppClockListDTO.java

@ -0,0 +1,48 @@
/**
* 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.elink.esua.epdc.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 打卡列表
*
* @author wanggongfeng
* @since v1.0.0 2019-12-18
*/
@Data
public class EpdcAppClockListDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 活动打卡人次
*/
private int clockNum;
/**
* 打卡列表
*/
private List<Object> clocks;
}

68
esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcAppVolunteerRankDTO.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.elink.esua.epdc.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 志愿者排名
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-18
*/
@Data
public class EpdcAppVolunteerRankDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 排名
*/
private Integer sort;
/**
* 头像
*/
private String faceImg;
/**
* 用户名
*/
private String nickname;
/**
* 是否党员(0-1-)
*/
private String partyFlag;
/**
* 爱心时长(单位小时)
*/
private BigDecimal kindnessTime;
/**
* 参加次数
*/
private Integer participationNum;
}

12
esua-epdc/epdc-module/epdc-api/epdc-api-server/pom.xml

@ -13,7 +13,6 @@
<packaging>jar</packaging>
<properties>
<!-- <weixin-java-mp.version>3.5.0</weixin-java-mp.version>-->
</properties>
<dependencies>
@ -22,35 +21,42 @@
<artifactId>epdc-api-client</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-commons-tools</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-commons-mybatis</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>${spring.boot.admin.version}</version>
</dependency>
<!-- nacos start -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- nacos end -->
<!--版本控制-->
<dependency>
<groupId>com.esua.epdc</groupId>
@ -86,6 +92,10 @@
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
</dependencies>
<build>

12
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/ApiApplication.java

@ -1,11 +1,3 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
* <p>
* https://www.renren.io
* <p>
* 版权所有侵权必究
*/
package com.elink.esua.epdc;
import org.springframework.boot.SpringApplication;
@ -16,8 +8,8 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
/**
* API模块
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
* @author rongchao
* @Date 20-1-15
*/
@SpringBootApplication
@EnableDiscoveryClient

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save