Browse Source

Merge branch 'dev_0814' of http://121.42.41.42:7070/r/esua-epdc-cloud into dev_0814

dev
管理员 6 years ago
parent
commit
3c09e5f535
  1. 71
      esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/AreaDTO.java
  2. 28
      esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SimpleAreaDTO.java
  3. 31
      esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysSimpleDictDTO.java
  4. 4
      esua-epdc/epdc-admin/epdc-admin-server/pom.xml
  5. 42
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/AreaController.java
  6. 10
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java
  7. 39
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDictController.java
  8. 16
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/AreaDao.java
  9. 2
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysDeptDao.java
  10. 6
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysDictDao.java
  11. 60
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/AreaEntity.java
  12. 67
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/AreaRedis.java
  13. 81
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/SysDictRedis.java
  14. 29
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/AreaService.java
  15. 3
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysDeptService.java
  16. 24
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysDictService.java
  17. 65
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/AreaServiceImpl.java
  18. 8
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java
  19. 57
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDictServiceImpl.java
  20. 2
      esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/application-dev.yml
  21. 12
      esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/application-test.yml
  22. 4
      esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysDeptDao.xml
  23. 5
      esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysDictDao.xml
  24. 8
      esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysUserDao.xml
  25. 4
      esua-epdc/epdc-auth/pom.xml
  26. 2
      esua-epdc/epdc-auth/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java
  27. 6
      esua-epdc/epdc-commons/epdc-commons-mybatis/src/main/java/com/elink/esua/epdc/commons/mybatis/entity/BaseEpdcEntity.java
  28. 2
      esua-epdc/epdc-commons/epdc-commons-mybatis/src/main/java/com/elink/esua/epdc/commons/mybatis/handler/FieldMetaObjectHandler.java
  29. 59
      esua-epdc/epdc-commons/epdc-commons-mybatis/src/main/java/com/elink/esua/epdc/commons/mybatis/service/impl/BaseServiceImpl.java
  30. 41
      esua-epdc/epdc-commons/epdc-commons-tools-phone/pom.xml
  31. 79
      esua-epdc/epdc-commons/epdc-commons-tools-phone/src/main/java/com/elink/esua/epdc/commons/tools/utils/PhoneDto.java
  32. 175
      esua-epdc/epdc-commons/epdc-commons-tools-phone/src/main/java/com/elink/esua/epdc/commons/tools/utils/PhoneUtil.java
  33. 5
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/Constant.java
  34. 5
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/ServiceConstant.java
  35. 24
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/redis/RedisKeys.java
  36. 1
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/user/UserDetail.java
  37. 40
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/RandomUtil.java
  38. 1
      esua-epdc/epdc-commons/pom.xml
  39. 15
      esua-epdc/epdc-gateway/pom.xml
  40. 6
      esua-epdc/epdc-gateway/src/main/resources/application.yml
  41. 69
      esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/processon/demo1.bpmn
  42. 89
      esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/processon/yishi.bpmn
  43. 24
      esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/src/main/java/com/elink/esua/epdc/service/ActWorkflowCommonService.java
  44. 50
      esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/src/main/java/com/elink/esua/epdc/service/impl/ActWorkflowCommonServiceImpl.java
  45. 110
      esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/src/test/java/com/elink/esua/epdc/ActivitiTest.java
  46. 4
      esua-epdc/epdc-module/epdc-app/epdc-app-client/pom.xml
  47. 5
      esua-epdc/epdc-module/epdc-demo/epdc-demo-server/pom.xml
  48. 9
      esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/test/java/com/elink/esua/epdc/OrikaTest.java
  49. 6
      esua-epdc/epdc-module/epdc-events/epdc-events-client/pom.xml
  50. 0
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/epdc.gitkeep
  51. 8
      esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml
  52. 4
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/EventsApplication.java
  53. 2
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/config/ModuleConfigImpl.java
  54. 6
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/application.yml
  55. 0
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/messages.properties
  56. 0
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/messages_en_US.properties
  57. 0
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/messages_zh_CN.properties
  58. 0
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/messages_zh_TW.properties
  59. 0
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/validation.properties
  60. 0
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/validation_en_US.properties
  61. 0
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/validation_zh_CN.properties
  62. 0
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/validation_zh_TW.properties
  63. 4
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/logback-spring.xml
  64. 0
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/registry.conf
  65. 8
      esua-epdc/epdc-module/epdc-events/pom.xml
  66. 6
      esua-epdc/epdc-module/epdc-oss/epdc-oss-server/pom.xml
  67. 2
      esua-epdc/epdc-module/epdc-oss/epdc-oss-server/src/main/resources/application.yml
  68. 152
      esua-epdc/epdc-module/epdc-oss/epdc-oss-server/src/main/resources/logback-spring.xml
  69. 15
      esua-epdc/epdc-module/epdc-user/epdc-user-client/pom.xml
  70. 85
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PartyMembersDTO.java
  71. 54
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PartyTagRelationDTO.java
  72. 159
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserDTO.java
  73. 54
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserTagDTO.java
  74. 37
      esua-epdc/epdc-module/epdc-user/epdc-user-server/pom.xml
  75. 45
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/config/WxMpConfig.java
  76. 26
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/config/property/WxMpProperties.java
  77. 103
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/PartyMembersController.java
  78. 102
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/PartyTagRelationController.java
  79. 101
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserController.java
  80. 107
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserTagController.java
  81. 41
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PartyMembersDao.java
  82. 33
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PartyTagRelationDao.java
  83. 33
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java
  84. 33
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserTagDao.java
  85. 105
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PartyMembersEntity.java
  86. 53
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PartyTagRelationEntity.java
  87. 183
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserEntity.java
  88. 53
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserTagEntity.java
  89. 78
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/PartyMembersExcel.java
  90. 52
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/PartyTagRelationExcel.java
  91. 110
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/UserExcel.java
  92. 52
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/UserTagExcel.java
  93. 43
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/jwt/JwtProperties.java
  94. 80
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/jwt/JwtUtils.java
  95. 47
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/redis/PartyMembersRedis.java
  96. 47
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/redis/PartyTagRelationRedis.java
  97. 46
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/redis/UserRedis.java
  98. 47
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/redis/UserTagRedis.java
  99. 50
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PartyMembersService.java
  100. 47
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PartyTagRelationService.java

71
esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/AreaDTO.java

@ -0,0 +1,71 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dto;
import lombok.Data;
import java.io.Serializable;
/**
* 行政区划
*
* @author yujintao
* @date 2019/9/3 16:22
*/
@Data
public class AreaDTO implements Serializable {
private static final long serialVersionUID = 9173956433924027751L;
/**
* ID
*/
private Integer id;
/**
* 父级ID
*/
private Integer parentId;
/**
* 名称
*/
private String name;
/**
* 简称
*/
private String shortName;
/**
* 经度
*/
private Float longitude;
/**
* 纬度
*/
private Float latitude;
/**
* 等级(1省/直辖市,2地级市,3区县,4镇/街道)
*/
private Integer level;
/**
* 排序
*/
private Integer sort;
/**
* 状态(0禁用/1启用)
*/
private Integer status;
}

28
esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SimpleAreaDTO.java

@ -0,0 +1,28 @@
package com.elink.esua.epdc.dto;
import lombok.Data;
import java.io.Serializable;
/**
* 行政区划简要信息
*
* @author yujintao
* @date 2019/9/3 16:22
*/
@Data
public class SimpleAreaDTO implements Serializable {
private static final long serialVersionUID = -3243672014476007901L;
/**
* ID
*/
private Integer id;
/**
* 名称
*/
private String name;
}

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

@ -0,0 +1,31 @@
package com.elink.esua.epdc.dto;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 数据字典简要信息
*
* @author yujintao
* @date 2019/7/15 09:29
*/
@Data
@ApiModel(value = "数据字典")
public class SysSimpleDictDTO implements Serializable {
private static final long serialVersionUID = -4827806651372425347L;
@ApiModelProperty(value = "字典名称")
@NotBlank(message = "{sysdict.name.require}", groups = DefaultGroup.class)
private String dictName;
@ApiModelProperty(value = "字典值")
private String dictValue;
}

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

@ -93,7 +93,7 @@
<profile>
<id>test</id>
<properties>
<server.port>9092</server.port>
<server.port>9055</server.port>
<spring.profiles.active>test</spring.profiles.active>
<!-- nacos -->
@ -106,7 +106,7 @@
<profile>
<id>prod</id>
<properties>
<server.port>9092</server.port>
<server.port>9055</server.port>
<spring.profiles.active>prod</spring.profiles.active>
<!-- nacos -->

42
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/AreaController.java

@ -0,0 +1,42 @@
package com.elink.esua.epdc.controller;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.SimpleAreaDTO;
import com.elink.esua.epdc.service.AreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 获取行政区划
*
* @author liuhongwei @elink-cn.com
* @since v1.0.0 2019-05-13
*/
@RestController
@RequestMapping("area")
public class AreaController {
@Autowired
private AreaService areaService;
/**
* 根据区划ID获取下属区域列表
*
* @param areaId
* @return com.elink.esua.commons.tools.utils.Result<java.util.List < com.elink.esua.dto.AreaDTO>>
* @author yujintao
* @date 2019/9/3 16:28
*/
@GetMapping("listSimple/{areaId}")
public Result<List<SimpleAreaDTO>> listSimpleAreaInfo(@PathVariable("areaId") String areaId) {
return this.areaService.listSimpleAreaInfo(areaId);
}
}

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

