Browse Source

Merge branches 'dev' and 'dev_screen_data' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_screen_data

dev
jianjun 5 years ago
parent
commit
1bdcad0d53
  1. 2
      epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml
  2. 4
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  3. 8
      epmet-gateway/pom.xml
  4. 2
      epmet-gateway/src/main/resources/bootstrap.yml
  5. 2
      epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml
  6. 2
      epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml
  7. 2
      epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml
  8. 2
      epmet-module/epmet-demo/epmet-demo-server/src/main/resources/bootstrap.yml
  9. 2
      epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml
  10. 2
      epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml
  11. 2
      epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml
  12. 6
      epmet-module/epmet-point/epmet-point-client/pom.xml
  13. 3
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/CommonPageUserFormDTO.java
  14. 2
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointVerificationFormDTO.java
  15. 11
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java
  16. 6
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java
  17. 4
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java
  18. 1
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java
  19. 13
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java
  20. 2
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.java
  21. 3
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java
  22. 9
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointTotalDao.java
  23. 3
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdjustmentLogService.java
  24. 14
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointTotalService.java
  25. 10
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdjustmentLogServiceImpl.java
  26. 13
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java
  27. 2
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java
  28. 4
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java
  29. 30
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java
  30. 24
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointVerificationLogDao.xml
  31. 2
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml
  32. 15
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml
  33. 10
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniInfoDao.java
  34. 8
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java
  35. 4
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxExtJson.java
  36. 2
      epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml
  37. 6
      epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniInfoDao.xml
  38. 2
      epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml
  39. 2
      epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml
  40. 11
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueVoteStatisticalService.java
  41. 10
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java
  42. 56
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java
  43. 2
      epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml
  44. 2
      epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml
  45. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  46. 2
      epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml
  47. 2
      epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml
  48. 2
      epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml
  49. 2
      epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml
  50. 2
      epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml
  51. 7
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFootBarDTO.java
  52. 96
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFunctionRoleDTO.java
  53. 85
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFootBarFormDTO.java
  54. 29
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFunctionRoleListFormDTO.java
  55. 18
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionDetailFromDTO.java
  56. 27
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/RoleListFormDTO.java
  57. 37
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SaveCustomerFunctionRoleFormDTO.java
  58. 14
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFootBarResultDTO.java
  59. 26
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFunctionRoleListResultDTO.java
  60. 6
      epmet-module/oper-customize/oper-customize-server/pom.xml
  61. 117
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java
  62. 3
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java
  63. 123
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionRoleController.java
  64. 51
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFootBarDao.java
  65. 62
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionRoleDao.java
  66. 15
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFootBarEntity.java
  67. 66
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFunctionRoleEntity.java
  68. 71
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/CustomerFunctionRoleExcel.java
  69. 47
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFunctionRoleRedis.java
  70. 20
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFootBarService.java
  71. 2
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java
  72. 114
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionRoleService.java
  73. 156
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java
  74. 72
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java
  75. 154
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionRoleServiceImpl.java
  76. 2
      epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml
  77. 2
      epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.6__footbar_add_column.sql
  78. 15
      epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.7__customer_function_role.sql
  79. 175
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFootBarDao.xml
  80. 39
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionRoleDao.xml
  81. 2
      epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml
  82. 2
      epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml
  83. 2
      epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml
  84. 2
      epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml
  85. 2
      epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml
  86. 6
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java
  87. 2
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml
  88. 2
      epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml
  89. 2
      epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml
  90. 7
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonUserFormDTO.java
  91. 28
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GetRoleKeyListFormDTO.java
  92. 46
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ResiGovRoleListResultDTO.java
  93. 44
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ResiGovRoleResultDTO.java
  94. 7
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  95. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  96. 17
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java
  97. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/RoleController.java
  98. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleTemplateDao.java
  99. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RoleDao.java
  100. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java

2
epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml

@ -10,7 +10,7 @@ spring:
name: epmet-admin-server
#环境 dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages_common

4
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -107,7 +107,9 @@ public enum EpmetErrorCode {
OPER_EXTERNAL_APP_AUTH_ERROR(8709, "外部应用认证失败"),
OPER_EXTERNAL_CUSTOMER_NOT_EXISTS(8710, "该客户不存在"),
OPER_EXTERNAL_APP_EXISTS(8711, "应用已存在"),
OPER_EXT_APP_SECRET_RESET_FAIL(8713, "秘钥更新失败"),
OPER_CUSTOMER_FOOTBAR_EXISTS(8712, "footbar已存在"),
OPER_CUSTOMER_FOOTBAR_NOT_FOUND(8713, "footbar不存在"),
OPER_EXT_APP_SECRET_RESET_FAIL(8713, "秘钥更新失败"),
// 党建声音 前端提示 88段
DRAFT_CONTENT_IS_NULL(8801, "至少需要添加一个段落"),

8
epmet-gateway/pom.xml

@ -90,6 +90,8 @@
<properties>
<server.port>8080</server.port>
<spring.profiles.active>dev</spring.profiles.active>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>192.168.1.130</spring.redis.host>
@ -206,6 +208,8 @@
<properties>
<server.port>8080</server.port>
<spring.profiles.active>local</spring.profiles.active>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>192.168.1.130</spring.redis.host>
@ -322,6 +326,8 @@
<properties>
<server.port>8080</server.port>
<spring.profiles.active>test</spring.profiles.active>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com</spring.redis.host>
@ -409,6 +415,8 @@
<properties>
<server.port>8080</server.port>
<spring.profiles.active>prod</spring.profiles.active>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com</spring.redis.host>

2
epmet-gateway/src/main/resources/bootstrap.yml

@ -11,7 +11,7 @@ spring:
name: epmet-gateway-server
#环境 dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages_common

2
epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml

@ -10,7 +10,7 @@ spring:
name: data-report-server
#环境 dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss

2
epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml

@ -8,7 +8,7 @@ spring:
name: epmet-activiti-server
#环境 dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages,i18n/messages_common

2
epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml

@ -10,7 +10,7 @@ spring:
name: common-service-server
#环境 dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages,i18n/messages_common

2
epmet-module/epmet-demo/epmet-demo-server/src/main/resources/bootstrap.yml

@ -10,7 +10,7 @@ spring:
allow-bean-definition-overriding: true
#环境 dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages,i18n/messages_common

2
epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml

@ -10,7 +10,7 @@ spring:
name: epmet-ext-server
# dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss

2
epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml

@ -10,7 +10,7 @@ spring:
name: epmet-message-server
#环境 dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages,i18n/messages_common

2
epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml

@ -10,7 +10,7 @@ spring:
name: epmet-oss-server
#环境 dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages,i18n/messages_common

6
epmet-module/epmet-point/epmet-point-client/pom.xml

@ -27,6 +27,12 @@
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-user-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

3
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/CommonPageUserFormDTO.java

@ -26,4 +26,7 @@ public class CommonPageUserFormDTO implements Serializable {
private Integer pageNo = 1;
private Integer pageSize = 10;
@NotBlank(message = "获取不到用户Id" , groups = PageUserGroup.class)
private String customerId;
}

2
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointVerificationFormDTO.java

@ -52,4 +52,6 @@ public class PointVerificationFormDTO implements Serializable {
@NotBlank(message = "缺失地址信息" , groups = PointVerificationGroup.class)
private String address;
private String customerId;
}

11
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java

@ -1,13 +1,12 @@
package com.epmet.feign;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.result.ResiPointDetailResultDTO;
import com.epmet.feign.fallback.EpmetPointOpenFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
/**
* 本服务对外开放的API,其他服务通过引用此client调用该服务
@ -20,11 +19,11 @@ public interface EpmetPointOpenFeignClient {
/**
* @Description 获取指定居民的积分信息
* @param dto
* @param
* @return
* @author wangc
* @date 2020.07.22 15:58
**/
@GetMapping("/point/resi/point/mypoint")
Result<ResiPointDetailResultDTO> myPoint(TokenDto dto);
@PostMapping("/point/resi/point/mypoint")
Result<ResiPointDetailResultDTO> myPoint(CommonUserFormDTO param);
}

6
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java

@ -1,9 +1,9 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.result.ResiPointDetailResultDTO;
import com.epmet.feign.EpmetPointOpenFeignClient;
import org.springframework.stereotype.Component;
@ -17,7 +17,7 @@ import org.springframework.stereotype.Component;
@Component
public class EpmetPointOpenFeignClientFallback implements EpmetPointOpenFeignClient {
@Override
public Result<ResiPointDetailResultDTO> myPoint(TokenDto dto) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_POINT_SERVER, "myPoint", dto);
public Result<ResiPointDetailResultDTO> myPoint(CommonUserFormDTO param) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_POINT_SERVER, "myPoint",param);
}
}

4
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java