@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 部门管理
@ -46,6 +47,15 @@ public class SysDeptController {
return new Result<List<SysDeptDTO>>().ok(list);
}
@GetMapping("sublist/{pid}")
@ApiOperation("子列表")
public Result<List<SysDeptDTO>> sublist(@PathVariable("pid") String pid){
Map map = new HashMap();
map.put("pid",pid);
List<SysDeptDTO> list = sysDeptService.subList(map);
return new Result<List<SysDeptDTO>>().ok(list);
}
@GetMapping("{id}")
@ApiOperation("信息")
public Result<SysDeptDTO> get(@PathVariable("id") Long id){

39
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDictController.java

@ -17,6 +17,7 @@ import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.dto.SysDictDTO;
import com.elink.esua.epdc.dto.SysSimpleDictDTO;
import com.elink.esua.epdc.service.SysDictService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@ -26,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -59,6 +61,16 @@ public class SysDictController {
return new Result<PageData<SysDictDTO>>().ok(page);
}
@GetMapping("sublist/{pid}")
@ApiOperation("子列表")
public Result<List<SysDictDTO>> sublist(@PathVariable("pid") String pid){
Map map = new HashMap();
map.put("pid",pid);
List<SysDictDTO> list = sysDictService.subList(map);
return new Result<List<SysDictDTO>>().ok(list);
}
@GetMapping("list")
@ApiOperation("字典分类数据")
@ApiImplicitParams({
@ -116,4 +128,31 @@ public class SysDictController {
return new Result();
}
/**
* 根据数据字典类型获取简版数据字典列表用于页面下拉菜单
*
* @param dictType 数据字典类型
* @return com.elink.esua.commons.tools.utils.Result<java.util.List < com.elink.esua.dto.SysSimpleDictDTO>>
* @author yujintao
* @date 2019/7/15 09:33
*/
@GetMapping("listSimple/{dictType}")
@ApiOperation("字典分类数据")
@ApiImplicitParams({
@ApiImplicitParam(name = "dictName", value = "字典名称", paramType = "query", dataType = "String")
})
public Result<List<SysSimpleDictDTO>> listSimpleDictInfo(@ApiIgnore @PathVariable("dictType") String dictType) {
//字典分类数据
return sysDictService.listSimpleDictInfo(dictType);
}
@DeleteMapping("{id}")
@ApiOperation("删除")
@LogOperation("Delete Dict")
public Result delete(@PathVariable Long id) {
//效验数据
sysDictService.delete(id);
return new Result();
}
}

16
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/AreaDao.java

@ -0,0 +1,16 @@
package com.elink.esua.epdc.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.entity.AreaEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* @author yujintao
* @date 2019/9/3 16:54
*/
@Mapper
public interface AreaDao extends BaseDao<AreaEntity> {
}

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

@ -39,4 +39,6 @@ public interface SysDeptDao extends BaseDao<SysDeptEntity> {
* @param id 部门ID
*/
List<Long> getSubDeptIdList(String id);
List<SysDeptEntity> getSubList(Map<String, Object> params);
}

6
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysDictDao.java

@ -13,6 +13,9 @@ import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.entity.SysDictEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
* 数据字典
*
@ -22,4 +25,7 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface SysDictDao extends BaseDao<SysDictEntity> {
List<SysDictEntity> getSubList(Map<String, Object> params);
}

60
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/AreaEntity.java

@ -0,0 +1,60 @@
package com.elink.esua.epdc.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
/**
* 行政区划
*
* @author yujintao
* @date 2019/9/3 16:25
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("area")
public class AreaEntity implements Serializable {
private static final long serialVersionUID = -2139014717755304245L;
/**
* ID
*/
private Integer id;
/**
* 父级ID
*/
private Integer parentId;
/**
* 名称
*/
private String name;
/**
* 简称
*/
private String shortName;
/**
* 经度
*/
private Float longitude;
/**
* 纬度
*/
private Float latitude;
/**
* 等级(1省/直辖市,2地级市,3区县,4镇/街道)
*/
private Integer level;
/**
* 排序
*/
private Integer sort;
/**
* 状态(0禁用/1启用)
*/
private Integer status;
}

67
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/AreaRedis.java

@ -0,0 +1,67 @@
/**
* 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.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisKeys;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import com.elink.esua.epdc.dto.SimpleAreaDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* 区划信息表
*
* @author yujintao yujintao@elink-cn.com
* @since v1.0.0 2019-05-08
*/
@Component
public class AreaRedis {
@Autowired
private RedisUtils redisUtils;
/**
* 取出区划信息
*
* @param areaId 区域ID
* @return java.lang.String
* @author yujintao
* @date 2019/6/13 11:05
*/
public List<SimpleAreaDTO> getSimpleAreaList(String areaId) {
String configAreaKey = RedisKeys.getSimpleAreaKey(areaId);
return (List<SimpleAreaDTO>) redisUtils.get(configAreaKey);
}
/**
* 缓存区划信息
*
* @param areaId
* @param areaDtoList
* @return void
* @author yujintao
* @date 2019/6/13 11:02
*/
public void setSimpleAreaList(String areaId, List<SimpleAreaDTO> areaDtoList) {
String configAreaKey = RedisKeys.getSimpleAreaKey(areaId);
redisUtils.set(configAreaKey, areaDtoList);
}
}

81
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/SysDictRedis.java

@ -0,0 +1,81 @@
/**
* 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.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisKeys;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import com.elink.esua.epdc.dto.SimpleAreaDTO;
import com.elink.esua.epdc.dto.SysSimpleDictDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* 区划信息表
*
* @author yujintao yujintao@elink-cn.com
* @since v1.0.0 2019-05-08
*/
@Component
public class SysDictRedis {
@Autowired
private RedisUtils redisUtils;
/**
* 根据数据字典类型从redis获取简版数据字典列表
*
* @param dictType 数据字典类型
* @return java.util.List<com.elink.esua.dto.SysSimpleDictDTO>
* @author yujintao
* @date 2019/7/15 09:42
*/
public List<SysSimpleDictDTO> getSimpleDictList(String dictType) {
String dictKey = RedisKeys.getSimpleDictKey(dictType);
return (List<SysSimpleDictDTO>) redisUtils.get(dictKey);
}
/**
* 根据数据字典类型将简版数据字典列表放入缓存
*
* @param dictType 数据字典类型
* @param simpleDictList 列表
* @return void
* @author yujintao
* @date 2019/7/15 09:50
*/
public void setSimpleDictList(String dictType, List<SysSimpleDictDTO> simpleDictList) {
String dictKey = RedisKeys.getSimpleDictKey(dictType);
redisUtils.set(dictKey, simpleDictList);
}
/**
* 根据数据字典类型从redis删除简版数据字典列表
*
* @param dictType
* @return void
* @author yujintao
* @date 2019/7/15 10:10
*/
public void removeSimpleDictList(String dictType) {
String dictKey = RedisKeys.getSimpleDictKey(dictType);
redisUtils.delete(dictKey);
}
}

29
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/AreaService.java

@ -0,0 +1,29 @@
package com.elink.esua.epdc.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.SimpleAreaDTO;
import com.elink.esua.epdc.entity.AreaEntity;
import java.util.List;
/**
* 行政区划
*
* @author yujintao
* @date 2019/9/3 16:54
*/
public interface AreaService extends BaseService<AreaEntity> {
/**
* 根据区划ID获取下属区域列表
*
* @param areaId
* @return com.elink.esua.commons.tools.utils.Result<java.util.List < com.elink.esua.dto.AreaDTO>>
* @author yujintao
* @date 2019/6/13 10:35
*/
Result<List<SimpleAreaDTO>> listSimpleAreaInfo(String areaId);
}

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

@ -34,6 +34,9 @@ public interface SysDeptService extends BaseService<SysDeptEntity> {
void delete(Long id);
//根据pid获取下一级子列表
List<SysDeptDTO> subList(Map<String, Object> params);
/**
* 根据部门ID获取本部门及子部门ID列表
* @param id 部门ID

24
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysDictService.java

@ -10,7 +10,9 @@ package com.elink.esua.epdc.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.SysDictDTO;
import com.elink.esua.epdc.dto.SysSimpleDictDTO;
import com.elink.esua.epdc.entity.SysDictEntity;
import java.util.List;
@ -35,4 +37,26 @@ public interface SysDictService extends BaseService<SysDictEntity> {
void update(SysDictDTO dto);
void delete(Long[] ids);
//根据pid获取下一级子列表
List<SysDictDTO> subList(Map<String, Object> params);
/**
* 根据数据字典类型获取简版数据字典列表用于页面下拉菜单
*
* @param dictType 数据字典类型
* @return com.elink.esua.commons.tools.utils.Result<java.util.List < com.elink.esua.dto.SysSimpleDictDTO>>
* @author yujintao
* @date 2019/7/15 09:33
*/
Result<List<SysSimpleDictDTO>> listSimpleDictInfo(String dictType);
/**
* 根据ID删除
*
* @param id
* @return void
* @author yujintao
* @date 2019/7/15 10:14
*/
void delete(Long id);
}

65
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/AreaServiceImpl.java

@ -0,0 +1,65 @@
package com.elink.esua.epdc.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.NumConstant;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dao.AreaDao;
import com.elink.esua.epdc.dto.SimpleAreaDTO;
import com.elink.esua.epdc.entity.AreaEntity;
import com.elink.esua.epdc.redis.AreaRedis;
import com.elink.esua.epdc.service.AreaService;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author yujintao
* @date 2019/9/3 16:55
*/
@Slf4j
@Service
public class AreaServiceImpl extends BaseServiceImpl<AreaDao, AreaEntity> implements AreaService {
@Autowired
private AreaRedis areaRedis;
@Override
public Result<List<SimpleAreaDTO>> listSimpleAreaInfo(String areaId) {
List<SimpleAreaDTO> simpleAreaList = Lists.newArrayList();
try {
if (StringUtils.isNotBlank(areaId)) {
List<SimpleAreaDTO> areaList = areaRedis.getSimpleAreaList(areaId);
if (null != areaList) {
return new Result<List<SimpleAreaDTO>>().ok(areaList);
}
Integer pid = Integer.parseInt(areaId);
QueryWrapper<AreaEntity> arWrapper = new QueryWrapper<>();
arWrapper.select("ID", "NAME");
arWrapper.eq("PARENT_ID", pid);
arWrapper.eq("STATUS", NumConstant.ONE);
arWrapper.orderByAsc("LEVEL", "SORT");
List<AreaEntity> entityList = baseDao.selectList(arWrapper);
if (!entityList.isEmpty()) {
simpleAreaList = ConvertUtils.sourceToTarget(entityList, SimpleAreaDTO.class);
areaRedis.setSimpleAreaList(areaId, simpleAreaList);
}
}
} catch (Exception e) {
log.error("获取区划信息失败,错误信息{}", e.getMessage());
}
return new Result<List<SimpleAreaDTO>>().ok(simpleAreaList);
}
}

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

@ -51,7 +51,6 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit
params.put("deptIdList", getSubDeptIdList(user.getDeptId()));
}
//查询部门列表
List<SysDeptEntity> entityList = baseDao.getList(params);
List<SysDeptDTO> dtoList = ConvertUtils.sourceToTarget(entityList, SysDeptDTO.class);
@ -59,6 +58,13 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit
return TreeUtils.build(dtoList);
}
@Override
public List<SysDeptDTO> subList(Map<String, Object> params) {
List<SysDeptEntity> entityList = baseDao.getSubList(params);
List<SysDeptDTO> dtoList = ConvertUtils.sourceToTarget(entityList, SysDeptDTO.class);
return TreeUtils.build(dtoList);
}
@Override
public SysDeptDTO get(Long id) {
//超级管理员,部门ID为null

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

@ -15,11 +15,18 @@ 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.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.utils.TreeUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dao.SysDictDao;
import com.elink.esua.epdc.dto.SysDictDTO;
import com.elink.esua.epdc.dto.SysSimpleDictDTO;
import com.elink.esua.epdc.entity.SysDictEntity;
import com.elink.esua.epdc.redis.SysDictRedis;
import com.elink.esua.epdc.service.SysDictService;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -32,9 +39,13 @@ import java.util.Map;
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
@Slf4j
@Service
public class SysDictServiceImpl extends BaseServiceImpl<SysDictDao, SysDictEntity> implements SysDictService {
@Autowired
private SysDictRedis dictRedis;
@Override
public PageData<SysDictDTO> page(Map<String, Object> params) {
QueryWrapper<SysDictEntity> wrapper = getWrapper(params);
@ -48,6 +59,12 @@ public class SysDictServiceImpl extends BaseServiceImpl<SysDictDao, SysDictEntit
return getPageData(page, SysDictDTO.class);
}
@Override
public List<SysDictDTO> subList(Map<String, Object> params) {
List<SysDictEntity> entityList = baseDao.getSubList(params);
return ConvertUtils.sourceToTarget(entityList, SysDictDTO.class);
}
@Override
public List<SysDictDTO> list(Map<String, Object> params) {
List<SysDictEntity> entityList = baseDao.selectList(getWrapper(params));
@ -82,16 +99,16 @@ public class SysDictServiceImpl extends BaseServiceImpl<SysDictDao, SysDictEntit
@Transactional(rollbackFor = Exception.class)
public void save(SysDictDTO dto) {
SysDictEntity entity = ConvertUtils.sourceToTarget(dto, SysDictEntity.class);
insert(entity);
dictRedis.removeSimpleDictList(entity.getDictType());
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(SysDictDTO dto) {
SysDictEntity entity = ConvertUtils.sourceToTarget(dto, SysDictEntity.class);
updateById(entity);
dictRedis.removeSimpleDictList(entity.getDictType());
}
@Override
@ -101,4 +118,40 @@ public class SysDictServiceImpl extends BaseServiceImpl<SysDictDao, SysDictEntit
logicDelete(ids, SysDictEntity.class);
}
@Override
public void delete(Long id) {
SysDictDTO dto = this.get(id);
dictRedis.removeSimpleDictList(dto.getDictType());
logicDelete(new Long[]{id}, SysDictEntity.class);
}
@Override
public Result<List<SysSimpleDictDTO>> listSimpleDictInfo(String dictType) {
List<SysSimpleDictDTO> simpleDictList = Lists.newArrayList();
try {
if (StringUtils.isNotBlank(dictType)) {
List<SysSimpleDictDTO> dictList = dictRedis.getSimpleDictList(dictType);
if (null != dictList) {
return new Result<List<SysSimpleDictDTO>>().ok(dictList);
}
QueryWrapper<SysDictEntity> sdWrapper = new QueryWrapper<>();
sdWrapper.select("dict_value", "dict_name");
sdWrapper.eq("dict_type", dictType);
sdWrapper.ne("dict_value", "");
sdWrapper.isNotNull("dict_value");
sdWrapper.orderByAsc("SORT", Constant.CREATE_DATE);
List<SysDictEntity> entityList = baseDao.selectList(sdWrapper);
if (!entityList.isEmpty()) {
simpleDictList = ConvertUtils.sourceToTarget(entityList, SysSimpleDictDTO.class);
dictRedis.setSimpleDictList(dictType, simpleDictList);
}
}
} catch (Exception e) {
log.error("获取数据字典列表失败,错误信息{}", e.getMessage());
}
return new Result<List<SysSimpleDictDTO>>().ok(simpleDictList);
}
}

2
esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/application-dev.yml

@ -10,7 +10,7 @@ spring:
driver-class-name: com.mysql.cj.jdbc.Driver
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: elink888
password: elink833066
#Oracle
# driver-class-name: oracle.jdbc.OracleDriver
# url: jdbc:oracle:thin:@localhost:1521:xe

12
esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/application-test.yml

@ -1,16 +1,16 @@
spring:
redis:
database: 2
host: redis
host: 47.104.224.45
timeout: 30s
port: 6379
password: 123456
password: elink@888
datasource:
druid:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://localhost:3306/renren_cloud?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: renren
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver
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
initial-size: 10
max-active: 100
min-idle: 10

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

@ -15,6 +15,10 @@
order by t1.sort asc
</select>
<select id="getSubList" resultType="com.elink.esua.epdc.entity.SysDeptEntity">
SELECT * FROM sys_dept WHERE pid = #{pid} and del_flag = '0'
</select>
<select id="getById" 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.id = #{value} and t1.del_flag = 0

5
esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysDictDao.xml

@ -3,4 +3,9 @@
<mapper namespace="com.elink.esua.epdc.dao.SysDictDao">
<select id="getSubList" resultType="com.elink.esua.epdc.entity.SysDictEntity">
SELECT * FROM sys_dict WHERE pid = #{pid} and del_flag = '0'
</select>
</mapper>

8
esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysUserDao.xml

@ -23,7 +23,13 @@
</select>
<select id="getByUsername" resultType="com.elink.esua.epdc.entity.SysUserEntity">
select * from sys_user where username = #{value} and del_flag = 0
SELECT
d.`name` AS deptName,u.*
FROM
sys_user u
LEFT JOIN sys_dept d ON u.dept_id = d.id
WHERE
u.username = #{value} AND u.del_flag = 0
</select>
<update id="updatePassword">

4
esua-epdc/epdc-auth/pom.xml

@ -108,7 +108,7 @@
<profile>
<id>test</id>
<properties>
<server.port>9091</server.port>
<server.port>9056</server.port>
<spring.profiles.active>test</spring.profiles.active>
<!-- redis配置 -->
@ -127,7 +127,7 @@
<profile>
<id>prod</id>
<properties>
<server.port>9091</server.port>
<server.port>9056</server.port>
<spring.profiles.active>prod</spring.profiles.active>
<!-- redis配置 -->

2
esua-epdc/epdc-auth/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java

@ -28,7 +28,7 @@ public class UserFeignClientFallback implements UserFeignClient {
}
@Override
public Result<UserDetail> getByUsername(String username) {
public Result<UserDetail> getByUsername(String username) {
return new Result<>();
}
}

6
esua-epdc/epdc-commons/epdc-commons-mybatis/src/main/java/com/elink/esua/epdc/commons/mybatis/entity/BaseEpdcEntity.java

@ -8,10 +8,7 @@
package com.elink.esua.epdc.commons.mybatis.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
@ -68,6 +65,7 @@ public abstract class BaseEpdcEntity implements Serializable {
* 是否已删除(0-未删除1-已删除)
*/
@TableField(fill = FieldFill.INSERT)
@TableLogic
private String delFlag;
}

2
esua-epdc/epdc-commons/epdc-commons-mybatis/src/main/java/com/elink/esua/epdc/commons/mybatis/handler/FieldMetaObjectHandler.java

@ -53,7 +53,7 @@ public class FieldMetaObjectHandler implements MetaObjectHandler {
//删除标识
setFieldValByName(FieldConstant.DEL_FLAG_HUMP, EpdcDelFlagEnum.NORMAL.value(), metaObject);
// 数据权限标志
setFieldValByName(DEPT_ID, deptId, metaObject);
setInsertFieldValByName(DEPT_ID, deptId, metaObject);
} else {
if (user == null) {
return;

59
esua-epdc/epdc-commons/epdc-commons-mybatis/src/main/java/com/elink/esua/epdc/commons/mybatis/service/impl/BaseServiceImpl.java

@ -12,11 +12,11 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.enums.SqlMethod;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.core.toolkit.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.mybatis.utils.EntityUtils;
import com.elink.esua.epdc.commons.tools.constant.Constant;
import com.elink.esua.epdc.commons.tools.page.PageData;
@ -39,16 +39,53 @@ import java.util.Map;
* @since 1.0.0
*/
public abstract class BaseServiceImpl<M extends BaseMapper<T>, T> implements BaseService<T> {
@Autowired
protected M baseDao;
/**
* 获取分页对象
* @param params 分页查询参数
* @param defaultOrderField 默认排序字段
* @param isAsc 排序方式
*
* @param params 分页查询参数
* @param defaultOrderField 默认排序字段
* @param isAsc 排序方式
*/
protected IPage<T> getPage(Map<String, Object> params, String defaultOrderField, boolean isAsc) {
Page<T> page = initPage(params);
//默认排序
if (StringUtils.isNotEmpty(defaultOrderField)) {
if (isAsc) {
page.addOrder(OrderItem.asc(defaultOrderField));
} else {
page.addOrder(OrderItem.desc(defaultOrderField));
}
}
return page;
}
/**
* 获取分页对象
*
* @param params 分页查询参数
* @return com.baomidou.mybatisplus.core.metadata.IPage<T>
* @author yujintao
* @date 2019/6/12 10:57
*/
protected <T> IPage<T> getPage(Map<String, Object> params) {
Page<T> page = initPage(params);
return page;
}
/**
* 初始化分页对象
*
* @param params 分页查询参数
* @return com.baomidou.mybatisplus.core.metadata.IPage<T>
* @author yujintao
* @date 2019/6/12 10:57
*/
private <T> Page<T> initPage(Map<String, Object> params) {
//分页参数
long curPage = 1;
long limit = 10;
@ -73,19 +110,12 @@ public abstract class BaseServiceImpl<M extends BaseMapper<T>, T> implements Bas
//前端字段排序
if (StringUtils.isNotEmpty(orderField) && StringUtils.isNotEmpty(order)) {
if (Constant.ASC.equalsIgnoreCase(order)) {
return page.setAsc(orderField);
return page.addOrder(OrderItem.asc(orderField));
} else {
return page.setDesc(orderField);
return page.addOrder(OrderItem.desc(orderField));
}
}
//默认排序
if (isAsc) {
page.setAsc(defaultOrderField);
} else {
page.setDesc(defaultOrderField);
}
return page;
}
@ -113,9 +143,9 @@ public abstract class BaseServiceImpl<M extends BaseMapper<T>, T> implements Bas
/**
* 逻辑删除
*
* @param ids ids
* @param entity 实体
*
* @return boolean
*/
@Override
@ -156,6 +186,7 @@ public abstract class BaseServiceImpl<M extends BaseMapper<T>, T> implements Bas
/**
* 释放sqlSession
*
* @param sqlSession session
*/
protected void closeSqlSession(SqlSession sqlSession) {

41
esua-epdc/epdc-commons/epdc-commons-tools-phone/pom.xml

@ -0,0 +1,41 @@
<?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">
<parent>
<artifactId>epdc-commons</artifactId>
<groupId>com.esua.epdc</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>epdc-commons-tools-phone</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>libphonenumber</artifactId>
<version>8.8.8</version>
</dependency>
<dependency>
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>carrier</artifactId>
<version>1.75</version>
</dependency>
<dependency>
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>geocoder</artifactId>
<version>2.85</version>
</dependency>
<dependency>
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>prefixmapper</artifactId>
<version>2.85</version>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
</build>
</project>

79
esua-epdc/epdc-commons/epdc-commons-tools-phone/src/main/java/com/elink/esua/epdc/commons/tools/utils/PhoneDto.java

@ -0,0 +1,79 @@
package com.elink.esua.epdc.commons.tools.utils;
/**
* 电话DTO
*
* @author rongchao
* @Date 18-12-11
*/
public class PhoneDto {
/**
* 省份名称
*/
private String provinceName;
/**
* 城市名称
*/
private String cityName;
/**
* 运营商移动/电信/联通
*/
private String carrier;
/**
* 省份名称
*
* @return 获取provinceName属性值
*/
public String getProvinceName() {
return provinceName;
}
/**
* 省份名称
*
* @param provinceName 设置 provinceName 属性值为参数值 provinceName
*/
public void setProvinceName(String provinceName) {
this.provinceName = provinceName;
}
/**
* 城市名称
*
* @return 获取cityName属性值
*/
public String getCityName() {
return cityName;
}
/**
* 城市名称
*
* @param cityName 设置 cityName 属性值为参数值 cityName
*/
public void setCityName(String cityName) {
this.cityName = cityName;
}
/**
* 运营商移动/电信/联通
*
* @return 获取carrier属性值
*/
public String getCarrier() {
return carrier;
}
/**
* 运营商移动/电信/联通
*
* @param carrier 设置 carrier 属性值为参数值 carrier
*/
public void setCarrier(String carrier) {
this.carrier = carrier;
}
}

175
esua-epdc/epdc-commons/epdc-commons-tools-phone/src/main/java/com/elink/esua/epdc/commons/tools/utils/PhoneUtil.java

@ -0,0 +1,175 @@
package com.elink.esua.epdc.commons.tools.utils;
/**
* @author rongchao
* @Date 18-12-11
*/
import com.google.i18n.phonenumbers.PhoneNumberToCarrierMapper;
import com.google.i18n.phonenumbers.PhoneNumberUtil;
import com.google.i18n.phonenumbers.Phonenumber.PhoneNumber;
import com.google.i18n.phonenumbers.geocoding.PhoneNumberOfflineGeocoder;
import java.util.Locale;
/**
* 手机号归属地查询
* jar依赖com.googlecode.libphonenumber(LibphonenumberGeocoderPrefixmapper
* Carrier) pom依赖http://mvnrepository.com/search?q=libphonenumber
* 项目地址https://github.com/googlei18n/libphonenumber
*
* @author rongchao
* @Date 18-12-11
*/
public class PhoneUtil {
/**
* 直辖市
*/
private final static String[] MUNICIPALITY = {"北京市", "天津市", "上海市", "重庆市"};
/**
* 自治区
*/
private final static String[] AUTONOMOUS_REGION = {"新疆", "内蒙古", "西藏", "宁夏", "广西"};
private static PhoneNumberUtil phoneNumberUtil = PhoneNumberUtil
.getInstance();
/**
* 提供与电话号码相关的运营商信息
*/
private static PhoneNumberToCarrierMapper carrierMapper = PhoneNumberToCarrierMapper
.getInstance();
/**
* 提供与电话号码有关的地理信息
*/
private static PhoneNumberOfflineGeocoder geocoder = PhoneNumberOfflineGeocoder
.getInstance();
/**
* 中国大陆区区号
*/
private final static int COUNTRY_CODE = 86;
/**
* 根据手机号 判断手机号是否有效
*
* @param phoneNumber 手机号码
* @return true-有效 false-无效
*/
public static boolean checkPhoneNumber(String phoneNumber) {
long phone = Long.parseLong(phoneNumber);
PhoneNumber pn = new PhoneNumber();
pn.setCountryCode(COUNTRY_CODE);
pn.setNationalNumber(phone);
return phoneNumberUtil.isValidNumber(pn);
}
/**
* 根据手机号 判断手机运营商
*
* @param phoneNumber 手机号码
* @return 广东省广州市移动
*/
public static String getCarrier(String phoneNumber) {
long phone = Long.parseLong(phoneNumber);
PhoneNumber pn = new PhoneNumber();
pn.setCountryCode(COUNTRY_CODE);
pn.setNationalNumber(phone);
// 返回结果只有英文,自己转成成中文
String carrierEn = carrierMapper.getNameForNumber(pn, Locale.ENGLISH);
String carrierZh = "";
switch (carrierEn) {
case "China Mobile":
carrierZh += "移动";
break;
case "China Unicom":
carrierZh += "联通";
break;
case "China Telecom":
carrierZh += "电信";
break;
default:
break;
}
return carrierZh;
}
/**
* 根据手机号 获取手机归属地
*
* @param phoneNumber 手机号码
* @return 广东省广州市
*/
public static String getGeo(String phoneNumber) {
long phone = Long.parseLong(phoneNumber);
PhoneNumber pn = new PhoneNumber();
pn.setCountryCode(COUNTRY_CODE);
pn.setNationalNumber(phone);
return geocoder.getDescriptionForNumber(pn, Locale.CHINESE);
}
/**
* 根据手机号 获取手机信息模型
*
* <pre>
* 若返回值为null则说明该号码无效
* </pre>
*
* @param phoneNumber 手机号码
* @return 手机信息模型PhoneModel
*/
public static PhoneDto getPhoneDto(String phoneNumber) {
if (checkPhoneNumber(phoneNumber)) {
String geo = getGeo(phoneNumber);
PhoneDto phoneDto = new PhoneDto();
String carrier = getCarrier(phoneNumber);
phoneDto.setCarrier(carrier);
// 直辖市
for (String val : MUNICIPALITY) {
if (geo.equals(val)) {
phoneDto.setProvinceName(val.replace("市", ""));
phoneDto.setCityName(val);
return phoneDto;
}
}
// 自治区
for (String val : AUTONOMOUS_REGION) {
if (geo.startsWith(val)) {
phoneDto.setProvinceName(val);
phoneDto.setCityName(geo.replace(val, ""));
return phoneDto;
}
}
// 其它
String[] splitArr = geo.split("省");
if (splitArr != null && splitArr.length == 2) {
phoneDto.setProvinceName(splitArr[0]);
phoneDto.setCityName(splitArr[1]);
return phoneDto;
}
}
return null;
}
public static void main(String[] args) {
PhoneDto phoneDto = PhoneUtil.getPhoneDto("13701001254");
if (phoneDto != null) {
System.out.println(phoneDto.getProvinceName());
System.out.println(phoneDto.getCityName());
System.out.println(phoneDto.getCarrier());
} else {
System.err.println("该号码无效");
}
}
}

5
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/Constant.java

@ -60,6 +60,11 @@ public interface Constant {
*/
String CREATE_DATE = "create_date";
/**
* 创建时间字段名
*/
String CREATED_TIME = "created_time";
/**
* 数据权限过滤
*/

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

@ -24,7 +24,7 @@ public interface ServiceConstant {
*/
String EPDC_AUTH_SERVER = "epdc-auth-server";
/**
*
* 路由
*/
String EPDC_GATEWAY_SERVER = "epdc-gateway-server";
/**
@ -54,7 +54,7 @@ public interface ServiceConstant {
/**
* 党群议事模块
*/
String EPDC_ISSUE_SERVER = "epdc-issue-server";
String EPDC_EVENTS_SERVER = "epdc-events-server";
/**
* 生活服务模块
*/
@ -67,7 +67,6 @@ public interface ServiceConstant {
* APP用户模块
*/
String EPDC_USER_SERVER = "epdc-user-server";
/**
* DEMO服务
*/

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

@ -73,4 +73,28 @@ public class RedisKeys {
public static String getCpUserKey(String id) {
return "sys:security:cpuser:" + id;
}
/**
* 获取简要区划信息key
*
* @param areaId 行政区划ID
* @return java.lang.String
* @author yujintao
* @date 2019/9/3 16:28
*/
public static String getSimpleAreaKey(String areaId) {
return "epdc:config:simple:area:" + areaId;
}
/**
* 获取简要数据字典key
*
* @param dictType 数据字典类型
* @return java.lang.String
* @author yujintao
* @date 2019/9/3 16:28
*/
public static String getSimpleDictKey(String dictType) {
return "epdc:config:simple:dict:" + dictType;
}
}

1
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/user/UserDetail.java

@ -32,6 +32,7 @@ public class UserDetail implements Serializable {
private String email;
private String mobile;
private Long deptId;
private String deptName;
private String password;
private Integer status;
private Integer superAdmin;

40
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/RandomUtil.java

@ -0,0 +1,40 @@
package com.elink.esua.epdc.commons.tools.utils;
import java.util.Random;
/**
* @author rongchao
* @Date 18-12-17
*/
public class RandomUtil {
/**
* 根据需要生成指定长度的纯数字随机数,这个随机数的每一位都是从(0-9)这个产生的一位
*
* @param codeLen
* @return
*/
public static String getNewRandomCode(int codeLen) {
Random randomCode = new Random();
String strCode = "";
while (codeLen > 0) {
int charCode = randomCode.nextInt(9);
strCode += charCode;
codeLen--;
}
return strCode;
}
public static int getRandomNum(int min, int max) {
Random random = new Random();
return random.nextInt(max - min + 1) + min;
}
public static void main(String[] args) {
for (int i = 0; i < 10000; i++) {
int s = RandomUtil.getRandomNum(1, 10);
if (s < 1 || s > 10) {
System.out.println(s);
}
}
}
}

1
esua-epdc/epdc-commons/pom.xml

@ -18,5 +18,6 @@
<module>epdc-commons-mybatis</module>
<module>epdc-commons-dynamic-datasource</module>
<module>epdc-commons-api-version-control</module>
<module>epdc-commons-tools-phone</module>
</modules>
</project>

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

@ -80,7 +80,6 @@
<!-- gateway routes -->
<gateway.routes.epdc-auth-server.uri>lb://epdc-auth-server</gateway.routes.epdc-auth-server.uri>
<!-- <gateway.routes.epdc-auth-server.uri>http://127.0.0.1:9091</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-activiti-server.uri>lb://epdc-activiti-server</gateway.routes.epdc-activiti-server.uri>
@ -97,15 +96,15 @@
<gateway.routes.epdc-news-server.uri>lb://epdc-news-server</gateway.routes.epdc-news-server.uri>
<!-- <gateway.routes.epdc-news-server.uri>http://127.0.0.1:9064</gateway.routes.epdc-news-server.uri>-->
<gateway.routes.epdc-oss-server.uri>lb://epdc-oss-server</gateway.routes.epdc-oss-server.uri>
<gateway.routes.epdc-issue-server.uri>lb://epdc-issue-server</gateway.routes.epdc-issue-server.uri>
<!-- <gateway.routes.epdc-issue-server.uri>http://127.0.0.1:9066</gateway.routes.epdc-issue-server.uri>-->
<gateway.routes.epdc-events-server.uri>lb://epdc-events-server</gateway.routes.epdc-events-server.uri>
<!-- <gateway.routes.epdc-events-server.uri>http://127.0.0.1:9066</gateway.routes.epdc-events-server.uri>-->
<gateway.routes.epdc-services-server.uri>lb://epdc-services-server</gateway.routes.epdc-services-server.uri>
<!-- <gateway.routes.epdc-services-server.uri>http://127.0.0.1:9067</gateway.routes.epdc-services-server.uri>-->
<gateway.routes.epdc-user-server.uri>lb://epdc-user-server</gateway.routes.epdc-user-server.uri>
<!-- <gateway.routes.epdc-user-server.uri>http://127.0.0.1:9068</gateway.routes.epdc-user-server.uri>-->
<!--<gateway.routes.epdc-user-server.uri>lb://epdc-user-server</gateway.routes.epdc-user-server.uri>-->
<gateway.routes.epdc-user-server.uri>http://127.0.0.1:9068</gateway.routes.epdc-user-server.uri>
<gateway.routes.epdc-demo-server.uri>lb://epdc-demo-server</gateway.routes.epdc-demo-server.uri>
<!-- nacos -->
<nacos.register-enabled>true</nacos.register-enabled>
<nacos.register-enabled>false</nacos.register-enabled>
<nacos.server-addr>47.104.224.45:8848</nacos.server-addr>
<spring.zipkin.base-url>http://localhost:9411</spring.zipkin.base-url>
@ -134,7 +133,7 @@
<gateway.routes.epdc-neighbor-server.uri>lb://epdc-neighbor-server</gateway.routes.epdc-neighbor-server.uri>
<gateway.routes.epdc-news-server.uri>lb://epdc-news-server</gateway.routes.epdc-news-server.uri>
<gateway.routes.epdc-oss-server.uri>lb://epdc-oss-server</gateway.routes.epdc-oss-server.uri>
<gateway.routes.epdc-issue-server.uri>lb://epdc-issue-server</gateway.routes.epdc-issue-server.uri>
<gateway.routes.epdc-events-server.uri>lb://epdc-events-server</gateway.routes.epdc-events-server.uri>
<gateway.routes.epdc-services-server.uri>lb://epdc-services-server</gateway.routes.epdc-services-server.uri>
<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>
@ -169,7 +168,7 @@
<gateway.routes.epdc-neighbor-server.uri>lb://epdc-neighbor-server</gateway.routes.epdc-neighbor-server.uri>
<gateway.routes.epdc-news-server.uri>lb://epdc-news-server</gateway.routes.epdc-news-server.uri>
<gateway.routes.epdc-oss-server.uri>lb://epdc-oss-server</gateway.routes.epdc-oss-server.uri>
<gateway.routes.epdc-issue-server.uri>lb://epdc-issue-server</gateway.routes.epdc-issue-server.uri>
<gateway.routes.epdc-events-server.uri>lb://epdc-events-server</gateway.routes.epdc-events-server.uri>
<gateway.routes.epdc-services-server.uri>lb://epdc-services-server</gateway.routes.epdc-services-server.uri>
<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>

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

@ -96,11 +96,11 @@ spring:
filters:
- StripPrefix=0
#党群议事模块
- id: epdc-issue-server
uri: @gateway.routes.epdc-issue-server.uri@
- id: epdc-events-server
uri: @gateway.routes.epdc-events-server.uri@
order: 11
predicates:
- Path=/issue/**
- Path=/events/**
filters:
- StripPrefix=0
#生活服务模块

69
esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/processon/demo1.bpmn

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.w3.org/1999/XPath" id="m1567478636229" name="" targetNamespace="http://www.activiti.org/testm1567478636229" typeLanguage="http://www.w3.org/2001/XMLSchema">
<process id="demoTask" isClosed="false" isExecutable="true" name="测试任务流程" processType="None">
<startEvent id="_2" name="StartEvent"/>
<endEvent id="_3" name="EndEvent"/>
<userTask activiti:assignee="${deptId}" activiti:exclusive="true" id="_4" name="初次审核">
<extensionElements>
<activiti:executionListener event="end" expression="审核完成"/>
</extensionElements>
</userTask>
<userTask activiti:assignee="${deptId}" activiti:exclusive="true" id="_5" name="二次审核">
<extensionElements>
<activiti:executionListener event="end" expression="审核完成"/>
</extensionElements>
</userTask>
<sequenceFlow id="_6" sourceRef="_2" targetRef="_4"/>
<sequenceFlow id="_7" sourceRef="_4" targetRef="_5"/>
<sequenceFlow id="_8" sourceRef="_5" targetRef="_3"/>
</process>
<bpmndi:BPMNDiagram documentation="background=#FFFFFF;count=1;horizontalcount=1;orientation=0;width=842.4;height=1195.2;imageableWidth=832.4;imageableHeight=1185.2;imageableX=5.0;imageableY=5.0" id="Diagram-_1" name="New Diagram">
<bpmndi:BPMNPlane bpmnElement="demoTask">
<bpmndi:BPMNShape bpmnElement="_2" id="Shape-_2">
<dc:Bounds height="32.0" width="32.0" x="370.0" y="60.0"/>
<bpmndi:BPMNLabel>
<dc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_3" id="Shape-_3">
<dc:Bounds height="32.0" width="32.0" x="375.0" y="640.0"/>
<bpmndi:BPMNLabel>
<dc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_4" id="Shape-_4">
<dc:Bounds height="55.0" width="85.0" x="350.0" y="225.0"/>
<bpmndi:BPMNLabel>
<dc:Bounds height="55.0" width="85.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_5" id="Shape-_5">
<dc:Bounds height="55.0" width="85.0" x="355.0" y="415.0"/>
<bpmndi:BPMNLabel>
<dc:Bounds height="55.0" width="85.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="_6" id="BPMNEdge__6" sourceElement="_2" targetElement="_4">
<di:waypoint x="386.0" y="92.0"/>
<di:waypoint x="386.0" y="225.0"/>
<bpmndi:BPMNLabel>
<dc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_7" id="BPMNEdge__7" sourceElement="_4" targetElement="_5">
<di:waypoint x="395.0" y="280.0"/>
<di:waypoint x="395.0" y="415.0"/>
<bpmndi:BPMNLabel>
<dc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_8" id="BPMNEdge__8" sourceElement="_5" targetElement="_3">
<di:waypoint x="391.0" y="470.0"/>
<di:waypoint x="391.0" y="640.0"/>
<bpmndi:BPMNLabel>
<dc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>

89
esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/processon/yishi.bpmn

@ -1,43 +1,50 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI"
xmlns:activiti="http://activiti.org/bpmn"
xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:tns="http://www.activiti.org/test"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
expressionLanguage="http://www.w3.org/1999/XPath"
id="m1566628843418"
name=""
targetNamespace="http://www.activiti.org/test"
typeLanguage="http://www.w3.org/2001/XMLSchema">
<process xmlns="" id="myProcess_1" isClosed="false" isExecutable="true"
processType="None">
<startEvent id="_2" name="开始"/>
<userTask activiti:exclusive="true" id="_3" name="UserTask">
<extensionElements>
<activiti:taskListener event="create"/>
</extensionElements>
</userTask>
</process>
<bpmndi:BPMNDiagram xmlns=""
documentation="background=#3C3F41;count=1;horizontalcount=1;orientation=0;width=842.4;height=1195.2;imageableWidth=832.4;imageableHeight=1185.2;imageableX=5.0;imageableY=5.0"
id="Diagram-_1"
name="New Diagram">
<bpmndi:BPMNPlane bpmnElement="myProcess_1">
<bpmndi:BPMNShape bpmnElement="_2" id="Shape-_2">
<omgdc:Bounds height="32.0" width="32.0" x="245.0" y="100.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_3" id="Shape-_3">
<omgdc:Bounds height="55.0" width="85.0" x="255.0" y="200.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="85.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.activiti.org/test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.w3.org/1999/XPath" id="m1566628843418" name="" targetNamespace="http://www.activiti.org/test" typeLanguage="http://www.w3.org/2001/XMLSchema">
<process id="myProcess_1" isClosed="false" isExecutable="true" processType="None">
<startEvent id="_2" name="testTaskStart"/>
<endEvent id="_6" name="testTaskEnd"/>
<userTask activiti:exclusive="true" id="_11" name="UserTask">
<extensionElements>
<activiti:executionListener event="start" expression="test"/>
</extensionElements>
</userTask>
<sequenceFlow id="_13" sourceRef="_2" targetRef="_11"/>
<sequenceFlow id="_14" sourceRef="_11" targetRef="_6"/>
</process>
<bpmndi:BPMNDiagram documentation="background=#3C3F41;count=1;horizontalcount=1;orientation=0;width=842.4;height=1195.2;imageableWidth=832.4;imageableHeight=1185.2;imageableX=5.0;imageableY=5.0" id="Diagram-_1" name="New Diagram">
<bpmndi:BPMNPlane bpmnElement="myProcess_1">
<bpmndi:BPMNShape bpmnElement="_2" id="Shape-_2">
<omgdc:Bounds height="32.0" width="32.0" x="290.0" y="55.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_6" id="Shape-_6">
<omgdc:Bounds height="32.0" width="32.0" x="285.0" y="515.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_11" id="Shape-_11">
<omgdc:Bounds height="55.0" width="85.0" x="530.0" y="240.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="85.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="_13" id="BPMNEdge__13" sourceElement="_2" targetElement="_11">
<omgdi:waypoint x="322.0" y="71.0"/>
<omgdi:waypoint x="530.0" y="267.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_14" id="BPMNEdge__14" sourceElement="_11" targetElement="_6">
<omgdi:waypoint x="530.0" y="267.5"/>
<omgdi:waypoint x="317.0" y="531.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>

24
esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/src/main/java/com/elink/esua/epdc/service/ActWorkflowCommonService.java

@ -0,0 +1,24 @@
package com.elink.esua.epdc.service;
/**
* activiti工作流
*
* @author yujintao
* @email yujintao@elink-cn.com
* @date 2019/9/3 11:18
*/
public interface ActWorkflowCommonService {
/**
* 启动流程并绑定任务
*
* @param processKey 流程ID
* @param businessKey 任务ID
* @param deptId 部门ID通过部门ID判断是否有权限审核任务
* @return boolean
* @author yujintao
* @date 2019/9/3 13:58
*/
boolean startProcess(String processKey, String businessKey, String deptId);
}

50
esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/src/main/java/com/elink/esua/epdc/service/impl/ActWorkflowCommonServiceImpl.java

@ -0,0 +1,50 @@
package com.elink.esua.epdc.service.impl;
import com.elink.esua.epdc.service.ActWorkflowCommonService;
import com.google.common.collect.Maps;
import org.activiti.engine.HistoryService;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.runtime.ProcessInstance;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.context.ContextLoader;
import org.springframework.web.context.WebApplicationContext;
import java.util.HashMap;
import java.util.Map;
/**
* @author yujintao
* @email yujintao@elink-cn.com
* @date 2019/9/3 11:19
*/
@Service
public class ActWorkflowCommonServiceImpl implements ActWorkflowCommonService {
@Autowired
private RepositoryService repositoryService;
@Autowired
private RuntimeService runtimeService;
@Autowired
private TaskService taskService;
@Autowired
private HistoryService historyService;
@Override
public boolean startProcess(String processKey, String businessKey, String deptId) {
Map<String, Object> map = Maps.newHashMap();
map.put("deptId", deptId);
map.put("activityId", "_2");
//使用正在执行对象表中的一个字段BUSINESS_KEY(Activiti提供的一个字段),让启动的流程(流程实例)关联业务
runtimeService.startProcessInstanceByKey(processKey, businessKey, map);
return true;
}
}

110
esua-epdc/epdc-module/epdc-activiti/epdc-activiti-server/src/test/java/com/elink/esua/epdc/ActivitiTest.java

@ -0,0 +1,110 @@
package com.elink.esua.epdc;
import com.elink.esua.epdc.service.ActWorkflowCommonService;
import com.google.common.collect.Maps;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.activiti.engine.task.TaskQuery;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.List;
import java.util.Map;
/**
* @author yujintao
* @email yujintao@elink-cn.com
* @date 2019/9/3 10:06
*/
@RunWith(SpringRunner.class)
@SpringBootTest
public class ActivitiTest {
@Autowired
private ActWorkflowCommonService actWorkflowCommonService;
@Autowired
private TaskService taskService;
@Autowired
private RuntimeService runtimeService;
@Test
public void test() {
String processId = "demoTask";
// 启动一个任务流程
actWorkflowCommonService.startProcess(processId, "testBusinessKey3", "testDeptId");
}
@Test
public void test2() {
String processId = "demoTask";
String deptId = "testDeptId";
this.queryTask(processId, deptId);
/*
关联业务idtestBusinessKey
流程实例id5001
任务id5006
任务标识_4
任务负责人testDeptId
任务名称初次审核
任务创建时间Tue Sep 03 14:26:50 CST 2019
*/
}
@Test
public void test3() {
Map<String, Object> map = Maps.newHashMap();
map.put("deptId", "testDeptId2");
taskService.complete("5006", map);
}
@Test
public void test4() {
String processId = "demoTask";
String deptId = "testDeptId2";
this.queryTask(processId, deptId);
/*
关联业务idtestBusinessKey
流程实例id5001
任务id7502
任务标识_5
任务负责人testDeptId2
任务名称二次审核
任务创建时间Tue Sep 03 14:49:29 CST 2019
*/
}
private void queryTask(String processId, String deptId) {
//创建查询对象
TaskQuery taskQuery = taskService.createTaskQuery().taskAssignee(deptId).processDefinitionKey(processId);
//获取查询列表
List<Task> list = taskQuery.list();
for (Task task : list) {
//流程实例id
String processInstanceId = task.getProcessInstanceId();
//根据流程实例id找到流程实例对象
ProcessInstance processInstance = runtimeService
.createProcessInstanceQuery()
.processInstanceId(processInstanceId)
.singleResult();
//从流程实例对象获取bussinesskey
String businessKey = processInstance.getBusinessKey();
//根据businessKey查询业务系统,获取相关的业务信息
System.out.println("关联业务id:" + businessKey);
System.out.println("流程实例id:" + task.getProcessInstanceId());
System.out.println("任务id:" + task.getId());
System.out.println("任务标识:" + task.getTaskDefinitionKey());
System.out.println("任务负责人:" + task.getAssignee());
System.out.println("任务名称:" + task.getName());
System.out.println("任务创建时间:" + task.getCreateTime());
}
}
}

4
esua-epdc/epdc-module/epdc-app/epdc-app-client/pom.xml

@ -35,7 +35,7 @@
</dependency>
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-issue-client</artifactId>
<artifactId>epdc-events-client</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
@ -50,4 +50,4 @@
</dependency>
</dependencies>
</project>
</project>

5
esua-epdc/epdc-module/epdc-demo/epdc-demo-server/pom.xml

@ -41,6 +41,11 @@
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>${spring.boot.admin.version}</version>
</dependency>
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-commons-tools-phone</artifactId>
<version>1.0.0</version>
</dependency>
<!-- nacos start -->
<dependency>

9
esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/test/java/com/elink/esua/epdc/OrikaTest.java

@ -1,6 +1,8 @@
package com.elink.esua.epdc;
import com.alibaba.fastjson.JSON;
import com.elink.esua.epdc.commons.tools.utils.PhoneDto;
import com.elink.esua.epdc.commons.tools.utils.PhoneUtil;
import com.elink.esua.epdc.entity.DemoEntity;
import com.elink.esua.epdc.entity.TransforDemoEntity;
import ma.glasnost.orika.MapperFacade;
@ -35,4 +37,11 @@ public class OrikaTest {
System.out.println(JSON.toJSONString(transforEntity));
}
@Test
public void test1(){
PhoneDto phoneDto = PhoneUtil.getPhoneDto("18268115282");
System.out.println(JSON.toJSONString(phoneDto));
}
}

6
esua-epdc/epdc-module/epdc-issue/epdc-issue-client/pom.xml → esua-epdc/epdc-module/epdc-events/epdc-events-client/pom.xml

@ -3,14 +3,14 @@
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">
<parent>
<artifactId>epdc-issue</artifactId>
<artifactId>epdc-events</artifactId>
<groupId>com.esua.epdc</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>epdc-issue-client</artifactId>
<artifactId>epdc-events-client</artifactId>
<packaging>jar</packaging>
</project>
</project>

0
esua-epdc/epdc-module/epdc-issue/epdc-issue-client/src/main/java/com/elink/esua/epdc/epdc.gitkeep → esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/epdc.gitkeep

8
esua-epdc/epdc-module/epdc-issue/epdc-issue-server/pom.xml → esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml

@ -3,19 +3,19 @@
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">
<parent>
<artifactId>epdc-issue</artifactId>
<artifactId>epdc-events</artifactId>
<groupId>com.esua.epdc</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>epdc-issue-server</artifactId>
<artifactId>epdc-events-server</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-issue-client</artifactId>
<artifactId>epdc-events-client</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
@ -143,4 +143,4 @@
</profile>
</profiles>
</project>
</project>

4
esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/java/com/elink/esua/epdc/IssueApplication.java → esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/EventsApplication.java

@ -22,10 +22,10 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
public class IssueApplication {
public class EventsApplication {
public static void main(String[] args) {
SpringApplication.run(IssueApplication.class, args);
SpringApplication.run(EventsApplication.class, args);
}
}

2
esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/java/com/elink/esua/epdc/config/ModuleConfigImpl.java → esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/config/ModuleConfigImpl.java

@ -21,6 +21,6 @@ import org.springframework.stereotype.Service;
public class ModuleConfigImpl implements ModuleConfig {
@Override
public String getName() {
return "issue";
return "events";
}
}

6
esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/application.yml → esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/application.yml

@ -1,11 +1,11 @@
server:
port: @server.port@
servlet:
context-path: /issue
context-path: /events
spring:
application:
name: epdc-issue-server
name: epdc-events-server
# 环境 dev|test|prod
profiles:
active: @spring.profiles.active@
@ -28,7 +28,7 @@ spring:
register-enabled: @nacos.register-enabled@
alibaba:
seata:
tx-service-group: epdc-issue-server-fescar-service-group
tx-service-group: epdc-events-server-fescar-service-group
datasource:
druid:
driver-class-name: com.mysql.jdbc.Driver

0
esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/i18n/messages.properties → esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/messages.properties

0
esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/i18n/messages_en_US.properties → esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/messages_en_US.properties

0
esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/i18n/messages_zh_CN.properties → esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/messages_zh_CN.properties

0
esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/i18n/messages_zh_TW.properties → esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/messages_zh_TW.properties

0
esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/i18n/validation.properties → esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/validation.properties

0
esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/i18n/validation_en_US.properties → esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/validation_en_US.properties

0
esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/i18n/validation_zh_CN.properties → esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/validation_zh_CN.properties

0
esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/i18n/validation_zh_TW.properties → esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/validation_zh_TW.properties

4
esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/logback-spring.xml → esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/logback-spring.xml

@ -2,7 +2,7 @@
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<property name="log.path" value="logs/issue"/>
<property name="log.path" value="logs/events"/>
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN"
@ -156,4 +156,4 @@
</root>
</springProfile>
</configuration>
</configuration>

0
esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/registry.conf → esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/registry.conf

8
esua-epdc/epdc-module/epdc-issue/pom.xml → esua-epdc/epdc-module/epdc-events/pom.xml

@ -9,12 +9,12 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>epdc-issue</artifactId>
<artifactId>epdc-events</artifactId>
<packaging>pom</packaging>
<modules>
<module>epdc-issue-client</module>
<module>epdc-issue-server</module>
<module>epdc-events-client</module>
<module>epdc-events-server</module>
</modules>
</project>
</project>

6
esua-epdc/epdc-module/epdc-oss/epdc-oss-server/pom.xml

@ -132,7 +132,7 @@
<![CDATA[jdbc:mysql://47.104.224.45:3308/esua_epdc_admin?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</spring.datasource.druid.url>
<spring.datasource.druid.username>epdc</spring.datasource.druid.username>
<spring.datasource.druid.password>elink888</spring.datasource.druid.password>
<spring.datasource.druid.password>elink833066</spring.datasource.druid.password>
<nacos.register-enabled>false</nacos.register-enabled>
<nacos.server-addr>47.104.224.45:8848</nacos.server-addr>
@ -155,9 +155,9 @@
<![CDATA[jdbc:mysql://47.104.224.45:3308/esua_epdc_admin?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</spring.datasource.druid.url>
<spring.datasource.druid.username>epdc</spring.datasource.druid.username>
<spring.datasource.druid.password>elink888</spring.datasource.druid.password>
<spring.datasource.druid.password>elink833066</spring.datasource.druid.password>
<nacos.register-enabled>false</nacos.register-enabled>
<nacos.register-enabled>true</nacos.register-enabled>
<nacos.server-addr>47.104.224.45:8848</nacos.server-addr>
</properties>
</profile>

2
esua-epdc/epdc-module/epdc-oss/epdc-oss-server/src/main/resources/application.yml

@ -60,7 +60,7 @@ management:
mybatis-plus:
mapper-locations: classpath:/mapper/**/*.xml
#实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage: io.renren.entity
typeAliasesPackage: io.renren.entity;com.elink.esua.epdc.entity
global-config:
#数据库相关配置
db-config:

152
esua-epdc/epdc-module/epdc-oss/epdc-oss-server/src/main/resources/logback-spring.xml

@ -1,21 +1,159 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml" />
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="TRACE" />
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<property name="log.path" value="logs/oss"/>
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
<!--1. 输出到控制台-->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>debug</level>
</filter>
<encoder>
<Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
<!-- 设置字符集 -->
<charset>UTF-8</charset>
</encoder>
</appender>
<!--2. 输出到文档-->
<!-- 2.1 level为 DEBUG 日志,时间滚动输出 -->
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/debug.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志归档 -->
<fileNamePattern>${log.path}/debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录debug级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>debug</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 2.2 level为 INFO 日志,时间滚动输出 -->
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/info.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 每天日志归档路径以及格式 -->
<fileNamePattern>${log.path}/info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录info级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>info</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 2.3 level为 WARN 日志,时间滚动输出 -->
<appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/warn.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录warn级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>warn</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 2.4 level为 ERROR 日志,时间滚动输出 -->
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/error.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录ERROR级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 开发、测试环境 -->
<springProfile name="dev,test">
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO" />
<logger name="io.renren" level="DEBUG" />
<logger name="org.springboot.sample" level="INFO"/>
<logger name="com.elink.esua.epdc" level="INFO"/>
<logger name="com.elink.esua.epdc.dao" level="DEBUG"/>
<root level="INFO">
<appender-ref ref="DEBUG_FILE"/>
<appender-ref ref="INFO_FILE"/>
<appender-ref ref="WARN_FILE"/>
<appender-ref ref="ERROR_FILE"/>
</root>
</springProfile>
<!-- 生产环境 -->
<springProfile name="prod">
<logger name="org.springframework.web" level="ERROR"/>
<logger name="org.springboot.sample" level="ERROR" />
<logger name="io.renren" level="ERROR" />
<logger name="org.springboot.sample" level="ERROR"/>
<logger name="com.elink.esua.epdc" level="ERROR"/>
<root level="ERROR">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="DEBUG_FILE"/>
<appender-ref ref="INFO_FILE"/>
<appender-ref ref="WARN_FILE"/>
<appender-ref ref="ERROR_FILE"/>
</root>
</springProfile>
</configuration>

15
esua-epdc/epdc-module/epdc-user/epdc-user-client/pom.xml

@ -7,9 +7,22 @@
<groupId>com.esua.epdc</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>epdc-user-client</artifactId>
<packaging>jar</packaging>
</project>
<dependencies>
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-commons-tools</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
</build>
</project>

85
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PartyMembersDTO.java

@ -0,0 +1,85 @@
/**
* 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;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import lombok.Data;
/**
* 党员表
*
* @author Mark sunlightcs@gmail.com
* @since v1.0.0 2019-09-02
*/
@Data
public class PartyMembersDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String tagIds;
private String tagName;
private String id;
private String realName;
private String mobile;
private String identityNo;
private String post;
private String postValue;
private String cadreFlag;
private String registFlag;
private Date registTime;
private String streetName;
private long streetId;
private String communityName;
private long communityId;
private String gridName;
private long gridId;
private long deptId;
private Integer revision;
private String createdBy;
private Date createdTime;
private String updatedBy;
private Date updatedTime;
private String delFlag;
}

54
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PartyTagRelationDTO.java

@ -0,0 +1,54 @@
/**
* 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;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 党员标签关系表
*
* @author Mark sunlightcs@gmail.com
* @since v1.0.0 2019-09-04
*/
@Data
public class PartyTagRelationDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String id;
private String partyId;
private String tagId;
private Integer revision;
private String createdBy;
private Date createdTime;
private String updatedBy;
private Date updatedTime;
private String delFlag;
}

159
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserDTO.java

@ -0,0 +1,159 @@
/**
* 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;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 用户信息表
*
* @author qu qu@gmail.com
* @since v1.0.0 2019-09-02
*/
@Data
public class UserDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String id;
private String nickname;
private String mobile;
private String password;
private Date registerTime;
private String faceImg;
// @ApiModelProperty(value = "性别(女性-female,男性-male)")
private String sex;
// @ApiModelProperty(value = "生日")
private Date birthday;
// @ApiModelProperty(value = "邮箱")
private String email;
// @ApiModelProperty(value = "电话")
private String telephone;
// @ApiModelProperty(value = "邮编")
private String zipCode;
// @ApiModelProperty(value = "职业")
private String profession;
// @ApiModelProperty(value = "爱好")
private String hobbies;
// @ApiModelProperty(value = "个性签名")
private String userSign;
// @ApiModelProperty(value = "邀请码")
private String invitationCode;
// @ApiModelProperty(value = "最近登录时间")
private Date lastLoginTime;
// @ApiModelProperty(value = "最近登录IP")
private String lastLoginIp;
// @ApiModelProperty(value = "最近登录位置经度")
private String lastLongitude;
// @ApiModelProperty(value = "最近登录位置维度")
private String lastLatitude;
// @ApiModelProperty(value = "真实姓名")
private String realName;
// @ApiModelProperty(value = "身份证号")
private String identityNo;
// @ApiModelProperty(value = "居民住址")
private String address;
// @ApiModelProperty(value = "微信OPENID")
private String wxOpenId;
// @ApiModelProperty(value = "是否是党员(0-否,1-是)")
private String partyFlag;
// @ApiModelProperty(value = "注册方式(wx:微信注册)")
private String registerWay;
// @ApiModelProperty(value = "用户来源(wp:公众号)")
private String registerSource;
// @ApiModelProperty(value = "手机号所属省份")
private String phoneProvince;
// @ApiModelProperty(value = "手机号所属城市")
private String phoneCity;
// @ApiModelProperty(value = "手机号所属运营商")
private String phoneCarrier;
// @ApiModelProperty(value = "用户积分")
private Integer points;
// @ApiModelProperty(value = "邀请人ID")
private String inviteUserId;
// @ApiModelProperty(value = "乐观锁")
private Integer revision;
// @ApiModelProperty(value = "网格ID")
private String gridId;
// @ApiModelProperty(value = "创建人")
private String createdBy;
// @ApiModelProperty(value = "创建时间")
private Date createdTime;
// @ApiModelProperty(value = "更新人")
private String updatedBy;
// @ApiModelProperty(value = "更新时间")
private Date updatedTime;
// @ApiModelProperty(value = "删除标记")
private String delFlag;
/**
* 审核状态
*/
private Integer state;
private String grid;
private String street;
private String streetId;
private String community;
private String communityId;
}

54
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserTagDTO.java

@ -0,0 +1,54 @@
/**
* 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;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 用户标签表
*
* @author Mark sunlightcs@gmail.com
* @since v1.0.0 2019-09-02
*/
@Data
public class UserTagDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String id;
private String tagName;
private String tagDesc;
private Integer revision;
private String createdBy;
private Date createdTime;
private String updatedBy;
private Date updatedTime;
private String delFlag;
}

37
esua-epdc/epdc-module/epdc-user/epdc-user-server/pom.xml

@ -16,17 +16,22 @@
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-user-client</artifactId>
<version>1.0.0</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-commons-tools-phone</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-commons-tools</artifactId>
<version>1.0.0</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-commons-mybatis</artifactId>
<version>1.0.0</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
@ -45,6 +50,18 @@
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>${spring.boot.admin.version}</version>
</dependency>
<!--微信公众号-->
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-mp</artifactId>
<version>3.4.0</version>
</dependency>
<!--token-->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.9.0</version>
</dependency>
</dependencies>
<build>
@ -86,10 +103,10 @@
<spring.redis.password>elink@888</spring.redis.password>
<spring.datasource.druid.url>
<![CDATA[jdbc:mysql://47.104.224.45:3308/esua_epdc_job?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
<![CDATA[jdbc:mysql://47.104.224.45:3308/esua_epdc_user?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</spring.datasource.druid.url>
<spring.datasource.druid.username>epdc</spring.datasource.druid.username>
<spring.datasource.druid.password>elink888</spring.datasource.druid.password>
<spring.datasource.druid.password>elink833066</spring.datasource.druid.password>
<nacos.register-enabled>false</nacos.register-enabled>
<nacos.server-addr>47.104.224.45:8848</nacos.server-addr>
@ -109,10 +126,10 @@
<spring.redis.password>elink@888</spring.redis.password>
<spring.datasource.druid.url>
<![CDATA[jdbc:mysql://47.104.224.45:3308/esua_epdc_job?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
<![CDATA[jdbc:mysql://47.104.224.45:3308/esua_epdc_user?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</spring.datasource.druid.url>
<spring.datasource.druid.username>epdc</spring.datasource.druid.username>
<spring.datasource.druid.password>elink888</spring.datasource.druid.password>
<spring.datasource.druid.password>elink833066</spring.datasource.druid.password>
<nacos.register-enabled>false</nacos.register-enabled>
<nacos.server-addr>47.104.224.45:8848</nacos.server-addr>
@ -132,10 +149,10 @@
<spring.redis.password>elink@888</spring.redis.password>
<spring.datasource.druid.url>
<![CDATA[jdbc:mysql://47.104.224.45:3308/esua_epdc_job?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
<![CDATA[jdbc:mysql://47.104.224.45:3308/esua_epdc_user?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</spring.datasource.druid.url>
<spring.datasource.druid.username>epdc</spring.datasource.druid.username>
<spring.datasource.druid.password>elink888</spring.datasource.druid.password>
<spring.datasource.druid.password>elink833066</spring.datasource.druid.password>
<nacos.register-enabled>false</nacos.register-enabled>
<nacos.server-addr>47.104.224.45:8848</nacos.server-addr>
@ -143,4 +160,4 @@
</profile>
</profiles>
</project>
</project>

45
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/config/WxMpConfig.java

@ -0,0 +1,45 @@
package com.elink.esua.epdc.config;
import com.elink.esua.epdc.config.property.WxMpProperties;
import me.chanjar.weixin.mp.api.WxMpConfigStorage;
import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* 微信公众号配置
*
* @author yujintao
* @date 2019/6/17 17:38
*/
@Configuration
@EnableConfigurationProperties(WxMpProperties.class)
public class WxMpConfig {
private WxMpProperties properties;
@Autowired
public WxMpConfig(WxMpProperties properties) {
this.properties = properties;
}
@Bean
public WxMpService wxMpService() {
WxMpService wxMpService = new WxMpServiceImpl();
wxMpService.setWxMpConfigStorage(wxMpConfigStorage());
return wxMpService;
}
@Bean
public WxMpConfigStorage wxMpConfigStorage() {
WxMpInMemoryConfigStorage wxMpConfigStorage = new WxMpInMemoryConfigStorage();
wxMpConfigStorage.setAppId(properties.getAppid());
wxMpConfigStorage.setSecret(properties.getSecret());
return wxMpConfigStorage;
}
}

26
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/config/property/WxMpProperties.java

@ -0,0 +1,26 @@
package com.elink.esua.epdc.config.property;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* 微信公众号框架配置类
*
* @author
* @Date
*/
@Data
@ConfigurationProperties(prefix = "wx.mp")
public class WxMpProperties {
/**
* 设置微信公众号的appid
*/
private String appid;
/**
* 设置微信公众号的Secret
*/
private String secret;
}

103
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/PartyMembersController.java

@ -0,0 +1,103 @@
/**
* 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.controller;
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.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.dto.PartyMembersDTO;
import com.elink.esua.epdc.excel.PartyMembersExcel;
import com.elink.esua.epdc.service.PartyMembersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 党员表
*
* @author Mark sunlightcs@gmail.com
* @since v1.0.0 2019-09-02
*/
@RestController
@RequestMapping("/partymembers")
public class PartyMembersController {
@Autowired
private PartyMembersService partyMembersService;
@GetMapping("page")
public Result<PageData<PartyMembersDTO>> page(@RequestParam Map<String, Object> params){
return partyMembersService.pageDIY(params);
}
@GetMapping("{id}")
public Result<PartyMembersDTO> get(@PathVariable("id") String id){
PartyMembersDTO data = partyMembersService.get(id);
return new Result<PartyMembersDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody PartyMembersDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
dto.setDeptId(SecurityUser.getDeptId());
partyMembersService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody PartyMembersDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
partyMembersService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
partyMembersService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<PartyMembersDTO> list = partyMembersService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, PartyMembersExcel.class);
}
}

102
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/PartyTagRelationController.java

@ -0,0 +1,102 @@
/**
* 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.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.dto.PartyTagRelationDTO;
import com.elink.esua.epdc.excel.PartyTagRelationExcel;
import com.elink.esua.epdc.service.PartyTagRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 党员标签关系表
*
* @author Mark sunlightcs@gmail.com
* @since v1.0.0 2019-09-04
*/
@RestController
@RequestMapping("/partytagrelation")
public class PartyTagRelationController {
@Autowired
private PartyTagRelationService partyTagRelationService;
@GetMapping("page")
public Result<PageData<PartyTagRelationDTO>> page(@RequestParam Map<String, Object> params){
PageData<PartyTagRelationDTO> page = partyTagRelationService.page(params);
return new Result<PageData<PartyTagRelationDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<PartyTagRelationDTO> get(@PathVariable("id") String id){
PartyTagRelationDTO data = partyTagRelationService.get(id);
return new Result<PartyTagRelationDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody PartyTagRelationDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
partyTagRelationService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody PartyTagRelationDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
partyTagRelationService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
partyTagRelationService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<PartyTagRelationDTO> list = partyTagRelationService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, PartyTagRelationExcel.class);
}
}

101
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserController.java

@ -0,0 +1,101 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.dto.UserDTO;
import com.elink.esua.epdc.excel.UserExcel;
import com.elink.esua.epdc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 用户信息表
*
* @author qu qu@gmail.com
* @since v1.0.0 2019-09-02
*/
@RestController
@RequestMapping("user")
public class UserController {
@Autowired
private UserService userService;
@GetMapping("page")
public Result<PageData<UserDTO>> page( @RequestParam Map<String, Object> params){
PageData<UserDTO> page = userService.page(params);
return new Result<PageData<UserDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<UserDTO> get(@PathVariable("id") String id){
UserDTO data = userService.get(id);
return new Result<UserDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody UserDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
userService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody UserDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
userService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
userService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export( @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<UserDTO> list = userService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, UserExcel.class);
}
}

107
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserTagController.java

@ -0,0 +1,107 @@
/**
* 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.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.dto.UserTagDTO;
import com.elink.esua.epdc.excel.UserTagExcel;
import com.elink.esua.epdc.service.UserTagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 用户标签表
*
* @author Mark sunlightcs@gmail.com
* @since v1.0.0 2019-09-02
*/
@RestController
@RequestMapping("/usertag")
public class UserTagController {
@Autowired
private UserTagService userTagService;
@GetMapping("page")
public Result<PageData<UserTagDTO>> page(@RequestParam Map<String, Object> params){
PageData<UserTagDTO> page = userTagService.page(params);
return new Result<PageData<UserTagDTO>>().ok(page);
}
@GetMapping("list")
public Result<List<UserTagDTO>> list(@RequestParam Map<String, Object> params){
List<UserTagDTO> list = userTagService.list(params);
return new Result<List<UserTagDTO>>().ok(list);
}
@GetMapping("{id}")
public Result<UserTagDTO> get(@PathVariable("id") String id){
UserTagDTO data = userTagService.get(id);
return new Result<UserTagDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody UserTagDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
userTagService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody UserTagDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
userTagService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
userTagService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<UserTagDTO> list = userTagService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, UserTagExcel.class);
}
}

41
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PartyMembersDao.java

@ -0,0 +1,41 @@
/**
* 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.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.PartyMembersDTO;
import com.elink.esua.epdc.entity.PartyMembersEntity;
import org.apache.ibatis.annotations.Mapper;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/**
* 党员表
*
* @author Mark sunlightcs@gmail.com
* @since v1.0.0 2019-09-02
*/
@Mapper
public interface PartyMembersDao extends BaseDao<PartyMembersEntity> {
List<PartyMembersDTO> pageDIY(Map<String, Object> params);
PartyMembersDTO selectByIdNew(String id);
}

33
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PartyTagRelationDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.entity.PartyTagRelationEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 党员标签关系表
*
* @author Mark sunlightcs@gmail.com
* @since v1.0.0 2019-09-04
*/
@Mapper
public interface PartyTagRelationDao extends BaseDao<PartyTagRelationEntity> {
}

33
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.entity.UserEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 用户信息表
*
* @author qu qu@gmail.com
* @since v1.0.0 2019-09-02
*/
@Mapper
public interface UserDao extends BaseDao<UserEntity> {
}

33
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserTagDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.entity.UserTagEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 用户标签表
*
* @author Mark sunlightcs@gmail.com
* @since v1.0.0 2019-09-02
*/
@Mapper
public interface UserTagDao extends BaseDao<UserTagEntity> {
}

105
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PartyMembersEntity.java

@ -0,0 +1,105 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 党员表
*
* @author Mark sunlightcs@gmail.com
* @since v1.0.0 2019-09-02
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_party_members")
public class PartyMembersEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 姓名
*/
private String realName;
/**
* 手机号
*/
private String mobile;
/**
* 身份证号
*/
private String identityNo;
/**
* 职务
*/
private String post;
/**
* 职务ID字典表
*/
private String postValue;
/**
* 干部下沉标识(0-1-)
*/
private String cadreFlag;
/**
* 注册状态0-1-
*/
private String registFlag;
/**
* 注册时间
*/
private Date registTime;
/**
* 街道名称
*/
private String streetName;
/**
* 街道ID
*/
private long streetId;
/**
* 社区名称
*/
private String communityName;
/**
* 社区ID
*/
private long communityId;
/**
* 网格名称
*/
private String gridName;
/**
* 网格ID
*/
private long gridId;
/**
* 部门ID
*/
private long deptId;
}

53
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PartyTagRelationEntity.java

@ -0,0 +1,53 @@
/**
* 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.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 党员标签关系表
*
* @author Mark sunlightcs@gmail.com
* @since v1.0.0 2019-09-04
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_party_tag_relation")
public class PartyTagRelationEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 党员ID
*/
private String partyId;
/**
* 标签ID
*/
private String tagId;
}

183
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserEntity.java

@ -0,0 +1,183 @@
/**
* 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.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 用户信息表
*
* @author qu qu@gmail.com
* @since v1.0.0 2019-09-02
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_user")
public class UserEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 昵称
*/
private String nickname;
/**
* 手机号
*/
private String mobile;
/**
* 密码
*/
private String password;
/**
* 注册时间
*/
private Date registerTime;
/**
* 头像
*/
private String faceImg;
/**
* 性别(女性-female男性-male)
*/
private String sex;
/**
* 生日
*/
private Date birthday;
/**
* 邮箱
*/
private String email;
/**
* 电话
*/
private String telephone;
/**
* 邮编
*/
private String zipCode;
/**
* 职业
*/
private String profession;
/**
* 爱好
*/
private String hobbies;
/**
* 个性签名
*/
private String userSign;
/**
* 邀请码
*/
private String invitationCode;
/**
* 最近登录时间
*/
private Date lastLoginTime;
/**
* 最近登录IP
*/
private String lastLoginIp;
/**
* 最近登录位置经度
*/
private String lastLongitude;
/**
* 最近登录位置维度
*/
private String lastLatitude;
/**
* 真实姓名
*/
private String realName;
/**
* 身份证号
*/
private String identityNo;
/**
* 居民住址
*/
private String address;
/**
* 微信OPENID
*/
private String wxOpenId;
/**
* 是否是党员(0-1-)
*/
private String partyFlag;
/**
* 注册方式wx微信注册
*/
private String registerWay;
/**
* 用户来源(wp:公众号)
*/
private String registerSource;
/**
* 手机号所属省份
*/
private String phoneProvince;
/**
* 手机号所属城市
*/
private String phoneCity;
/**
* 手机号所属运营商
*/
private String phoneCarrier;
/**
* 用户积分
*/
private Integer points;
/**
* 邀请人ID
*/
private String inviteUserId;
/**
* 网格ID
*/
private String gridId;
/**
* 审核状态
*/
private Integer state;
private String grid;
private String street;
private String streetId;
private String community;
private String communityId;
}

53
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserTagEntity.java

@ -0,0 +1,53 @@
/**
* 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.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 用户标签表
*
* @author Mark sunlightcs@gmail.com
* @since v1.0.0 2019-09-02
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_user_tag")
public class UserTagEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 标签名
*/
private String tagName;
/**
* 标签描述
*/
private String tagDesc;
}

78
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/PartyMembersExcel.java

@ -0,0 +1,78 @@
/**
* 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.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 党员表
*
* @author Mark sunlightcs@gmail.com
* @since v1.0.0 2019-09-02
*/
@Data
public class PartyMembersExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "姓名")
private String realName;
@Excel(name = "手机号")
private String mobile;
@Excel(name = "身份证号")
private String identityNo;
@Excel(name = "职务")
private String post;
@Excel(name = "职务ID(字典表)")
private String postId;
@Excel(name = "干部下沉标识(0-否,1-是)")
private String cadreFlag;
@Excel(name = "注册状态(0-否,1-是)")
private String registFlag;
@Excel(name = "注册时间")
private Date registTime;
@Excel(name = "街道名称")
private String streetName;
@Excel(name = "街道ID")
private String streetId;
@Excel(name = "社区名称")
private String communityName;
@Excel(name = "社区ID")
private String communityId;
@Excel(name = "网格名称")
private String gridName;
@Excel(name = "网格ID")
private String gridId;
@Excel(name = "部门ID")
private String deptId;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
@Excel(name = "删除标记")
private String delFlag;
}

52
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/PartyTagRelationExcel.java

@ -0,0 +1,52 @@
/**
* 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.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 党员标签关系表
*
* @author Mark sunlightcs@gmail.com
* @since v1.0.0 2019-09-04
*/
@Data
public class PartyTagRelationExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "党员ID")
private String partyId;
@Excel(name = "标签ID")
private String tagId;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
@Excel(name = "删除标记")
private String delFlag;
}

110
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/UserExcel.java

@ -0,0 +1,110 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 用户信息表
*
* @author qu qu@gmail.com
* @since v1.0.0 2019-09-02
*/
@Data
public class UserExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "昵称")
private String nickname;
@Excel(name = "手机号")
private String mobile;
@Excel(name = "密码")
private String password;
@Excel(name = "注册时间")
private Date registerTime;
@Excel(name = "头像")
private String faceImg;
@Excel(name = "性别(女性-female,男性-male)")
private String sex;
@Excel(name = "生日")
private Date birthday;
@Excel(name = "邮箱")
private String email;
@Excel(name = "电话")
private String telephone;
@Excel(name = "邮编")
private String zipCode;
@Excel(name = "职业")
private String profession;
@Excel(name = "爱好")
private String hobbies;
@Excel(name = "个性签名")
private String userSign;
@Excel(name = "邀请码")
private String invitationCode;
@Excel(name = "最近登录时间")
private Date lastLoginTime;
@Excel(name = "最近登录IP")
private String lastLoginIp;
@Excel(name = "最近登录位置经度")
private String lastLongitude;
@Excel(name = "最近登录位置维度")
private String lastLatitude;
@Excel(name = "真实姓名")
private String realName;
@Excel(name = "身份证号")
private String identityNo;
@Excel(name = "居民住址")
private String address;
@Excel(name = "微信OPENID")
private String wxOpenId;
@Excel(name = "是否是党员(0-否,1-是)")
private String partyFlag;
@Excel(name = "注册方式(wx:微信注册)")
private String registerWay;
@Excel(name = "用户来源(wp:公众号)")
private String registerSource;
@Excel(name = "手机号所属省份")
private String phoneProvince;
@Excel(name = "手机号所属城市")
private String phoneCity;
@Excel(name = "手机号所属运营商")
private String phoneCarrier;
@Excel(name = "用户积分")
private Integer points;
@Excel(name = "邀请人ID")
private String inviteUserId;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "网格ID")
private String gridId;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
@Excel(name = "删除标记")
private String delFlag;
}

52
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/UserTagExcel.java

@ -0,0 +1,52 @@
/**
* 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.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 用户标签表
*
* @author Mark sunlightcs@gmail.com
* @since v1.0.0 2019-09-02
*/
@Data
public class UserTagExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "标签名")
private String tagName;
@Excel(name = "标签描述")
private String tagDesc;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
@Excel(name = "删除标记")
private String delFlag;
}

43
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/jwt/JwtProperties.java

@ -0,0 +1,43 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有侵权必究
*/
package com.elink.esua.epdc.jwt;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
/**
* Jwt
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
@Configuration
@ConfigurationProperties(prefix = "jwt")
public class JwtProperties {
private String secret;
private int expire;
public String getSecret() {
return secret;
}
public void setSecret(String secret) {
this.secret = secret;
}
public int getExpire() {
return expire;
}
public void setExpire(int expire) {
this.expire = expire;
}
}

80
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/jwt/JwtUtils.java

@ -0,0 +1,80 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
* <p>
* https://www.renren.io
* <p>
* 版权所有侵权必究
*/
package com.elink.esua.epdc.jwt;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
/**
* Jwt工具类
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
@Component
public class JwtUtils {
private static final Logger logger = LoggerFactory.getLogger(JwtUtils.class);
@Autowired
private JwtProperties jwtProperties;
/**
* 生成jwt token
*/
public String generateToken(Long userId) {
return Jwts.builder()
.setHeaderParam("typ", "JWT")
.setSubject(userId + "")
.setIssuedAt(new Date())
.setExpiration(DateTime.now().plusSeconds(jwtProperties.getExpire()).toDate())
.signWith(SignatureAlgorithm.HS512, jwtProperties.getSecret())
.compact();
}
/**
* 生成jwt token
*/
public String generateToken(String userId) {
return Jwts.builder()
.setHeaderParam("typ", "JWT")
.setSubject(userId)
.setIssuedAt(new Date())
.setExpiration(DateTime.now().plusSeconds(jwtProperties.getExpire()).toDate())
.signWith(SignatureAlgorithm.HS512, jwtProperties.getSecret())
.compact();
}
public Claims getClaimByToken(String token) {
try {
return Jwts.parser()
.setSigningKey(jwtProperties.getSecret())
.parseClaimsJws(token)
.getBody();
} catch (Exception e) {
logger.debug("validate is token error, token = " + token, e);
return null;
}
}
/**
* token是否过期
* @return true过期
*/
public boolean isTokenExpired(Date expiration) {
return expiration.before(new Date());
}
}

47
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/redis/PartyMembersRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 党员表
*
* @author Mark sunlightcs@gmail.com
* @since v1.0.0 2019-09-02
*/
@Component
public class PartyMembersRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

47
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/redis/PartyTagRelationRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 党员标签关系表
*
* @author Mark sunlightcs@gmail.com
* @since v1.0.0 2019-09-04
*/
@Component
public class PartyTagRelationRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

46
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/redis/UserRedis.java

@ -0,0 +1,46 @@
/**
* 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.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 用户信息表
*
* @author qu qu@gmail.com
* @since v1.0.0 2019-09-02
*/
@Component
public class UserRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

47
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/redis/UserTagRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 用户标签表
*
* @author Mark sunlightcs@gmail.com
* @since v1.0.0 2019-09-02
*/
@Component
public class UserTagRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

50
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PartyMembersService.java

@ -0,0 +1,50 @@
/**
* 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.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.PartyMembersDTO;
import com.elink.esua.epdc.entity.PartyMembersEntity;
import java.util.List;
import java.util.Map;
/**
* 党员表
*
* @author Mark sunlightcs@gmail.com
* @since v1.0.0 2019-09-02
*/
public interface PartyMembersService extends BaseService<PartyMembersEntity> {
PageData<PartyMembersDTO> page(Map<String, Object> params);
Result<PageData<PartyMembersDTO>> pageDIY(Map<String, Object> params);
List<PartyMembersDTO> list(Map<String, Object> params);
PartyMembersDTO get(String id);
void save(PartyMembersDTO dto);
void update(PartyMembersDTO dto);
void delete(String[] ids);
}

47
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PartyTagRelationService.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.dto.PartyTagRelationDTO;
import com.elink.esua.epdc.entity.PartyTagRelationEntity;
import java.util.List;
import java.util.Map;
/**
* 党员标签关系表
*
* @author Mark sunlightcs@gmail.com
* @since v1.0.0 2019-09-04
*/
public interface PartyTagRelationService extends BaseService<PartyTagRelationEntity> {
PageData<PartyTagRelationDTO> page(Map<String, Object> params);
List<PartyTagRelationDTO> list(Map<String, Object> params);
PartyTagRelationDTO get(String id);
void save(PartyTagRelationDTO dto);
void update(PartyTagRelationDTO dto);
void delete(String[] ids);
}

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

Loading…
Cancel
Save