@ -7,6 +7,7 @@ import com.epmet.commons.tools.enums.RequirePermissionEnum;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.CustomerUserFormDTO;
import com.epmet.dto.form.IssueInitiatorFormDTO;
import com.epmet.dto.form.PointAdjustmentFormDTO;
@ -59,7 +60,8 @@ public class AdjustmentController {
**/
@PostMapping("userdetail")
@RequirePermission(requirePermission = RequirePermissionEnum.MORE_POINT_USER_MANAGE_DETAIL_VIEW)
public Result<CustomerUserDetailResultDTO> userDetail(@RequestBody IssueInitiatorFormDTO param){
public Result<CustomerUserDetailResultDTO> userDetail(@LoginUser TokenDto staffToken,@RequestBody CommonUserFormDTO param){
param.setCustomerId(staffToken.getCustomerId());
ValidatorUtils.validateEntity(param,IssueInitiatorFormDTO.UserIdGroup.class);
return new Result<CustomerUserDetailResultDTO>().ok(pointAdjustmentLogService.userDetail(param));
}

1
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java

@ -39,6 +39,7 @@ public class ExchangeController {
@PostMapping("execute")
public Result<PointVerificationResultDTO> execute(@LoginUser TokenDto token, @RequestBody PointVerificationFormDTO verificationParam){
verificationParam.setOperatorId(token.getUserId());
verificationParam.setCustomerId(token.getCustomerId());
ValidatorUtils.validateEntity(verificationParam, PointVerificationFormDTO.PointVerificationGroup.class);
return new Result<PointVerificationResultDTO>().ok(pointVerificationLogService.verifyPoint(verificationParam));
}

13
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java

@ -5,7 +5,7 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.CommonPageUserFormDTO;
import com.epmet.dto.form.ResiCommonUserIdFormDTO;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.ResiPointRankFormDTO;
import com.epmet.dto.result.PointExchangeResponseResultDTO;
import com.epmet.dto.result.ResiPointDetailResultDTO;
@ -46,12 +46,11 @@ public class ResiPointController {
* @author wangc
* @date 2020.07.22 15:58
**/
@GetMapping("mypoint")
public Result<ResiPointDetailResultDTO> myPoint(@LoginUser TokenDto dto){
ResiCommonUserIdFormDTO param = new ResiCommonUserIdFormDTO();
param.setUserId(dto.getUserId());
ValidatorUtils.validateEntity(param,ResiCommonUserIdFormDTO.UserIdGroup.class);
return new Result<ResiPointDetailResultDTO>().ok(userPointTotalService.getMyPoint(param));
@PostMapping("mypoint")
public Result<ResiPointDetailResultDTO> myPoint(@LoginUser TokenDto dto, @RequestBody CommonUserFormDTO userParam){
userParam.setUserId(dto.getUserId());
ValidatorUtils.validateEntity(userParam, CommonUserFormDTO.CustomerId_UserIdGroup.class);
return new Result<ResiPointDetailResultDTO>().ok(userPointTotalService.getMyPoint(userParam));
}
/**

2
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.java

@ -43,7 +43,7 @@ public interface PointVerificationLogDao extends BaseDao<PointVerificationLogEnt
* @author wangc
* @date 2020.07.22 15:38
**/
List<ResiPointLogPeriodResultDTO> selectVerificationLog(@Param("userId") String userId);
List<ResiPointLogPeriodResultDTO> selectVerificationLog(@Param("userId") String userId,@Param("customerId")String customerId);
/**
* @Description 获取工作人员月度核销记录

3
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java

@ -42,7 +42,8 @@ public interface UserPointActionLogDao extends BaseDao<UserPointActionLogEntity>
* @author wangc
* @date 2020.07.22 13:56
**/
List<ResiPointLogPeriodResultDTO> selectPointActionLogList(@Param("userId") String userId);
List<ResiPointLogPeriodResultDTO> selectPointActionLogList(@Param("userId") String userId,@Param("customerId")String customerId);
/**
* @Description 查询指定用户在某条规则下所得的积分总和

9
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointTotalDao.java

@ -44,6 +44,15 @@ public interface UserPointTotalDao extends BaseDao<UserPointTotalEntity> {
**/
ResiPointDetailResultDTO selectPointByUserId(@Param("userId")String userId);
/**
* @Description 根据用户Id和客户Id查询他的累计积分以及可用积分
* @param userId
* @return
* @author wangc
* @date 2020.07.21 13:38
**/
ResiPointDetailResultDTO selectPointByCustomerUserId(@Param("userId")String userId,@Param("customerId")String customerId);
/**
* @Description 查询客户下的用户累计积分排名榜
* @param customerId

3
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdjustmentLogService.java

@ -20,6 +20,7 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.PointAdjustmentLogDTO;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.IssueInitiatorFormDTO;
import com.epmet.dto.form.PointAdjustmentFormDTO;
import com.epmet.dto.result.CustomerUserDetailResultDTO;
@ -113,7 +114,7 @@ public interface PointAdjustmentLogService extends BaseService<PointAdjustmentLo
* @author wangc
* @date 2020.07.27 10:57
**/
CustomerUserDetailResultDTO userDetail(IssueInitiatorFormDTO param);
CustomerUserDetailResultDTO userDetail(CommonUserFormDTO param);
/**
* @Description 积分调整

14
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointTotalService.java

@ -20,6 +20,7 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.UserPointTotalDTO;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.ResiCommonUserIdFormDTO;
import com.epmet.dto.form.ResiPointRankFormDTO;
import com.epmet.dto.result.ResiPointDetailResultDTO;
@ -99,12 +100,12 @@ public interface UserPointTotalService extends BaseService<UserPointTotalEntity>
/**
* @Description 获取指定居民的积分信息
* @param userId
* @param param
* @return
* @author wangc
* @date 2020.07.22 15:58
**/
ResiPointDetailResultDTO getMyPoint(ResiCommonUserIdFormDTO userId);
ResiPointDetailResultDTO getMyPoint(CommonUserFormDTO param);
/**
* @Description 获取客户下用户积分排名榜
@ -125,4 +126,13 @@ public interface UserPointTotalService extends BaseService<UserPointTotalEntity>
void insertOrUpdate(UserPointTotalEntity entity);
void testInsertOrUpdate(UserPointTotalEntity entity);
/**
* @Description 获取指定居民的积分信息 - 使用客户Id匹配兼容多客户情况
* @param customerUserParam
* @return
* @author wangc
* @date 2020.07.22 15:58
**/
ResiPointDetailResultDTO getMyPointGroupByCustomer(CommonUserFormDTO customerUserParam);
}

10
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdjustmentLogServiceImpl.java

@ -30,6 +30,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.PointAdjustmentLogDao;
import com.epmet.dao.UserPointActionLogDao;
import com.epmet.dto.PointAdjustmentLogDTO;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.IssueInitiatorFormDTO;
import com.epmet.dto.form.PointAdjustmentFormDTO;
import com.epmet.dto.form.ResiCommonUserIdFormDTO;
@ -150,13 +151,14 @@ public class PointAdjustmentLogServiceImpl extends BaseServiceImpl<PointAdjustme
* @date 2020.07.27 10:57
**/
@Override
public CustomerUserDetailResultDTO userDetail(IssueInitiatorFormDTO param) {
Result<CustomerUserDetailResultDTO> detailResult = epmetUserOpenFeignClient.customerUserDetail(param);
public CustomerUserDetailResultDTO userDetail(CommonUserFormDTO param) {
IssueInitiatorFormDTO userParam = new IssueInitiatorFormDTO();
userParam.setUserId(param.getUserId());
Result<CustomerUserDetailResultDTO> detailResult = epmetUserOpenFeignClient.customerUserDetail(userParam);
if(!detailResult.success()){
throw new RenException(detailResult.getCode());
}
ResiCommonUserIdFormDTO userParam = ConvertUtils.sourceToTarget(param,ResiCommonUserIdFormDTO.class);
ResiPointDetailResultDTO pointDto = userPointTotalService.getMyPoint(userParam);
ResiPointDetailResultDTO pointDto = userPointTotalService.getMyPointGroupByCustomer(param);
if(null != detailResult.getData()){
CustomerUserDetailResultDTO result = new CustomerUserDetailResultDTO();
result.setPoint(null != pointDto ? pointDto.getUsablePoint() : NumConstant.ZERO);

13
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java

@ -147,7 +147,7 @@ public class PointVerificationLogServiceImpl extends BaseServiceImpl<PointVerifi
@Override
public List<ResiPointLogListResultDTO> getMyExchangeRecord(CommonPageUserFormDTO pageUser) {
PageHelper.startPage(pageUser.getPageNo(),pageUser.getPageSize());
List<ResiPointLogPeriodResultDTO> logList = baseDao.selectVerificationLog(pageUser.getUserId());
List<ResiPointLogPeriodResultDTO> logList = baseDao.selectVerificationLog(pageUser.getUserId(),pageUser.getCustomerId());
List<ResiPointLogListResultDTO> result = new LinkedList<>();
if(null != logList && !logList.isEmpty()){
Map<String,List<ResiPointLogPeriodResultDTO>> map =
@ -256,9 +256,10 @@ public class PointVerificationLogServiceImpl extends BaseServiceImpl<PointVerifi
DimIdGenerator.DimIdBean dim = DimIdGenerator.getDimIdBean(new Date());
ResiCommonUserIdFormDTO userId = new ResiCommonUserIdFormDTO();
userId.setUserId(verificationParam.getUserId());
ResiPointDetailResultDTO currentPoint = userPointTotalService.getMyPoint(userId);
CommonUserFormDTO customerUserParam = new CommonUserFormDTO();
customerUserParam.setUserId(verificationParam.getUserId());
customerUserParam.setCustomerId(verificationParam.getCustomerId());
ResiPointDetailResultDTO currentPoint = userPointTotalService.getMyPointGroupByCustomer(customerUserParam);
if(null == currentPoint || null == currentPoint.getUsablePoint() || currentPoint.getUsablePoint() < verificationParam.getPoint()){
result.setSuccessFlag(false);
result.setFailureReason(ModuleConstant.POINT_NOT_ENOUGH);
@ -280,14 +281,14 @@ public class PointVerificationLogServiceImpl extends BaseServiceImpl<PointVerifi
point *= NumConstant.ONE_NEG;
}
String customerId = ModuleConstant.EMPTY_STR;
String customerId = verificationParam.getCustomerId();
String agencyId = ModuleConstant.EMPTY_STR;
String operatorName = ModuleConstant.EMPTY_STR;
PointVerificationStatisticalDailyEntity statistical = new PointVerificationStatisticalDailyEntity();
if(staffResult.success() && null != staffResult.getData()){
statistical = ConvertUtils.sourceToTarget(staffResult.getData(),PointVerificationStatisticalDailyEntity.class);
customerId = staffResult.getData().getCustomerId();
customerId = StringUtils.isBlank(customerId) ? staffResult.getData().getCustomerId() : customerId;
operatorName = staffResult.getData().getNickname();
agencyId = staffResult.getData().getAgencyId();
}

2
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java

@ -139,7 +139,7 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl<UserPointActi
@Override
public List<ResiPointLogListResultDTO> getMyPointRecord(CommonPageUserFormDTO pageUser) {
PageHelper.startPage(pageUser.getPageNo(),pageUser.getPageSize());
List<ResiPointLogPeriodResultDTO> logList = baseDao.selectPointActionLogList(pageUser.getUserId());
List<ResiPointLogPeriodResultDTO> logList = baseDao.selectPointActionLogList(pageUser.getUserId(),pageUser.getCustomerId());
List<ResiPointLogListResultDTO> result = new LinkedList<>();
if(null != logList && !logList.isEmpty()){
Map<String,List<ResiPointLogPeriodResultDTO>> map =

4
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java

@ -38,6 +38,7 @@ import com.epmet.service.UserPointStatisticalDailyService;
import com.epmet.utils.DimIdGenerator;
import com.epmet.utils.ModuleConstant;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -53,6 +54,7 @@ import java.util.stream.Collectors;
* @since v1.0.0 2020-07-20
*/
@Service
@Slf4j
public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl<UserPointStatisticalDailyDao, UserPointStatisticalDailyEntity> implements UserPointStatisticalDailyService {
@Autowired
@ -131,6 +133,8 @@ public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl<UserPo
epmetUserOpenFeignClient.queryUserBaseInfo(userIdParam);
if(myResiInfoResult.success() && null != myResiInfoResult.getData() && !myResiInfoResult.getData().isEmpty()){
if(StringUtils.isBlank(pointRankFormDTO.getCustomerId())) {
//缓存中的customerId是不准确的,前端一定会传customerId,所以不会执行此代码
log.warn("com.epmet.service.impl.UserPointTotalServiceImpl.getPointRanking,传参缺失客户Id,参数:{}",pointRankFormDTO);
//缓存中陌生人游客也有对应的customerId
pointRankFormDTO.setCustomerId(myResiInfoResult.getData().get(NumConstant.ZERO).getCustomerId());
}

30
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java

@ -27,6 +27,7 @@ import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.UserPointTotalDao;
import com.epmet.dto.UserPointTotalDTO;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.ResiCommonUserIdFormDTO;
import com.epmet.dto.form.ResiPointRankFormDTO;
import com.epmet.dto.result.*;
@ -36,6 +37,7 @@ import com.epmet.service.UserPointTotalService;
import com.epmet.utils.DimIdGenerator;
import com.epmet.utils.ModuleConstant;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
@ -52,8 +54,10 @@ import java.util.stream.Collectors;
* @since v1.0.0 2020-07-20
*/
@Service
@Slf4j
public class UserPointTotalServiceImpl extends BaseServiceImpl<UserPointTotalDao, UserPointTotalEntity> implements UserPointTotalService {
@Autowired
EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@ -111,14 +115,14 @@ public class UserPointTotalServiceImpl extends BaseServiceImpl<UserPointTotalDao
/**
* @Description 获取指定居民的积分信息
* @param userId
* @param param
* @return
* @author wangc
* @date 2020.07.22 15:58
**/
@Override
public ResiPointDetailResultDTO getMyPoint(ResiCommonUserIdFormDTO userId) {
ResiPointDetailResultDTO result = baseDao.selectPointByUserId(userId.getUserId());
public ResiPointDetailResultDTO getMyPoint(CommonUserFormDTO param) {
ResiPointDetailResultDTO result = baseDao.selectPointByCustomerUserId(param.getUserId(),param.getCustomerId());
if(null == result) return new ResiPointDetailResultDTO();
if(null == result.getUsablePoint() || null == result.getAccumulatedPoint()) return new ResiPointDetailResultDTO();
return result;
@ -145,6 +149,8 @@ public class UserPointTotalServiceImpl extends BaseServiceImpl<UserPointTotalDao
epmetUserOpenFeignClient.queryUserBaseInfo(userIdParam);
if(myResiInfoResult.success() && null != myResiInfoResult.getData() && !myResiInfoResult.getData().isEmpty()){
if(StringUtils.isBlank(pointRankFormDTO.getCustomerId())) {
//缓存中的customerId是不准确的,前端一定会传customerId,所以不会执行此代码
log.warn("com.epmet.service.impl.UserPointTotalServiceImpl.getPointRanking,传参缺失客户Id,参数:{}",pointRankFormDTO);
pointRankFormDTO.setCustomerId(myResiInfoResult.getData().get(NumConstant.ZERO).getCustomerId());
}
//微信昵称
@ -169,7 +175,7 @@ public class UserPointTotalServiceImpl extends BaseServiceImpl<UserPointTotalDao
return result;
}
}
//如果当前请求是第一页
//如果当前请求是第一页
if(NumConstant.ONE == pointRankFormDTO.getPageNo()) {
ResiPointRankResultDTO myself = null;
Optional<ResiPointRankResultDTO> opt = rankList.stream().filter(obj -> StringUtils.equals(obj.getUserId(), pointRankFormDTO.getUserId())).findFirst();
@ -244,4 +250,20 @@ public class UserPointTotalServiceImpl extends BaseServiceImpl<UserPointTotalDao
baseDao.insertOrUpdate(entity);
}
/**
* @Description 获取指定居民的积分信息 - 使用客户Id匹配兼容多客户情况
* @param customerUserParam
* @return
* @author wangc
* @date 2020.07.22 15:58
**/
@Override
public ResiPointDetailResultDTO getMyPointGroupByCustomer(CommonUserFormDTO customerUserParam) {
ResiPointDetailResultDTO result = baseDao.selectPointByUserId(customerUserParam.getUserId());
if(null == result) return new ResiPointDetailResultDTO();
if(null == result.getUsablePoint() || null == result.getAccumulatedPoint()) return new ResiPointDetailResultDTO();
return result;
}
}

24
epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointVerificationLogDao.xml

@ -25,20 +25,24 @@
<!-- 查询指定用户兑换记录 传参:用户Id -->
<select id="selectVerificationLog" resultType="com.epmet.dto.result.ResiPointLogPeriodResultDTO">
SELECT
USER_ID,
SELECT
verify.USER_ID,
'积分兑换' AS TITLE,
concat( '兑换', EXCHANGED_ITEM ) AS REMARK,
concat( '-', POINT ) AS point,
DATE_FORMAT( CREATED_TIME, '%Y-%m-%d' ) AS DATE,
DATE_FORMAT( CREATED_TIME, '%H:%i' ) AS TIME
concat( '兑换', verify.EXCHANGED_ITEM ) AS REMARK,
concat( '-', verify.POINT ) AS point,
DATE_FORMAT( verify.CREATED_TIME, '%Y-%m-%d' ) AS DATE,
DATE_FORMAT( verify.CREATED_TIME, '%H:%i' ) AS TIME
FROM
POINT_VERIFICATION_LOG
POINT_VERIFICATION_LOG verify
LEFT JOIN
USER_POINT_ACTION_LOG action
ON verify.ACTION_ID = action.ID AND action.DEL_FLAG = '0'
WHERE
DEL_FLAG = '0'
AND USER_ID = #{userId}
verify.DEL_FLAG = '0'
AND verify.USER_ID = #{userId}
AND action.CUSTOMER_ID = #{customerId}
ORDER BY
CREATED_TIME DESC
verify.CREATED_TIME DESC
</select>
<!-- 获取工作人员月度核销记录 -->

2
epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml

@ -36,6 +36,8 @@
DEL_FLAG = '0'
AND
USER_ID = #{userId}
AND
CUSTOMER_ID = #{customerId}
ORDER BY
CREATED_TIME DESC
</select>

15
epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml

@ -31,6 +31,21 @@
USER_ID = #{userId}
</select>
<!-- 根据用户Id和客户Id查询他的累计积分以及可用积分 -->
<select id="selectPointByCustomerUserId" resultType="com.epmet.dto.result.ResiPointDetailResultDTO">
SELECT
USABLE_POINT AS usablePoint,
TOTAL_POINT AS accumulatedPoint
FROM
USER_POINT_TOTAL
WHERE
DEL_FLAG = '0'
AND
CUSTOMER_ID = #{customerId}
AND
USER_ID = #{userId}
</select>
<!-- 查询客户下的用户积分排行,分页 传参:customerId -->
<select id="selectUserPointRank" resultType="com.epmet.dto.result.ResiPointRankResultDTO">
SELECT

10
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniInfoDao.java

@ -53,5 +53,15 @@ public interface MiniInfoDao extends BaseDao<MiniInfoEntity> {
* @author zxc
*/
CustomerIdAndClientResultDTO selectCustomerIdAndClientByToUserName(@Param("toUserName")String toUserName);
/**
* 获取小程序名
* @author zhaoqifeng
* @date 2020/9/7 17:25
* @param customerId
* @param clientType
* @return java.lang.String
*/
String getNickName(@Param("customerId") String customerId, @Param("clientType") String clientType);
}

8
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java

@ -11,6 +11,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.CodeConstant;
import com.epmet.dao.AuthorizationInfoDao;
import com.epmet.dao.ComponentAccessTokenDao;
import com.epmet.dao.MiniInfoDao;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
@ -65,6 +66,8 @@ public class CodeServiceImpl implements CodeService {
private OssFeignClient ossFeignClient;
@Autowired
private PaCustomerService paCustomerService;
@Autowired
private MiniInfoDao miniInfoDao;
@Override
public List<TemplateListResultDTO> templateList() {
@ -115,10 +118,15 @@ public class CodeServiceImpl implements CodeService {
if (null == authInfo) {
throw new RenException("未授权");
}
//获取小程序居民端与工作端名称
String resiName = miniInfoDao.getNickName(formDTO.getCustomerId(), "resi");
String workName = miniInfoDao.getNickName(formDTO.getCustomerId(), "work");
String extJson = getExtJson(formDTO);
WxExtJson wxExtJson = JSONObject.parseObject(extJson, WxExtJson.class);
wxExtJson.setExtAppid(authInfo.getAuthorizerAppid());
wxExtJson.getExt().setExtAppid(authInfo.getAuthorizerAppid());
wxExtJson.getExt().setResiName(resiName);
wxExtJson.getExt().setWorkName(workName);
extJson = JSON.toJSONString(wxExtJson);
CodeExtDTO codeExtDTO = codeExtService.getExtByCustomer(formDTO.getCustomerId(), formDTO.getClientType());
if (null == codeExtDTO) {

4
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxExtJson.java

@ -31,6 +31,10 @@ public class WxExtJson implements Serializable {
@JSONField(ordinal = 1)
private String extAppid;
@JSONField(ordinal = 2)
private String resiName;
@JSONField(ordinal = 3)
private String workName;
@JSONField(ordinal = 4)
private FootbarBean footbar;
@NoArgsConstructor
@Data

2
epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml

@ -10,7 +10,7 @@ spring:
name: epmet-third-server
# dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss

6
epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniInfoDao.xml

@ -64,4 +64,10 @@
AND user_name = #{toUserName}
LIMIT 1
</select>
<select id="getNickName" resultType="java.lang.String">
select NICK_NAME from mini_info
where DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId}
AND CLIENT_TYPE = #{clientType}
</select>
</mapper>

2
epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml

@ -10,7 +10,7 @@ spring:
name: gov-access-server
#环境 dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss

2
epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml

@ -10,7 +10,7 @@ spring:
name: gov-grid-server
#环境 dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages_common

11
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueVoteStatisticalService.java

@ -148,4 +148,15 @@ public interface IssueVoteStatisticalService extends BaseService<IssueVoteStatis
* @date 2020.05.21 16:33
**/
IssueVoteStatisticalDTO getByIssueId(String issueId);
/**
* @Description 对指定的issueId的议题表决统计数缓存与Db同步
* @param issueId
* @param gridId
* @parma statisticalId
* @return
* @author wangc
* @date 2020.05.21 09:09
**/
void syncVotingCacheToDbByParams(String issueId,String gridId,String statisticalId);
}

10
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java

@ -437,6 +437,11 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
//5:缓存中网格下表决中的议题总数减1
govIssueRedis.subtractWorkGrassrootsIssueRedDotValue(entity.getGridId());
try {
issueVoteStatisticalService.syncVotingCacheToDbByParams(formDTO.getIssueId(),entity.getGridId(),null);
}catch (RenException e){
logger.error(e.getMsg());
}
}
/**
@ -581,6 +586,11 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
//6:缓存中网格下表决中的议题总数减1
govIssueRedis.subtractWorkGrassrootsIssueRedDotValue(entity.getGridId());
try{
issueVoteStatisticalService.syncVotingCacheToDbByParams(formDTO.getIssueId(),entity.getGridId(),null);
}catch(RenException e){
logger.error(e.getMsg());
}
}
/**

56
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java

@ -252,7 +252,7 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl<IssueVoteSt
//获取所有voting的议题
Set<IssueDTO> issues =
issueDao.selectIssueIdsByCondition(issueParam);
if(null == issues || issues.size()< NumConstant.ONE){
if(null == issues || issues.isEmpty()){
return;
}
Set<String> ids = issues.stream().map(IssueDTO::getId).collect(Collectors.toSet());
@ -285,9 +285,7 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl<IssueVoteSt
List<IssueVoteStatisticalDTO> listToUpdate = new ArrayList<>();
setVotableCountsAndUpdateCache(listToUpdate,
existedIds.stream().flatMap(existedId -> issues.stream().filter(issue ->
StringUtils.equals(issue.getId(),existedId)).map(issueDTO -> {
return issueDTO;
})).collect(Collectors.toSet()),
StringUtils.equals(issue.getId(),existedId))).collect(Collectors.toSet()),
votableCountMap);
// 批量更新listToUpdate
@ -417,8 +415,10 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl<IssueVoteSt
public void syncVotingCacheToDbByIssueId(String issueId) {
VoteRedisFormDTO vote = issueVoteDetailRedis.getVoteStatistical(issueId);
if(null == vote) throw new RenException(String.format(ModuleConstants.ISSUE_NOT_FOUND_EXCEPTION_TEMPLATE,issueId));
IssueVoteStatisticalDTO toUpd = ConvertUtils.sourceToTarget(vote,IssueVoteStatisticalDTO.class);
toUpd.setUpdatedBy("system");
IssueVoteStatisticalDTO toUpd = new IssueVoteStatisticalDTO();
toUpd.setOppositionCount(vote.getOppositionAmount());
toUpd.setSupportCount(vote.getSupportAmount());
toUpd.setVotableCount(vote.getShouldVoteCount());
IssueEntity issue = issueDao.selectById(issueId);
if(null != issue && StringUtils.isNotBlank(issue.getGridId())){
CommonGridIdFormDTO gridId = new CommonGridIdFormDTO();
@ -427,17 +427,15 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl<IssueVoteSt
resiGroupFeignClient.votableCount(gridId);
if(votableCount.success() && null != votableCount.getData()){
toUpd.setVotableCount(votableCount.getData());
}
}else {
toUpd.setVotableCount(NumConstant.ZERO);
}
IssueVoteStatisticalDTO existedStatistical = getByIssueId(issueId);
if(null != existedStatistical && StringUtils.isNotBlank(existedStatistical.getId())){
toUpd.setId(existedStatistical.getId());
update(toUpd);
}
update(toUpd);
}
/**
@ -452,6 +450,44 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl<IssueVoteSt
return baseDao.selectByIssueId(issueId);
}
/**
* @Description 对指定的issueId的议题表决统计数缓存与Db同步,对于前项操作已经查询过的数据不再重复查询
* @param issueId
* @param gridId
* @parma statisticalId
* @return
* @author wangc
* @date 2020.05.21 09:09
**/
@Override
public void syncVotingCacheToDbByParams(String issueId, String gridId, String statisticalId) {
VoteRedisFormDTO vote = issueVoteDetailRedis.getVoteStatistical(issueId);
if(null == vote) throw new RenException(String.format(ModuleConstants.ISSUE_NOT_FOUND_EXCEPTION_TEMPLATE,issueId));
IssueVoteStatisticalDTO toUpd = new IssueVoteStatisticalDTO();
toUpd.setOppositionCount(vote.getOppositionAmount());
toUpd.setSupportCount(vote.getSupportAmount());
toUpd.setVotableCount(vote.getShouldVoteCount());
CommonGridIdFormDTO gridParam = new CommonGridIdFormDTO();
gridParam.setGridId(gridId);
Result<Integer> votableCount =
resiGroupFeignClient.votableCount(gridParam);
if(votableCount.success() && null != votableCount.getData()){
toUpd.setVotableCount(votableCount.getData());
}
if(StringUtils.isNotBlank(statisticalId)){
toUpd.setId(statisticalId);
update(toUpd);
}else{
IssueVoteStatisticalDTO existedStatistical = getByIssueId(issueId);
if(null != existedStatistical && StringUtils.isNotBlank(existedStatistical.getId())){
toUpd.setId(existedStatistical.getId());
update(toUpd);
}
}
}
/**
* @Description 遍历应表决数
* @param list - List<IssueVoteStatisticalDTO> | Set<IssueDTO> | Map<String,Integer>

2
epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml

@ -10,7 +10,7 @@ spring:
name: gov-issue-server
#环境 dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss

2
epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml

@ -10,7 +10,7 @@ spring:
name: gov-mine-server
#环境 dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss

10
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

@ -215,18 +215,22 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
@Override
@Transactional(rollbackFor = Exception.class)
public Result<AddGridResultDTO> addGrid(TokenDto tokenDto, AddGridFormDTO addGridFormDTO) {
CustomerAgencyDTO customerAgencyDTO=customerAgencyService.get(addGridFormDTO.getAgencyId());
CustomerAgencyDTO customerAgencyDTO = customerAgencyService.get(addGridFormDTO.getAgencyId());
// 1. 查询该客户下可创建网格的最大数量
GridCountFormDTO gridCount = new GridCountFormDTO();
String customerId = customerAgencyDTO.getCustomerId();
gridCount.setCustomerId(customerId);
GridCountResultDTO grid = operCrmOpenFeignClient.getGridCount(gridCount).getData();
if (grid.getGridCount().equals(NumConstant.ZERO)){
log.info("客户信息为:" + grid);
if (null == grid) {
throw new RenException("未查出该客户信息");
}
if (null == grid.getGridCount() || grid.getGridCount().equals(NumConstant.ZERO)) {
throw new RenException(EpmetErrorCode.GRID_COUNT_UP.getCode());
}
// 2. 判断当前客户下存在的网格数量
Integer gridCounts = customerGridDao.selectGridCount(customerId);
if (gridCounts >= grid.getGridCount()){
if (gridCounts >= grid.getGridCount()) {
throw new RenException(EpmetErrorCode.GRID_COUNT_UP.getCode());
}
// 3. 查询网格名称是否重名

2
epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml

@ -10,7 +10,7 @@ spring:
name: gov-org-server
#环境 dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages_common

2
epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml

@ -10,7 +10,7 @@ spring:
name: gov-project-server
#环境 dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss

2
epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml

@ -10,7 +10,7 @@ spring:
name: gov-voice-server
#环境 dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss

2
epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml

@ -10,7 +10,7 @@ spring:
name: oper-access-server
#环境 dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages,i18n/messages_common

2
epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml

@ -10,7 +10,7 @@ spring:
name: oper-crm-server
#环境 dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages,i18n/messages_common

7
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFootBarDTO.java

@ -43,6 +43,11 @@ public class CustomerFootBarDTO implements Serializable {
*/
private String barName;
/**
* 默认的bar名称
*/
private String defaultBarName;
/**
* KEY
*/
@ -93,4 +98,6 @@ public class CustomerFootBarDTO implements Serializable {
*/
private Date updatedTime;
private Boolean display;
}

96
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFunctionRoleDTO.java

@ -0,0 +1,96 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 客户定制功能角色列表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-07
*/
@Data
public class CustomerFunctionRoleDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 客户Id
*/
private String customerId;
/**
* 功能ID(function.ID)
*/
private String functionId;
/**
* 所属APP(工作端:gov居民端:resi)
*/
private String fromApp;
/**
* 角色Key值
*/
private String roleKey;
/**
* 角色名称
*/
private String roleName;
/**
* 删除标识0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

85
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFootBarFormDTO.java

@ -1,17 +1,98 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
public class CustomerFootBarFormDTO {
//@NotBlank(message = "客户ID不能为空")
// 创建footbar的分组
public interface CreateFootBarGroup extends CustomerClientShowGroup {}
// 查询footbar列表分组
public interface ListFootBarGroup extends CustomerClientShowGroup {}
// 运营端查询footbar列表分组
public interface ListFootBarGroup4Oper extends CustomerClientShowGroup {}
// 更新footbar
public interface UpdateFootBarGroup extends CustomerClientShowGroup {}
// 保存顺序
public interface SaveOrderGroup extends CustomerClientShowGroup {}
// 明细分组
public interface FootBarDetailGroup extends CustomerClientShowGroup {}
// 更新显示状态分组
public interface UpdateDisplayStatusGroup extends CustomerClientShowGroup {}
// 为客户添加默认footbar
public interface AddDefaultFootbars4Customer extends CustomerClientShowGroup {}
// 删除footbar
public interface DeleteFootbarsGroup extends CustomerClientShowGroup {}
@NotBlank(message = "FootBar的ID不能为空", groups = { UpdateFootBarGroup.class, FootBarDetailGroup.class, UpdateDisplayStatusGroup.class, DeleteFootbarsGroup.class })
private String id;
@NotBlank(message = "客户ID不能为空", groups = { CreateFootBarGroup.class, AddDefaultFootbars4Customer.class, ListFootBarGroup4Oper.class })
private String customerId;
// 哪一个端:gov,resi
@NotBlank(message = "app类型不能为空")
@NotBlank(message = "app类型不能为空", groups = { ListFootBarGroup.class, CreateFootBarGroup.class, AddDefaultFootbars4Customer.class, ListFootBarGroup4Oper.class })
private String appType;
@NotBlank(message = "名称不能为空", groups = { CreateFootBarGroup.class, UpdateFootBarGroup.class })
private String barName;
@NotBlank(message = "key不能为空", groups = { CreateFootBarGroup.class })
private String barKey;
@NotBlank(message = "页面标题不能为空", groups = { CreateFootBarGroup.class, UpdateFootBarGroup.class })
private String pageTitle;
//@NotBlank(message = "图标路径不能为空", groups = { UpdateFootBarGroup.class })
private String iconPath;
//@NotBlank(message = "选中的图标路径不能为空", groups = { UpdateFootBarGroup.class })
private String selectedIconPath;
@NotEmpty(message = "顺序不能为空", groups = { SaveOrderGroup.class })
private List<OrderIndexDTO> orderList;
@NotNull(message = "显示状态不能为空", groups = { UpdateDisplayStatusGroup.class })
private Boolean display;
/**
* 排序索引号dto
*/
public static class OrderIndexDTO {
private String id;
private Integer orderIndex;
public OrderIndexDTO() {
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Integer getOrderIndex() {
return orderIndex;
}
public void setOrderIndex(Integer orderIndex) {
this.orderIndex = orderIndex;
}
}
}

29
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFunctionRoleListFormDTO.java

@ -0,0 +1,29 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* 查询客户定制功能角色列表--接口入参
*
* @author sun
*/
@Data
public class CustomerFunctionRoleListFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
@NotBlank(message = "客户Id不能为空", groups = {AddUserInternalGroup.class })
private String customerId;
/**
* 定制功能ID
*/
@NotBlank(message = "功能ID不能为空", groups = {AddUserInternalGroup.class })
private String functionId;
public interface AddUserInternalGroup {}
}

18
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionDetailFromDTO.java

@ -5,6 +5,7 @@ import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* 查询客户定制功能列表-接口入参
@ -25,11 +26,26 @@ public class FunctionDetailFromDTO implements Serializable {
*/
@NotBlank(message = "客户Id不能为空", groups = {AddUserShowGroup.class})
private String customerId;
/**
* 网格ID
*/
@NotBlank(message = "网格Id不能为空", groups = {AddUserShowGroup.class})
private String gridId;
/**
* resi居民端work工作端
* resi居民端gov工作端
*/
@NotBlank(message = "所属端不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class})
private String clientType;
/**
* token中userId
*/
private String userId;
/**
* 用户角色key集合
*/
private List<String> roleKeyList;
}

27
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/RoleListFormDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 客户定制功能角色设置--接口入参
*
* @author sun
*/
@Data
public class RoleListFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 角色Key
*/
@NotBlank(message = "角色key不能为空", groups = {AddUserInternalGroup.class })
private String roleKey;
/**
* 角色名称
*/
@NotBlank(message = "角色名称不能为空", groups = {AddUserInternalGroup.class })
private String roleName;
public interface AddUserInternalGroup {}
}

37
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SaveCustomerFunctionRoleFormDTO.java

@ -0,0 +1,37 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* 客户定制功能角色设置--接口入参
*
* @author sun
*/
@Data
public class SaveCustomerFunctionRoleFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
@NotBlank(message = "客户Id不能为空", groups = {AddUserInternalGroup.class })
private String customerId;
/**
* 定制功能ID
*/
@NotBlank(message = "功能ID不能为空", groups = {AddUserInternalGroup.class })
private String functionId;
/**
* 所属APP(工作端:gov居民端:resi)
*/
@NotBlank(message = "所属App不能为空", groups = {AddUserInternalGroup.class })
private String fromApp;
/**
* 角色信息集合
*/
private List<RoleListFormDTO> roleList;
public interface AddUserInternalGroup {}
}

14
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFootBarResultDTO.java

@ -39,6 +39,10 @@ public class CustomerFootBarResultDTO implements Serializable {
*/
private String id;
private String customerId;
private String appType;
/**
* bar名称
*/
@ -94,4 +98,14 @@ public class CustomerFootBarResultDTO implements Serializable {
*/
private Date updatedTime;
private Boolean display;
private String defaultBarName;
private String defaultIconPath;
private String defaultSelectedIconPath;
private String defaultPageTitle;
}

26
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFunctionRoleListResultDTO.java

@ -0,0 +1,26 @@
package com.epmet.dto.result;
import com.epmet.dto.form.RoleListFormDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 查询客户定制功能角色列表--接口返参
*
* @author sun
*/
@Data
public class CustomerFunctionRoleListResultDTO implements Serializable {
private static final long serialVersionUID = 2971689193155710437L;
/**
* 角色Key
*/
private String roleKey;
/**
* 角色名称
*/
private String roleName;
}

6
epmet-module/oper-customize/oper-customize-server/pom.xml

@ -64,6 +64,12 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-user-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

117
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java

@ -27,6 +27,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.CustomerFootBarDTO;
import com.epmet.dto.form.CustomerFootBarFormDTO;
import com.epmet.dto.result.CustomerFootBarResultDTO;
import com.epmet.entity.CustomerFootBarEntity;
import com.epmet.excel.CustomerFootBarExcel;
import com.epmet.service.CustomerFootBarService;
@ -35,7 +36,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotBlank;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@ -103,17 +103,130 @@ public class CustomerFootBarController {
*/
@PostMapping("customerfootbars")
public Result<List<CustomerFootBarDTO>> getCustomerfootbars(@RequestBody CustomerFootBarFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
ValidatorUtils.validateEntity(formDTO, CustomerFootBarFormDTO.ListFootBarGroup.class);
String customerId = formDTO.getCustomerId();
String appType = formDTO.getAppType();
List<CustomerFootBarEntity> footbars = customerFootBarService.listCustomerFootBars(customerId, appType);
List<CustomerFootBarDTO> barDTOS = new LinkedList<>();
footbars.forEach(barEntity -> {
CustomerFootBarEntity defaultFootBarEntity = customerFootBarService.getByAppTypeAndBarKeyOfCustomer("default", barEntity.getAppType(), barEntity.getBarKey());
CustomerFootBarDTO barDTO = new CustomerFootBarDTO();
BeanUtils.copyProperties(barEntity, barDTO);
barDTO.setDefaultBarName(defaultFootBarEntity.getBarName());
barDTOS.add(barDTO);
});
return new Result<List<CustomerFootBarDTO>>().ok(barDTOS);
}
/**
* 运营端查询footbar列表
* @param formDTO
* @return
*/
@PostMapping("customerfootbars4oper")
public Result<List<CustomerFootBarDTO>> getCustomerfootbars4Oper(@RequestBody CustomerFootBarFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, CustomerFootBarFormDTO.ListFootBarGroup4Oper.class);
String customerId = formDTO.getCustomerId();
String appType = formDTO.getAppType();
List<CustomerFootBarEntity> footbars = customerFootBarService.listAllCustomerFootBars(customerId, appType);
List<CustomerFootBarDTO> barDTOS = new LinkedList<>();
footbars.forEach(barEntity -> {
CustomerFootBarEntity defaultFootBarEntity = customerFootBarService.getByAppTypeAndBarKeyOfCustomer("default", barEntity.getAppType(), barEntity.getBarKey());
CustomerFootBarDTO barDTO = new CustomerFootBarDTO();
BeanUtils.copyProperties(barEntity, barDTO);
barDTO.setDefaultBarName(defaultFootBarEntity.getBarName());
barDTOS.add(barDTO);
});
return new Result<List<CustomerFootBarDTO>>().ok(barDTOS);
}
/**
* 创建footbar只能创建默认的不能直接为客户创建
* @param form
* @return
*/
@PostMapping("createfootbar")
public Result createFootBar(@RequestBody CustomerFootBarFormDTO form) {
ValidatorUtils.validateEntity(form, CustomerFootBarFormDTO.CreateFootBarGroup.class);
customerFootBarService.createFootBar(form);
return new Result();
}
/**
* 更新footbar
* @param form
* @return
*/
@PostMapping("updatefootbar")
public Result updateFootbar(@RequestBody CustomerFootBarFormDTO form) {
ValidatorUtils.validateEntity(form, CustomerFootBarFormDTO.UpdateFootBarGroup.class);
customerFootBarService.updateFootBar(form);
return new Result();
}
/**
*
* @param form
* @return
*/
@PostMapping("footbardetail")
public Result footbarDetail(@RequestBody CustomerFootBarFormDTO form) {
ValidatorUtils.validateEntity(form, CustomerFootBarFormDTO.FootBarDetailGroup.class);
CustomerFootBarResultDTO dto = customerFootBarService.getFootBarDetail(form.getId());
return new Result().ok(dto);
}
/**
* 保存排序
* @param form
* @return
*/
@PostMapping("saveorder")
public Result saveOrder(@RequestBody CustomerFootBarFormDTO form) {
ValidatorUtils.validateEntity(form, CustomerFootBarFormDTO.SaveOrderGroup.class);
customerFootBarService.saveOrder(form.getOrderList());
return new Result();
}
/**
* 更新显示状态
* @param form
* @return
*/
@PostMapping("updatedisplaystatus")
public Result updateDisplayStatus(@RequestBody CustomerFootBarFormDTO form) {
ValidatorUtils.validateEntity(form, CustomerFootBarFormDTO.UpdateDisplayStatusGroup.class);
customerFootBarService.updateDisplayStatus(form.getId(), form.getDisplay());
return new Result();
}
/**
* 为客户初始化默认的footbar
* @param form
* @return
*/
@PostMapping("initdefault4customer")
public Result initDefault4Customer(@RequestBody CustomerFootBarFormDTO form) {
ValidatorUtils.validateEntity(form, CustomerFootBarFormDTO.AddDefaultFootbars4Customer.class);
customerFootBarService.addDefault4Customer(form.getCustomerId(), form.getAppType());
return new Result();
}
/**
* 删除footbar
* @param form
* @return
*/
@PostMapping("deletefootbar")
public Result deleteFootBar(@RequestBody CustomerFootBarFormDTO form) {
ValidatorUtils.validateEntity(form, CustomerFootBarFormDTO.DeleteFootbarsGroup.class);
customerFootBarService.deleteFootBar(form.getId());
return new Result();
}
}

3
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java

@ -18,6 +18,7 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
@ -105,6 +106,7 @@ public class CustomerFunctionDetailController {
@PostMapping("resifunctiondetaillist")
public Result<List<FunctionDetailResultDTO>> resiFunctionDetail(@LoginUser TokenDto tokenDto, @RequestBody FunctionDetailFromDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, FunctionDetailFromDTO.AddUserShowGroup.class);
formDTO.setUserId(tokenDto.getUserId());
return new Result<List<FunctionDetailResultDTO>>().ok(customerFunctionDetailService.resiAndWorkFunctionDetail(formDTO));
}
@ -118,6 +120,7 @@ public class CustomerFunctionDetailController {
public Result<List<FunctionDetailResultDTO>> workFunctionDetail(@LoginUser TokenDto tokenDto, @RequestBody FunctionDetailFromDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, FunctionDetailFromDTO.AddUserInternalGroup.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
return new Result<List<FunctionDetailResultDTO>>().ok(customerFunctionDetailService.resiAndWorkFunctionDetail(formDTO));
}

123
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionRoleController.java

@ -0,0 +1,123 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.CustomerFunctionRoleDTO;
import com.epmet.dto.form.CustomerFunctionRoleListFormDTO;
import com.epmet.dto.form.SaveCustomerFunctionRoleFormDTO;
import com.epmet.dto.result.CustomerFunctionRoleListResultDTO;
import com.epmet.excel.CustomerFunctionRoleExcel;
import com.epmet.service.CustomerFunctionRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 客户定制功能角色列表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-07
*/
@RestController
@RequestMapping("customerfunctionrole")
public class CustomerFunctionRoleController {
@Autowired
private CustomerFunctionRoleService customerFunctionRoleService;
@GetMapping("page")
public Result<PageData<CustomerFunctionRoleDTO>> page(@RequestParam Map<String, Object> params){
PageData<CustomerFunctionRoleDTO> page = customerFunctionRoleService.page(params);
return new Result<PageData<CustomerFunctionRoleDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<CustomerFunctionRoleDTO> get(@PathVariable("id") String id){
CustomerFunctionRoleDTO data = customerFunctionRoleService.get(id);
return new Result<CustomerFunctionRoleDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody CustomerFunctionRoleDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
customerFunctionRoleService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody CustomerFunctionRoleDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
customerFunctionRoleService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
customerFunctionRoleService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<CustomerFunctionRoleDTO> list = customerFunctionRoleService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, CustomerFunctionRoleExcel.class);
}
/**
* @param tokenDTO formDTO
* @return
* @author sun
* @Description 客户定制功能角色设置
*/
@PostMapping("savecustomerfunctionrole")
public Result saveCustomerFunctionRole(@LoginUser TokenDto tokenDTO, @RequestBody SaveCustomerFunctionRoleFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, SaveCustomerFunctionRoleFormDTO.AddUserInternalGroup.class);
customerFunctionRoleService.saveCustomerFunctionRole(formDTO);
return new Result();
}
/**
* @param tokenDTO formDTO
* @return
* @author sun
* @Description 查询客户定制功能角色列表
*/
@PostMapping("customerfunctionrolelist")
public Result<List<CustomerFunctionRoleListResultDTO>> customerFunctionRoleList(@LoginUser TokenDto tokenDTO, @RequestBody CustomerFunctionRoleListFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, CustomerFunctionRoleListFormDTO.AddUserInternalGroup.class);
return new Result<List<CustomerFunctionRoleListResultDTO>>().ok(customerFunctionRoleService.customerFunctionRoleList(formDTO));
}
}

51
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFootBarDao.java

@ -33,6 +33,55 @@ import java.util.List;
@Mapper
public interface CustomerFootBarDao extends BaseDao<CustomerFootBarEntity> {
List<CustomerFootBarEntity> listCustomerFootBars(@Param("customerId") String customerId,
List<CustomerFootBarEntity> listDisplayCustomerFootBars(@Param("customerId") String customerId,
@Param("appType") String appType);
List<CustomerFootBarEntity> listAllCustomerFootBars(@Param("customerId") String customerId,
@Param("appType") String appType);
/**
* 唯一性count
* @param appType
* @param barKey
* @return
*/
int count4Unique(@Param("customerId") String customerId,
@Param("appType") String appType,
@Param("barKey") String barKey,
@Param("barName") String barName);
/**
* 获取下一个顺序号
* @param customerId
* @param appType
* @return
*/
Integer fetchNextOrder(@Param("customerId") String customerId, @Param("appType") String appType);
/**
* 更新顺序号
* @param id
* @param orderIndex
* @return
*/
Integer updateOrder(@Param("id") String id, @Param("orderIndex") Integer orderIndex);
CustomerFootBarEntity getByAppTypeAndBarKeyOfCustomer(@Param("customerId") String customerId,
@Param("appType") String appType,
@Param("barKey") String barKey);
CustomerFootBarEntity getByAppTypeAndBarNameOfCustomer(@Param("customerId") String customerId,
@Param("appType") String appType,
@Param("barName") String barName);
List<CustomerFootBarEntity> listByAppTypeAndCustomerId(@Param("customerId") String customerId,
@Param("appType") String appType);
void updateDisplayStatus(@Param("id") String id, @Param("display") Boolean display);
List<String> listFootBarOwnerCustomerIds();
void physicsDeleteById(@Param("id") String id);
void physicsDeleteByAppTypeAndBarKey(@Param("appType") String appType, @Param("barKey") String barKey);
}

62
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionRoleDao.java

@ -0,0 +1,62 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.CustomerFunctionRoleDTO;
import com.epmet.dto.form.CustomerFunctionRoleListFormDTO;
import com.epmet.dto.form.FunctionDetailFromDTO;
import com.epmet.dto.form.SaveCustomerFunctionRoleFormDTO;
import com.epmet.dto.result.CustomerFunctionRoleListResultDTO;
import com.epmet.entity.CustomerFunctionRoleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 客户定制功能角色列表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-07
*/
@Mapper
public interface CustomerFunctionRoleDao extends BaseDao<CustomerFunctionRoleEntity> {
/**
* @author sun
* @Description 根据客户Id删除客户功能角色信息
*/
void delByCustomerId(SaveCustomerFunctionRoleFormDTO formDTO);
/**
* @param formDTO
* @return
* @author sun
* @Description 查询客户定制功能角色列表
*/
List<CustomerFunctionRoleListResultDTO> selectCustomerFunctionRoleList(CustomerFunctionRoleListFormDTO formDTO);
/**
* @param formDTO
* @return
* @author sun
* @Description 根据用户拥有的角色查询客户的定制功能
*/
List<String> selectFunctionList(FunctionDetailFromDTO formDTO);
}

15
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFootBarEntity.java

@ -38,6 +38,11 @@ public class CustomerFootBarEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* bar名称
*/
@ -65,6 +70,14 @@ public class CustomerFootBarEntity extends BaseEpmetEntity {
*/
private String selectedIconPath;
private Integer order;
/**
* 顺序号
*/
private Integer orderIndex;
/**
* 是否显示
*/
private Boolean display;
}

66
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFunctionRoleEntity.java

@ -0,0 +1,66 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 客户定制功能角色列表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-07
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("customer_function_role")
public class CustomerFunctionRoleEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 功能ID(function.ID)
*/
private String functionId;
/**
* 所属APP(工作端:gov居民端:resi)
*/
private String fromApp;
/**
* 角色Key值
*/
private String roleKey;
/**
* 角色名称
*/
private String roleName;
}

71
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/CustomerFunctionRoleExcel.java

@ -0,0 +1,71 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 客户定制功能角色列表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-07
*/
@Data
public class CustomerFunctionRoleExcel {
@Excel(name = "唯一标识")
private String id;
@Excel(name = "客户Id ")
private String customerId;
@Excel(name = "功能ID(function.ID)")
private String functionId;
@Excel(name = "所属APP(工作端:gov、居民端:resi)")
private String fromApp;
@Excel(name = "角色Key值")
private String roleKey;
@Excel(name = "角色名称")
private String roleName;
@Excel(name = "删除标识:0.未删除 1.已删除")
private Integer delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

47
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFunctionRoleRedis.java

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

20
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFootBarService.java

@ -20,6 +20,8 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.CustomerFootBarDTO;
import com.epmet.dto.form.CustomerFootBarFormDTO;
import com.epmet.dto.result.CustomerFootBarResultDTO;
import com.epmet.entity.CustomerFootBarEntity;
import java.util.List;
@ -94,4 +96,22 @@ public interface CustomerFootBarService extends BaseService<CustomerFootBarEntit
void delete(String[] ids);
List<CustomerFootBarEntity> listCustomerFootBars(String customerId, String appType);
List<CustomerFootBarEntity> listAllCustomerFootBars(String customerId, String appType);
void createFootBar(CustomerFootBarFormDTO form);
void updateFootBar(CustomerFootBarFormDTO form);
CustomerFootBarResultDTO getFootBarDetail(String id);
void saveOrder(List<CustomerFootBarFormDTO.OrderIndexDTO> orderList);
CustomerFootBarEntity getByAppTypeAndBarKeyOfCustomer(String customerId, String appType, String barKey);
void updateDisplayStatus(String id, Boolean display);
void addDefault4Customer(String customerId, String appType);
void deleteFootBar(String id);
}

2
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java

@ -102,7 +102,7 @@ public interface CustomerFunctionDetailService extends BaseService<CustomerFunct
* @param formDTO
* @return
* @Author sun
* @Description 根据所属端和客户Id查询客户定制功能列表
* @Description 居民端工作端根据所属端和客户Id查询客户定制功能列表
**/
List<FunctionDetailResultDTO> resiAndWorkFunctionDetail(FunctionDetailFromDTO formDTO);

114
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionRoleService.java

@ -0,0 +1,114 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.CustomerFunctionRoleDTO;
import com.epmet.dto.form.CustomerFunctionRoleListFormDTO;
import com.epmet.dto.form.SaveCustomerFunctionRoleFormDTO;
import com.epmet.dto.result.CustomerFunctionRoleListResultDTO;
import com.epmet.entity.CustomerFunctionRoleEntity;
import java.util.List;
import java.util.Map;
/**
* 客户定制功能角色列表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-07
*/
public interface CustomerFunctionRoleService extends BaseService<CustomerFunctionRoleEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<CustomerFunctionRoleDTO>
* @author generator
* @date 2020-09-07
*/
PageData<CustomerFunctionRoleDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<CustomerFunctionRoleDTO>
* @author generator
* @date 2020-09-07
*/
List<CustomerFunctionRoleDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return CustomerFunctionRoleDTO
* @author generator
* @date 2020-09-07
*/
CustomerFunctionRoleDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-09-07
*/
void save(CustomerFunctionRoleDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-09-07
*/
void update(CustomerFunctionRoleDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-09-07
*/
void delete(String[] ids);
/**
* @param formDTO
* @return
* @author sun
* @Description 客户定制功能角色设置
*/
void saveCustomerFunctionRole(SaveCustomerFunctionRoleFormDTO formDTO);
/**
* @param formDTO
* @return
* @author sun
* @Description 查询客户定制功能角色列表
*/
List<CustomerFunctionRoleListResultDTO> customerFunctionRoleList(CustomerFunctionRoleListFormDTO formDTO);
}

156
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java

@ -20,11 +20,15 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.CustomerFootBarDao;
import com.epmet.dto.CustomerFootBarDTO;
import com.epmet.dto.form.CustomerFootBarFormDTO;
import com.epmet.dto.result.CustomerFootBarResultDTO;
import com.epmet.entity.CustomerFootBarEntity;
import com.epmet.redis.CustomerFootBarRedis;
import com.epmet.service.CustomerFootBarService;
@ -103,7 +107,157 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl<CustomerFootBarD
@Override
public List<CustomerFootBarEntity> listCustomerFootBars(String customerId, String appType) {
return baseDao.listCustomerFootBars(customerId, appType);
return baseDao.listDisplayCustomerFootBars(customerId, appType);
}
@Override
public List<CustomerFootBarEntity> listAllCustomerFootBars(String customerId, String appType) {
return baseDao.listAllCustomerFootBars(customerId, appType);
}
@Override
public void createFootBar(CustomerFootBarFormDTO form) {
validateBeforeCreate(form);
CustomerFootBarEntity entity = new CustomerFootBarEntity();
entity.setAppType(form.getAppType());
entity.setCustomerId("default"); // 只能为默认客户创建
entity.setBarKey(form.getBarKey());
entity.setBarName(form.getBarName());
entity.setIconPath(form.getIconPath());
entity.setPageTitle(form.getPageTitle());
entity.setSelectedIconPath(form.getSelectedIconPath());
entity.setOrderIndex(baseDao.fetchNextOrder(form.getCustomerId(), form.getAppType()));
entity.setDisplay(true);
baseDao.insert(entity);
sync2Customers(entity);
}
/**
* 同步到客户
* @param entity
*/
private void sync2Customers(CustomerFootBarEntity entity) {
List<String> customerIds = baseDao.listFootBarOwnerCustomerIds();
for (String customerId : customerIds) {
CustomerFootBarEntity bar = baseDao.getByAppTypeAndBarKeyOfCustomer(customerId, entity.getAppType(), entity.getBarKey());
if (bar == null) {
// 该客户还没有该bar
CustomerFootBarEntity newBar = new CustomerFootBarEntity();
newBar.setCustomerId(customerId);
newBar.setIconPath(entity.getIconPath());
newBar.setPageTitle(entity.getPageTitle());
newBar.setBarKey(entity.getBarKey());
newBar.setBarName(entity.getBarName());
newBar.setSelectedIconPath(entity.getSelectedIconPath());
newBar.setOrderIndex(baseDao.fetchNextOrder(customerId, entity.getAppType()));
newBar.setAppType(entity.getAppType());
newBar.setDisplay(true);
baseDao.insert(newBar);
}
}
}
@Override
public void updateFootBar(CustomerFootBarFormDTO form) {
validateBeforeUpdate(form);
CustomerFootBarEntity entity = baseDao.selectById(form.getId());
if (entity == null) {
throw new RenException(EpmetErrorCode.OPER_CUSTOMER_FOOTBAR_NOT_FOUND.getCode(),
EpmetErrorCode.OPER_CUSTOMER_FOOTBAR_NOT_FOUND.getMsg());
}
entity.setSelectedIconPath(form.getSelectedIconPath());
entity.setBarName(form.getBarName());
entity.setPageTitle(form.getPageTitle());
entity.setIconPath(form.getIconPath());
baseDao.updateById(entity);
}
@Override
public CustomerFootBarResultDTO getFootBarDetail(String id) {
CustomerFootBarEntity entity = baseDao.selectById(id);
if (entity == null) {
return new CustomerFootBarResultDTO();
}
CustomerFootBarResultDTO dto = ConvertUtils.sourceToTarget(entity, CustomerFootBarResultDTO.class);
CustomerFootBarEntity defaultBar = baseDao.getByAppTypeAndBarKeyOfCustomer("default", entity.getAppType(), entity.getBarKey());
dto.setDefaultBarName(defaultBar.getBarName());
dto.setDefaultIconPath(defaultBar.getIconPath());
dto.setDefaultSelectedIconPath(defaultBar.getSelectedIconPath());
dto.setDefaultPageTitle(defaultBar.getPageTitle());
return dto;
}
@Transactional
@Override
public void saveOrder(List<CustomerFootBarFormDTO.OrderIndexDTO> orderList) {
for (CustomerFootBarFormDTO.OrderIndexDTO idx : orderList) {
baseDao.updateOrder(idx.getId(), idx.getOrderIndex());
}
}
@Override
public CustomerFootBarEntity getByAppTypeAndBarKeyOfCustomer(String customerId, String appType, String barKey) {
return baseDao.getByAppTypeAndBarKeyOfCustomer(customerId, appType, barKey);
}
@Override
public void updateDisplayStatus(String id, Boolean display) {
baseDao.updateDisplayStatus(id, display);
}
@Transactional
@Override
public void addDefault4Customer(String customerId, String appType) {
List<CustomerFootBarEntity> defaultBars = baseDao.listByAppTypeAndCustomerId("default", appType);
for (CustomerFootBarEntity defaultBar : defaultBars) {
CustomerFootBarEntity bar = baseDao.getByAppTypeAndBarKeyOfCustomer(customerId, appType, defaultBar.getBarKey());
if (bar != null) {
// 该客户已经有该bar了,不再添加
continue;
}
defaultBar.setCustomerId(customerId);
defaultBar.setId(null);
defaultBar.setCreatedTime(null);
defaultBar.setCreatedBy(null);
defaultBar.setUpdatedTime(null);
defaultBar.setUpdatedBy(null);
baseDao.insert(defaultBar);
}
}
@Override
public void deleteFootBar(String id) {
CustomerFootBarEntity defaultFootbar = baseDao.selectById(id);
baseDao.physicsDeleteByAppTypeAndBarKey(defaultFootbar.getAppType(), defaultFootbar.getBarKey());
}
/**
* 添加footbar之前的校验
* @param form
*/
private void validateBeforeCreate(CustomerFootBarFormDTO form) {
synchronized (this) {
int uniqueCount1 = baseDao.count4Unique(form.getCustomerId(), form.getAppType(), form.getBarKey(), null);
int uniqueCount2 = baseDao.count4Unique(form.getCustomerId(), form.getAppType(), null, form.getBarName());
if (uniqueCount1 > 0 || uniqueCount2 > 0) {
throw new RenException(EpmetErrorCode.OPER_CUSTOMER_FOOTBAR_EXISTS.getCode(),
EpmetErrorCode.OPER_CUSTOMER_FOOTBAR_EXISTS.getMsg());
}
}
}
private void validateBeforeUpdate(CustomerFootBarFormDTO form) {
synchronized (this) {
CustomerFootBarEntity entity = baseDao.getByAppTypeAndBarNameOfCustomer(form.getCustomerId(), form.getAppType(), form.getBarName());
if (entity != null && !entity.getId().equals(form.getId())) {
throw new RenException(EpmetErrorCode.OPER_CUSTOMER_FOOTBAR_EXISTS.getCode(),
EpmetErrorCode.OPER_CUSTOMER_FOOTBAR_EXISTS.getMsg());
}
}
}
}

72
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java

@ -20,6 +20,7 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
@ -28,10 +29,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.CustomerFunctionDao;
import com.epmet.dao.CustomerFunctionDetailDao;
import com.epmet.dao.FunctionCustomizedDao;
import com.epmet.dao.FunctionShoppingHistoryDao;
import com.epmet.dao.*;
import com.epmet.dto.CustomerFunctionDetailDTO;
import com.epmet.dto.FunctionCustomizedDTO;
import com.epmet.dto.FunctionShoppingHistoryDTO;
@ -40,6 +38,7 @@ import com.epmet.dto.result.*;
import com.epmet.entity.CustomerFunctionDetailEntity;
import com.epmet.entity.CustomerFunctionEntity;
import com.epmet.entity.FunctionShoppingHistoryEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.redis.CustomerFunctionDetailRedis;
import com.epmet.service.CustomerFunctionDetailService;
import com.epmet.service.FunctionShoppingHistoryService;
@ -49,6 +48,7 @@ import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import rx.internal.util.LinkedArrayList;
import java.util.*;
import java.util.stream.Collectors;
@ -73,6 +73,10 @@ public class CustomerFunctionDetailServiceImpl extends BaseServiceImpl<CustomerF
private CustomerFunctionDao customerFunctionDao;
@Autowired
private FunctionShoppingHistoryDao functionShoppingHistoryDao;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private CustomerFunctionRoleDao customerFunctionRoleDao;
@Override
public PageData<CustomerFunctionDetailDTO> page(Map<String, Object> params) {
@ -127,27 +131,63 @@ public class CustomerFunctionDetailServiceImpl extends BaseServiceImpl<CustomerF
}
/**
* @param formDTO
* @param formDTO
* @return
* @Author sun
* @Description 根据所属端和客户Id查询客户定制功能列表
* @Description 根据所属端和客户Id查询客户定制功能列表
**/
@Override
public List<FunctionDetailResultDTO> resiAndWorkFunctionDetail(FunctionDetailFromDTO formDTO) {
//根据客户Id和所属端查询客户定制功能列表数据
List<FunctionDetailResultDTO> restltList = new LinkedList<>();
//1.根据客户Id和所属端查询客户定制功能列表数据
logger.info(String.format("根据客户Id和所属端查询客户定制功能列表,对应客户Id->%s,所属端->%s", formDTO.getCustomerId(), formDTO.getClientType()));
List<FunctionDetailResultDTO> list = baseDao.selectFunctionDetailList(formDTO);
try {
String join = String.join(",", new ArrayList<>());
String customerParameter = java.net.URLEncoder.encode(join, "utf-8");
list.forEach(l->{
l.setCustomerParameter(customerParameter);
if (null != list && list.size() > NumConstant.ZERO) {
//1-1.设置自定义json数据(暂时为空)
try {
String join = String.join(",", new ArrayList<>());
String customerParameter = java.net.URLEncoder.encode(join, "utf-8");
list.forEach(l -> {
l.setCustomerParameter(customerParameter);
});
} catch (Exception e) {
logger.error("CustomerFunctionDetailServiceImpl.resiAndWorkFunctionDetail->集合参数URLEncode失败");
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage());
}
//2.调用user服务,获取用户角色信息
GetRoleKeyListFormDTO dto = new GetRoleKeyListFormDTO();
dto.setUserId(formDTO.getUserId());
dto.setFromApp(formDTO.getClientType());
//居民端需要传网格Id 热心居民的角色是在网格里的
if(AppClientConstant.APP_RESI.equals(formDTO.getClientType())){
dto.setGridId(formDTO.getGridId());
}
Result<List<String>> result = epmetUserOpenFeignClient.getUserRoleKeyList(dto);
if (!result.success()) {
logger.error(String.format("调用user服务,获取用户角色信息失败,用户Id:%s ,所属端:%s", formDTO.getUserId(), formDTO.getClientType()));
throw new RenException(result.getCode());
}
//未查询到角色数据则不能查看定制功能(居民端陌生人无任何角色)
if (null == result || result.getData().size() < NumConstant.ONE) {
return restltList;
}
formDTO.setRoleKeyList(result.getData());
//3.根据用户拥有的角色查询客户的定制功能
List<String> listFunctionIds = customerFunctionRoleDao.selectFunctionList(formDTO);
//4.封装结果数据
list.forEach(l -> {
listFunctionIds.forEach(id -> {
if (id.equals(l.getFunctionId())) {
restltList.add(l);
}
});
});
} catch (Exception e) {
logger.error("CustomerFunctionDetailServiceImpl.resiAndWorkFunctionDetail->集合参数URLEncode失败");
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage());
}
return list;
return restltList;
}
@Override

154
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionRoleServiceImpl.java

@ -0,0 +1,154 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.exception.ErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.CustomerFunctionRoleDao;
import com.epmet.dto.CustomerFunctionRoleDTO;
import com.epmet.dto.form.CustomerFunctionRoleListFormDTO;
import com.epmet.dto.form.RoleListFormDTO;
import com.epmet.dto.form.SaveCustomerFunctionRoleFormDTO;
import com.epmet.dto.result.CustomerFunctionRoleListResultDTO;
import com.epmet.entity.CustomerFunctionRoleEntity;
import com.epmet.redis.CustomerFunctionRoleRedis;
import com.epmet.service.CustomerFunctionRoleService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 客户定制功能角色列表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-07
*/
@Service
public class CustomerFunctionRoleServiceImpl extends BaseServiceImpl<CustomerFunctionRoleDao, CustomerFunctionRoleEntity> implements CustomerFunctionRoleService {
@Autowired
private CustomerFunctionRoleRedis customerFunctionRoleRedis;
@Override
public PageData<CustomerFunctionRoleDTO> page(Map<String, Object> params) {
IPage<CustomerFunctionRoleEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, CustomerFunctionRoleDTO.class);
}
@Override
public List<CustomerFunctionRoleDTO> list(Map<String, Object> params) {
List<CustomerFunctionRoleEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, CustomerFunctionRoleDTO.class);
}
private QueryWrapper<CustomerFunctionRoleEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<CustomerFunctionRoleEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public CustomerFunctionRoleDTO get(String id) {
CustomerFunctionRoleEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, CustomerFunctionRoleDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(CustomerFunctionRoleDTO dto) {
CustomerFunctionRoleEntity entity = ConvertUtils.sourceToTarget(dto, CustomerFunctionRoleEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(CustomerFunctionRoleDTO dto) {
CustomerFunctionRoleEntity entity = ConvertUtils.sourceToTarget(dto, CustomerFunctionRoleEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @param formDTO
* @return
* @author sun
* @Description 客户定制功能角色设置
*/
@Override
public void saveCustomerFunctionRole(SaveCustomerFunctionRoleFormDTO formDTO) {
List<CustomerFunctionRoleEntity> listEntity = new ArrayList<>();
//1.封装数据
List<RoleListFormDTO> roleList = formDTO.getRoleList();
roleList.forEach(role->{
CustomerFunctionRoleEntity entity = new CustomerFunctionRoleEntity();
entity.setCustomerId(formDTO.getCustomerId());
entity.setFunctionId(formDTO.getFunctionId());
entity.setFromApp(formDTO.getFromApp());
entity.setRoleKey(role.getRoleKey());
entity.setRoleName(role.getRoleName());
listEntity.add(entity);
});
//2.先按客户Id、功能Id执行删除操作
baseDao.delByCustomerId(formDTO);
//3.批量新增
if(!insertBatch(listEntity)){
throw new RenException("定制功能角色设置失败");
}
}
/**
* @param formDTO
* @return
* @author sun
* @Description 查询客户定制功能角色列表
*/
@Override
public List<CustomerFunctionRoleListResultDTO> customerFunctionRoleList(CustomerFunctionRoleListFormDTO formDTO) {
//1.根据客户Id、功能Id查询客户定制功能设置的角色列表
return baseDao.selectCustomerFunctionRoleList(formDTO);
}
}

2
epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml

@ -10,7 +10,7 @@ spring:
name: oper-customize-server
#环境 dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages,i18n/messages_common

2
epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.6__footbar_add_column.sql

@ -0,0 +1,2 @@
alter table customer_foot_bar add column DISPLAY tinyint(1) default 1;
alter table customer_foot_bar change `ORDER` ORDER_INDEX tinyint(1) default 1;

15
epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.7__customer_function_role.sql

@ -0,0 +1,15 @@
CREATE TABLE `customer_function_role` (
`ID` varchar(64) NOT NULL COMMENT '唯一标识',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id ',
`FUNCTION_ID` varchar(64) NOT NULL COMMENT '功能ID(function.ID)',
`FROM_APP` varchar(32) NOT NULL COMMENT '所属APP(工作端:gov、居民端:resi)',
`ROLE_KEY` varchar(32) NOT NULL COMMENT '角色Key值',
`ROLE_NAME` varchar(32) NOT NULL COMMENT '角色名称',
`DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='客户定制功能角色列表';

175
epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFootBarDao.xml

@ -11,7 +11,8 @@
<result property="pageTitle" column="PAGE_TITLE"/>
<result property="iconPath" column="ICON_PATH"/>
<result property="selectedIconPath" column="SELECTED_ICON_PATH"/>
<result property="order" column="ORDER"/>
<result property="orderIndex" column="ORDER_INDEX"/>
<result property="display" column="DISPLAY"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
@ -20,34 +21,194 @@
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<!--更新顺序号-->
<update id="updateOrder">
update customer_foot_bar
set ORDER_INDEX = #{orderIndex}
where ID = #{id}
</update>
<update id="updateDisplayStatus">
update customer_foot_bar
set DISPLAY=#{display}
where ID = #{id}
</update>
<!--物理删除-->
<delete id="physicsDeleteById">
delete
from customer_foot_bar
where ID = #{id}
</delete>
<delete id="physicsDeleteByAppTypeAndBarKey">
delete
from customer_foot_bar
where app_type = #{appType}
and BAR_KEY = #{barKey}
</delete>
<!--查询客户的footbar列表-->
<select id="listCustomerFootBars" resultType="com.epmet.entity.CustomerFootBarEntity">
<select id="listDisplayCustomerFootBars" resultType="com.epmet.entity.CustomerFootBarEntity">
SELECT
id,
customer_id,
app_type,
bar_key,
bar_name,
app_type,
page_title,
icon_path,
selected_icon_path,
`order`,
display,
order_index,
del_flag,
revision,
created_by,
created_time,
updated_by,
updated_time,
`order`
updated_time
FROM
customer_foot_bar
<where>
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND APP_TYPE = #{appType}
AND DISPLAY = 1
</where>
ORDER BY `ORDER_INDEX` ASC
</select>
<select id="listAllCustomerFootBars" resultType="com.epmet.entity.CustomerFootBarEntity">
SELECT
id,
customer_id,
app_type,
bar_key,
bar_name,
page_title,
icon_path,
selected_icon_path,
display,
order_index,
del_flag,
revision,
created_by,
created_time,
updated_by,
updated_time
FROM
customer_foot_bar
<where>
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND APP_TYPE = #{appType}
</where>
ORDER BY `ORDER_INDEX` ASC
</select>
<select id="count4Unique" resultType="java.lang.Integer">
select count(1)
from customer_foot_bar
<where>
<if test="appType != null and appType != ''">
app_type = #{appType}
</if>
<if test="barKey != null and barKey != ''">
and BAR_KEY = #{barKey}
</if>
<if test="customerId != null and customerId != ''">
and CUSTOMER_ID = #{customerId}
</if>
<if test="barName != null and barName != ''">
and BAR_NAME= #{barName}
</if>
and DEL_FLAG=0
</where>
</select>
<select id="fetchNextOrder" resultType="java.lang.Integer">
select ifnull(max(`ORDER_INDEX`),-1) + 1
from customer_foot_bar
<where>
app_type = #{appType}
and CUSTOMER_ID = #{customerId}
and DEL_FLAG=0
</where>
ORDER BY `order` ASC
</select>
<select id="getByAppTypeAndBarKeyOfCustomer" resultType="com.epmet.entity.CustomerFootBarEntity">
select id,
customer_id,
app_type,
bar_key,
bar_name,
page_title,
icon_path,
selected_icon_path,
display,
order_index,
del_flag,
revision,
created_by,
created_time,
updated_by,
updated_time
from customer_foot_bar
where CUSTOMER_ID = #{customerId}
and APP_TYPE = #{appType}
and BAR_KEY = #{barKey}
</select>
<select id="listByAppTypeAndCustomerId" resultType="com.epmet.entity.CustomerFootBarEntity">
select id,
customer_id,
app_type,
bar_key,
bar_name,
page_title,
icon_path,
selected_icon_path,
display,
order_index,
del_flag,
revision,
created_by,
created_time,
updated_by,
updated_time
from customer_foot_bar
where CUSTOMER_ID = #{customerId}
and app_type = #{appType}
and DEL_FLAG=0
</select>
<select id="listFootBarOwnerCustomerIds" resultType="java.lang.String">
select distinct CUSTOMER_ID
from customer_foot_bar fb
where CUSTOMER_ID != 'default'
</select>
<select id="getByAppTypeAndBarNameOfCustomer" resultType="com.epmet.entity.CustomerFootBarEntity">
select id,
customer_id,
app_type,
bar_key,
bar_name,
page_title,
icon_path,
selected_icon_path,
display,
order_index,
del_flag,
revision,
created_by,
created_time,
updated_by,
updated_time
from customer_foot_bar
where CUSTOMER_ID = #{customerId}
and APP_TYPE = #{appType}
and BAR_NAME = #{barName}
</select>

39
epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionRoleDao.xml

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.CustomerFunctionRoleDao">
<select id="selectCustomerFunctionRoleList" resultType="com.epmet.dto.result.CustomerFunctionRoleListResultDTO">
SELECT
role_key AS "roleKey",
role_name AS "roleName"
FROM
customer_function_role
WHERE
del_flag = '0'
AND customer_id = #{customerId}
AND function_id = #{functionId}
</select>
<select id="selectFunctionList" resultType="java.lang.String">
SELECT
DISTINCT
FUNCTION_ID
FROM customer_function_role
WHERE del_flag = '0'
AND customer_id = #{customerId}
AND from_app = #{clientType}
<foreach collection="roleKeyList" item="roleKey" index="index" open="AND ( " separator=" OR " close=")">
role_key = #{roleKey}
</foreach>
</select>
<delete id="delByCustomerId">
DELETE
FROM customer_function_role
WHERE customer_id = #{customerId}
AND function_id = #{functionId}
</delete>
</mapper>

2
epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml

@ -10,7 +10,7 @@ spring:
name: resi-group-server
#环境 dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages,i18n/messages_common

2
epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml

@ -10,7 +10,7 @@ spring:
name: resi-guide-server
#环境 dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages,i18n/messages_common

2
epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml

@ -10,7 +10,7 @@ spring:
name: resi-hall-server
#环境 dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages_common

2
epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml

@ -10,7 +10,7 @@ spring:
name: resi-home-server
#环境 dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages_common

2
epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml

@ -10,7 +10,7 @@ spring:
name: resi-mine-server
#环境 dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages,i18n/messages_common

6
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java

@ -477,9 +477,9 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
Result<GridInfoResultDTO> gridInfoResult = govOrgFeignClient.queryGridInfo(partyMemberInfo.getGridId());
String gridFullPath = "";
if (gridInfoResult.success() && null != gridInfoResult.getData()) {
gridFullPath = String.format("%s-%s-%s", gridInfoResult.getData().getStreetName(),
gridInfoResult.getData().getCommnuityName(),
gridInfoResult.getData().getGridName());
gridFullPath = String.format("%s-%s-%s", null == gridInfoResult.getData().getStreetName() ? "" : gridInfoResult.getData().getStreetName(),
null == gridInfoResult.getData().getCommnuityName() ? "" : gridInfoResult.getData().getCommnuityName(),
null == gridInfoResult.getData().getGridName() ? "" : gridInfoResult.getData().getGridName());
gridFullPath = gridFullPath.replaceAll("--", "").trim();
}
resultDTO.setGridFullPath(gridFullPath);

2
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml

@ -10,7 +10,7 @@ spring:
name: resi-partymember-server
#环境 dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages,i18n/messages_common

2
epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml

@ -10,7 +10,7 @@ spring:
name: resi-voice-server
#环境 dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss

2
epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml

@ -10,7 +10,7 @@ spring:
name: epmet-openapi-scan
#环境 dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
messages:
encoding: UTF-8
basename: i18n/messages_common

7
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonUserFormDTO.java

@ -1,5 +1,6 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@ -15,15 +16,17 @@ import java.io.Serializable;
public class CommonUserFormDTO implements Serializable{
private static final long serialVersionUID = -7994579456530273809L;
public interface CustomerId_UserIdGroup extends CustomerClientShowGroup{}
/**
* 用户Id
* */
@NotBlank(message = "用户Id不能为空")
@NotBlank(message = "用户Id不能为空" , groups = CustomerId_UserIdGroup.class)
private String userId;
/**
* 客户Id
* */
@NotBlank(message = "客户Id不能为空")
@NotBlank(message = "客户Id不能为空" , groups = CustomerId_UserIdGroup.class)
private String customerId;
}

28
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GetRoleKeyListFormDTO.java

@ -0,0 +1,28 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 获取用户拥有的角色key集合-接口入参
* @Author sun
*/
@Data
public class GetRoleKeyListFormDTO implements Serializable{
private static final long serialVersionUID = -7994579456530273809L;
/**
* 用户Id
* */
private String userId;
/**
* 网格Id
* */
private String gridId;
/**
* 所属端居民端resi 工作端gov
* */
private String fromApp;
}

46
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ResiGovRoleListResultDTO.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.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 获取居民端工作端人员角色列表--接口返参
*
* @author sun
*/
@Data
public class ResiGovRoleListResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 居民端角色列表
*/
private List<ResiGovRoleResultDTO> resiRoleList;
/**
* 工作端角色列表
*/
private List<ResiGovRoleResultDTO> govRoleList;
}

44
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ResiGovRoleResultDTO.java

@ -0,0 +1,44 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 获取居民端工作端人员角色列表--接口返参
*
* @author sun
*/
@Data
public class ResiGovRoleResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 角色key
*/
private String roleKey;
/**
* 角色名称
*/
private String roleName;
}

7
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java

@ -306,4 +306,11 @@ public interface EpmetUserOpenFeignClient {
*/
@PostMapping("epmetuser/staffrole/changeroleorg")
Result changeRoleOrg(@RequestBody StaffRoleDTO formDTO);
/**
* @Author sun
* @Description 居民端-查询用户角色key列表
**/
@PostMapping("epmetuser/role/getuserrolekeylist")
Result<List<String>> getUserRoleKeyList(@RequestBody GetRoleKeyListFormDTO dto);
}

5
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java

@ -205,4 +205,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
public Result changeRoleOrg(StaffRoleDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "changeRoleOrg", formDTO);
}
@Override
public Result<List<String>> getUserRoleKeyList(GetRoleKeyListFormDTO dto) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getUserRoleKeyList", dto);
}
}

17
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java

@ -1,11 +1,16 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.RoleDTO;
import com.epmet.dto.form.GovStaffRoleFormDTO;
import com.epmet.dto.form.IssueInitiatorFormDTO;
import com.epmet.dto.result.GovStaffRoleResultDTO;
import com.epmet.dto.result.GovStaffRoleTemplateDTO;
import com.epmet.dto.result.IssueInitiatorResultDTO;
import com.epmet.dto.result.ResiGovRoleListResultDTO;
import com.epmet.entity.GovStaffRoleEntity;
import com.epmet.service.GovStaffRoleService;
import org.springframework.beans.factory.annotation.Autowired;
@ -59,4 +64,16 @@ public class GovStaffRoleController {
return new Result<List<GovStaffRoleResultDTO>>().ok(roleDTOS);
}
/**
* @param tokenDTO
* @return ResiGovRoleListResultDTO
* @author sun
* @Description 获取居民端工作端人员角色列表
*/
@PostMapping("resigovrolelist")
public Result<ResiGovRoleListResultDTO> resiGovRoleList(@LoginUser TokenDto tokenDTO){
return new Result<ResiGovRoleListResultDTO>().ok(govStaffRoleService.resiGovRoleList());
}
}

14
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/RoleController.java

@ -17,7 +17,9 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
@ -26,6 +28,7 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.RoleDTO;
import com.epmet.dto.form.GetRoleKeyListFormDTO;
import com.epmet.excel.RoleExcel;
import com.epmet.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
@ -91,4 +94,15 @@ public class RoleController {
ExcelUtils.exportExcelToTarget(response, null, list, RoleExcel.class);
}
/**
* @param formDTO
* @return
* @Author sun
* @Description 居民端-查询用户角色key列表
**/
@PostMapping("getuserrolekeylist")
public Result<List<String>> getUserRoleKeyList(@RequestBody GetRoleKeyListFormDTO formDTO) {
return new Result<List<String>>().ok(roleService.getUserRoleKeyList(formDTO));
}
}

7
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleTemplateDao.java

@ -19,6 +19,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.GovStaffRoleTemplateDTO;
import com.epmet.dto.result.ResiGovRoleResultDTO;
import com.epmet.entity.GovStaffRoleTemplateEntity;
import org.apache.ibatis.annotations.Mapper;
@ -38,4 +39,10 @@ public interface GovStaffRoleTemplateDao extends BaseDao<GovStaffRoleTemplateEnt
* @return
*/
List<GovStaffRoleTemplateDTO> listValidateRoles();
/**
* @author sun
* @Description 获取工作端角色列表
*/
List<ResiGovRoleResultDTO> selectGovRoleList();
}

7
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RoleDao.java

@ -19,6 +19,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.RoleDTO;
import com.epmet.dto.result.ResiGovRoleResultDTO;
import com.epmet.entity.RoleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -41,4 +42,10 @@ public interface RoleDao extends BaseDao<RoleEntity> {
* @return RoleEntity
*/
RoleEntity selectRoleByKey(RoleEntity param);
/**
* @author sun
* @Description 获取居民端角色列表
*/
List<ResiGovRoleResultDTO> selectResiRoleList();
}

9
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java

@ -23,6 +23,7 @@ import com.epmet.commons.mybatis.entity.DataScope;
import com.epmet.dto.StaffRoleDTO;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.CustomerStaffRoleListFormDTO;
import com.epmet.dto.form.GetRoleKeyListFormDTO;
import com.epmet.dto.result.CustomerStaffRoleListResultDTO;
import com.epmet.dto.result.CustomerStaffRoleResultDTO;
import com.epmet.dto.result.GovStaffRoleResultDTO;
@ -122,4 +123,12 @@ public interface StaffRoleDao extends BaseDao<StaffRoleEntity> {
* @return void
*/
void updateStaffRoleOrgId(StaffRoleDTO dto);
/**
* @param formDTO
* @return
* @Author sun
* @Description 工作端-查询用户角色key列表
**/
List<String> selectStaffRoleKeyList(GetRoleKeyListFormDTO formDTO);
}

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

Loading…
Cancel
Save