Browse Source

Merge branch 'dev' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_thirdplatform

dev_shibei_match
sunyuchao 5 years ago
parent
commit
c6f288286a
  1. 2
      epmet-auth/deploy/docker-compose-dev.yml
  2. 2
      epmet-auth/deploy/docker-compose-prod.yml
  3. 2
      epmet-auth/deploy/docker-compose-test.yml
  4. 2
      epmet-auth/pom.xml
  5. 29
      epmet-auth/src/main/java/com/epmet/controller/BackDoorController.java
  6. 108
      epmet-auth/src/main/java/com/epmet/redis/CustomerAppWxServiceUtil.java
  7. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  8. 2
      epmet-gateway/deploy/docker-compose-test.yml
  9. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActCaculateDistanceFormDTO.java
  10. 16
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActInsertLiveFormDTO.java
  11. 19
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActSignInFormDTO.java
  12. 4
      epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml
  13. 2
      epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-prod.yml
  14. 2
      epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-test.yml
  15. 2
      epmet-module/epmet-heart/epmet-heart-server/pom.xml
  16. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java
  17. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java
  18. 78
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java
  19. 79
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInRecServiceImpl.java
  20. 99
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java
  21. 94
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ValidityVerification.java
  22. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml
  23. 2
      epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-dev.yml
  24. 2
      epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-test.yml
  25. 2
      epmet-module/epmet-oss/epmet-oss-server/pom.xml
  26. 106
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAdjustmentLogDTO.java
  27. 10
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointVerificationLogDTO.java
  28. 29
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/CommonPageUserFormDTO.java
  29. 56
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointAdjustmentFormDTO.java
  30. 53
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointVerificationFormDTO.java
  31. 4
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/ResiCommonUserIdFormDTO.java
  32. 20
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/ResiPointRankFormDTO.java
  33. 32
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/WorkPointVerificationFormDTO.java
  34. 36
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointAdjustmentResultDTO.java
  35. 2
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointDetailResultDTO.java
  36. 1
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointRuleResultDTO.java
  37. 36
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointVerificationResultDTO.java
  38. 2
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankListResultDTO.java
  39. 27
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/WorkPointVerficationListResultDTO.java
  40. 33
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/WorkPointVerificationDetailResultDTO.java
  41. 38
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/WorkPointVerificationLogResultDTO.java
  42. 15
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java
  43. 9
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java
  44. 4
      epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml
  45. 2
      epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-prod.yml
  46. 2
      epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-test.yml
  47. 4
      epmet-module/epmet-point/epmet-point-server/pom.xml
  48. 59
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java
  49. 2
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java
  50. 122
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java
  51. 46
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAdjustmentLogDao.java
  52. 12
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.java
  53. 11
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationStatisticalDailyDao.java
  54. 8
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java
  55. 9
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointTotalDao.java
  56. 76
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAdjustmentLogEntity.java
  57. 10
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointVerificationLogEntity.java
  58. 18
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/redis/PointRedis.java
  59. 126
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdjustmentLogService.java
  60. 28
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationLogService.java
  61. 9
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationStatisticalDailyService.java
  62. 7
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java
  63. 11
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java
  64. 31
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointTotalService.java
  65. 242
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdjustmentLogServiceImpl.java
  66. 3
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java
  67. 256
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java
  68. 18
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationStatisticalDailyServiceImpl.java
  69. 10
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java
  70. 113
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java
  71. 137
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java
  72. 91
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/utils/DimIdGenerator.java
  73. 55
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/utils/ModuleConstant.java
  74. 43
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAdjustmentLogDao.xml
  75. 20
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointVerificationLogDao.xml
  76. 14
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointVerificationStatisticalDailyDao.xml
  77. 20
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml
  78. 15
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml
  79. 2
      epmet-module/epmet-point/pom.xml
  80. 2
      epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml
  81. 2
      epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml
  82. 2
      epmet-module/epmet-third/epmet-third-server/pom.xml
  83. 13
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java
  84. 10
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  85. 6
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  86. 2
      epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-dev.yml
  87. 2
      epmet-module/gov-voice/gov-voice-server/pom.xml
  88. 3
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml
  89. 55
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerAppRedisDTO.java
  90. 2
      epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-dev.yml
  91. 2
      epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-prod.yml
  92. 2
      epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-test.yml
  93. 2
      epmet-module/oper-crm/oper-crm-server/pom.xml
  94. 6
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerAppController.java
  95. 2
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerAppService.java
  96. 33
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerAppServiceImpl.java
  97. 4
      epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyResiUserInfoResultDTO.java
  98. 18
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java
  99. 34
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerUserFormDTO.java
  100. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IssueInitiatorFormDTO.java

2
epmet-auth/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-auth-server:
container_name: epmet-auth-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.55
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.56
ports:
- "8081:8081"
network_mode: host # 使用现有网络

2
epmet-auth/deploy/docker-compose-prod.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-auth-server:
container_name: epmet-auth-server-prod
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-auth:0.3.55
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-auth:0.3.56
ports:
- "8081:8081"
network_mode: host # 使用现有网络

2
epmet-auth/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-auth-server:
container_name: epmet-auth-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-auth:0.3.55
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-auth:0.3.56
ports:
- "8081:8081"
network_mode: host # 使用现有网络

2
epmet-auth/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.55</version>
<version>0.3.56</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-cloud</artifactId>

29
epmet-auth/src/main/java/com/epmet/controller/BackDoorController.java

@ -0,0 +1,29 @@
package com.epmet.controller;
import com.epmet.redis.CustomerAppWxServiceUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Set;
/**
* @author jianjun liu
* @date 2020-06-04 20:39
**/
@RestController
@RequestMapping("opback")
public class BackDoorController {
@Autowired
private CustomerAppWxServiceUtil customerAppWxServiceUtil;
/**
* 数据库添加新客户app后
*
* @return
*/
@RequestMapping("reloadcustomerapp")
public Set<String> initWxMaService() {
return customerAppWxServiceUtil.initWxMaService();
}
}

108
epmet-auth/src/main/java/com/epmet/redis/CustomerAppWxServiceUtil.java

@ -13,9 +13,9 @@ import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl;
import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerAppDTO;
import com.epmet.dto.CustomerAppRedisDTO;
import com.epmet.feign.OperCrmOpenFeignClient;
import com.google.common.collect.Maps;
import org.apache.logging.log4j.LogManager;
@ -31,7 +31,6 @@ import org.springframework.util.CollectionUtils;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
/**
* 客户app Redis
@ -50,75 +49,76 @@ public class CustomerAppWxServiceUtil implements ApplicationRunner {
private final static String JSON_STR = "JSON";
@Autowired
private RedisUtils redisUtils;
@Autowired
private RedisTemplate<String,String> redisTemplate;
private RedisTemplate redisTemplate;
@Autowired
private OperCrmOpenFeignClient operCrmOpenFeignClient;
private static Map<String, WxMaService> maServices = Maps.newHashMap();
private static Map<String, WxMaService> maServices = Maps.newConcurrentMap();
public static WxMaService getWxMaService(String appId) {
WxMaService wxMaService = maServices.get(appId);
if (wxMaService == null){
logger.error("getMaService appId:{} is not config from customer_app",appId);
if (wxMaService == null) {
logger.error("getMaService appId:{} is not config from customer_app", appId);
}
return wxMaService;
}
/*public String get(String appId) {
String key = RedisKeys.getAppSecretKey(appId);
String secret = (String) redisUtils.get(key);
if (StringUtils.isBlank(secret)) {
CustomerAppSecretFormDTO param = new CustomerAppSecretFormDTO();
param.setAppId(appId);
Result<String> result = operCrmOpenFeignClient.getSecretByAppId(param);
if (result.success()) {
secret = result.getData();
if (StringUtils.isNotBlank(secret)) {
redisUtils.set(key, secret, MINUTE_THIRTY_EXPIRE);
}
}
}
return secret;
}*/
@Override
public void run(ApplicationArguments args) {
initWxMaService();
}
public Set<String> initWxMaService() {
Map<String, WxMaService> maServicesNew = Maps.newConcurrentMap();
SetOperations appSet = null;
List<CustomerAppDTO> result = null;
String appKey = RedisKeys.getCustomerAppKey();
try {
appSet = redisTemplate.opsForSet();
Set<CustomerAppRedisDTO> members = appSet.members(appKey);
if (!CollectionUtils.isEmpty(members)) {
members.forEach(app -> {
WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl();
config.setAppid(app.getAppId());
config.setSecret(app.getSecret());
config.setMsgDataFormat(JSON_STR);
WxMaService service = new WxMaServiceImpl();
service.setWxMaConfig(config);
maServicesNew.put(app.getAppId(), service);
});
}
} catch (Exception ex) {
logger.error("init wxMaService from redis error", ex);
}
try {
Result<List<CustomerAppDTO>> configAllAppResult = operCrmOpenFeignClient.getConfigAllApp();
logger.info("initWxMa operCrmOpenFeignClient.getConfigAllApp result:{}", JSON.toJSONString(configAllAppResult));
if (configAllAppResult == null || !configAllAppResult.success()){
logger.info("initWxMa operCrmOpenFeignClient.getConfigAllApp fail");
return;
logger.info("wxMaService operCrmOpenFeignClient.getConfigAllApp result:{}", JSON.toJSONString(configAllAppResult));
if (configAllAppResult == null || !configAllAppResult.success()) {
logger.info("wxMaService operCrmOpenFeignClient.getConfigAllApp fail");
return maServicesNew.keySet();
}
String appKey = RedisKeys.getCustomerAppKey();
SetOperations<String, String> appSet = redisTemplate.opsForSet();
Set<String> members = appSet.members(appKey);
result = configAllAppResult.getData();
result.forEach(app -> {
WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl();
config.setAppid(app.getAppId());
config.setSecret(app.getSecret());
config.setMsgDataFormat(JSON_STR);
if ( !CollectionUtils.isEmpty(configAllAppResult.getData())) {
//if (!CollectionUtils.isEmpty(members) && CollectionUtils.isEmpty()){
//todo
//}
maServices = configAllAppResult.getData().stream()
.map(a -> {
WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl();
config.setAppid(a.getAppId());
config.setSecret(a.getSecret());
config.setMsgDataFormat(JSON_STR);
WxMaService service = new WxMaServiceImpl();
service.setWxMaConfig(config);
redisTemplate.opsForSet().add(appKey,a.getSecret());
return service;
}).collect(Collectors.toMap(s -> s.getWxMaConfig().getAppid(), a -> a));
}
WxMaService service = new WxMaServiceImpl();
service.setWxMaConfig(config);
maServicesNew.put(app.getAppId(), service);
});
} catch (Exception e) {
logger.error("init wxMaservice exception",e);
} finally {
logger.info("init wxMaservice end");
logger.error("init wxMaService from db exception", e);
}
if (maServicesNew.size() > 0) {
maServices = maServicesNew;
if (appSet != null && result != null) {
for (CustomerAppDTO app : result) {
appSet.add(appKey, app);
}
}
}
return maServicesNew.keySet();
}
}

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

@ -84,7 +84,7 @@ public enum EpmetErrorCode {
// 爱心互助 居民端
NOT_IN_THE_SIGN_IN_RANGE(8510, "您还未进入指定的签到范围~"),
NON_CERTIFIED_VOLUNTEER(8511, "活动报名失败,请先认证志愿者"),
ACT_TIME_CONFLICT(8512, "活动时间冲突"),
ACT_TIME_CONFLICT(8512, "报名失败。您本次报名活动时间与已报名活动时间间隔较短,为了不影响您已报名的活动,请选择其他时间的活动,谢谢。"),
// 该错误不会提示给前端,只是后端传输错误信息用。
ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"),

2
epmet-gateway/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-gateway-server:
container_name: epmet-gateway-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-gateway:0.3.26
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-gateway:0.3.27
ports:
- "8080:8080"
network_mode: host # 使用现有网络

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActCaculateDistanceFormDTO.java

@ -3,6 +3,7 @@ package com.epmet.dto.form.resi;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
@ -28,13 +29,13 @@ public class ResiActCaculateDistanceFormDTO implements Serializable {
/**
* 经度
*/
@NotBlank(message = "经度不能为空", groups = { AddUserInternalGroup.class })
@NotNull(message = "经度不能为空", groups = { AddUserInternalGroup.class })
private Double longitude;
/**
* 纬度
*/
@NotBlank(message = "纬度不能为空", groups = { AddUserInternalGroup.class })
@NotNull(message = "纬度不能为空", groups = { AddUserInternalGroup.class })
private Double latitude;
/**

16
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActInsertLiveFormDTO.java

@ -21,6 +21,7 @@ import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
@ -43,13 +44,6 @@ public class ResiActInsertLiveFormDTO implements Serializable {
*/
public interface AddUserInternalGroup {}
/**
* 添加用户操作的用户可见异常分组
* 该分组用于校验需要返回给前端错误信息提示的列需要继承CustomerClientShowGroup
* 返回错误码为8999提示信息为DTO中具体的列的校验注解message的内容
*/
public interface AddUserShowGroup extends CustomerClientShowGroup {}
// <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<<
/**
@ -66,19 +60,19 @@ public class ResiActInsertLiveFormDTO implements Serializable {
/**
* 活动签到位置经度
*/
@NotBlank(message = "活动签到位置经度不能为空", groups = { AddUserInternalGroup.class })
@NotNull(message = "活动签到位置经度不能为空", groups = { AddUserInternalGroup.class })
private BigDecimal longitude;
/**
* 活动签到位置纬度
*/
@NotBlank(message = "活动签到位置纬度不能为空", groups = { AddUserInternalGroup.class })
@NotNull(message = "活动签到位置纬度不能为空", groups = { AddUserInternalGroup.class })
private BigDecimal latitude;
/**
* 活动签到地址
*/
@NotBlank(message = "活动签到地址不能为空", groups = { AddUserInternalGroup.class, AddUserShowGroup.class})
@NotBlank(message = "活动签到地址不能为空", groups = { AddUserInternalGroup.class})
private String address;
/**
@ -99,6 +93,6 @@ public class ResiActInsertLiveFormDTO implements Serializable {
/**
* 客户id
*/
@NotBlank(message = "客户id不能为空", groups = {AddUserShowGroup.class })
@NotBlank(message = "客户id不能为空", groups = {AddUserInternalGroup.class })
private String customerId;
}

19
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActSignInFormDTO.java

@ -20,7 +20,9 @@ package com.epmet.dto.form.resi;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
@ -43,13 +45,6 @@ public class ResiActSignInFormDTO implements Serializable {
*/
public interface AddUserInternalGroup {}
/**
* 添加用户操作的用户可见异常分组
* 该分组用于校验需要返回给前端错误信息提示的列需要继承CustomerClientShowGroup
* 返回错误码为8999提示信息为DTO中具体的列的校验注解message的内容
*/
public interface AddUserShowGroup extends CustomerClientShowGroup {}
// <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<<
/**
@ -66,19 +61,19 @@ public class ResiActSignInFormDTO implements Serializable {
/**
* 活动签到位置经度
*/
@NotBlank(message = "活动签到位置经度不能为空", groups = { AddUserInternalGroup.class })
@NotNull(message = "活动签到位置经度不能为空", groups = { AddUserInternalGroup.class })
private BigDecimal longitude;
/**
* 活动签到位置纬度
*/
@NotBlank(message = "活动签到位置纬度不能为空", groups = { AddUserInternalGroup.class })
@NotNull(message = "活动签到位置纬度不能为空", groups = { AddUserInternalGroup.class })
private BigDecimal latitude;
/**
* 活动签到地址
*/
@NotBlank(message = "活动签到地址不能为空", groups = { AddUserInternalGroup.class, AddUserShowGroup.class})
@NotBlank(message = "活动签到地址不能为空", groups = { AddUserInternalGroup.class})
private String address;
/**
@ -89,7 +84,7 @@ public class ResiActSignInFormDTO implements Serializable {
/**
* 0不同步实况1同步到实况记录
*/
@NotBlank(message = "是否同步到实况记录不能为空", groups = { AddUserInternalGroup.class, AddUserShowGroup.class})
@Min(0)
private Integer syncLive;
/**
@ -100,6 +95,6 @@ public class ResiActSignInFormDTO implements Serializable {
/**
* 客户id
*/
@NotBlank(message = "客户id不能为空", groups = {AddUserShowGroup.class })
@NotBlank(message = "客户id不能为空", groups = {AddUserInternalGroup.class })
private String customerId;
}

4
epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml

@ -1,8 +1,8 @@
version: "3.7"
services:
oper-crm-server:
epmet-heart-server:
container_name: epmet-heart-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-heart-server:0.0.1
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-heart-server:0.0.4
ports:
- "8111:8111"
network_mode: host # 使用现有网络

2
epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-prod.yml

@ -1,6 +1,6 @@
version: "3.7"
services:
oper-crm-server:
epmet-heart-server:
container_name: epmet-heart-server-prod
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-heart-server:0.0.1
ports:

2
epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-test.yml

@ -1,6 +1,6 @@
version: "3.7"
services:
oper-crm-server:
epmet-heart-server:
container_name: epmet-heart-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-heart-server:0.0.1
ports:

2
epmet-module/epmet-heart/epmet-heart-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.0.1</version>
<version>0.0.4</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-heart</artifactId>

4
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java

@ -275,7 +275,7 @@ public class ResiActListController {
**/
@PostMapping("insertlive")
public Result insertLive(@LoginUser TokenDto tokenDto, @RequestBody ResiActInsertLiveFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ResiActInsertLiveFormDTO.AddUserInternalGroup.class, ResiActInsertLiveFormDTO.AddUserShowGroup.class);
ValidatorUtils.validateEntity(formDTO, ResiActInsertLiveFormDTO.AddUserInternalGroup.class);
Result<String> result = actLiveRecService.insertLive(tokenDto, formDTO);
return new Result();
}
@ -290,7 +290,7 @@ public class ResiActListController {
**/
@PostMapping("signin")
public Result actSignIn(@LoginUser TokenDto tokenDto, @RequestBody ResiActSignInFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ResiActSignInFormDTO.AddUserInternalGroup.class, ResiActSignInFormDTO.AddUserShowGroup.class);
ValidatorUtils.validateEntity(formDTO, ResiActSignInFormDTO.AddUserInternalGroup.class);
return actSignInRecService.actSignIn(tokenDto, formDTO);
}

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java

@ -157,7 +157,7 @@ public class WorkActController {
* @description 已结束-活动详情
* @Date 2020/7/26 21:01
**/
@PostMapping("finisheddeatil")
@PostMapping("finisheddetail")
public Result<FinishedActDetailResultDTO> finishedDeatil(@RequestBody ActIdFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class);
return new Result<FinishedActDetailResultDTO>().ok(workActService.finishedDeatil(formDTO));

78
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java

@ -18,16 +18,23 @@
package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.nacos.client.utils.StringUtils;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.MqConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO;
import com.epmet.commons.tools.dto.form.mq.eventmsg.ActPointEventMsg;
import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.exception.ErrorCode;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.scan.param.ImgScanParamDTO;
import com.epmet.commons.tools.scan.param.ImgTaskDTO;
import com.epmet.commons.tools.scan.param.TextScanParamDTO;
import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.commons.tools.utils.SendMqMsgUtils;
import com.epmet.constant.ActMessageConstant;
import com.epmet.dao.ActLivePicDao;
@ -42,15 +49,14 @@ import com.epmet.entity.ActLiveRecEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.redis.ActLiveRecRedis;
import com.epmet.service.ActLiveRecService;
import com.epmet.utils.ValidityVerification;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.stream.Collectors;
/**
* 活动实况记录
@ -60,7 +66,7 @@ import java.util.stream.Collectors;
*/
@Service
public class ActLiveRecServiceImpl extends BaseServiceImpl<ActLiveRecDao, ActLiveRecEntity> implements ActLiveRecService {
private Logger logger = LogManager.getLogger(VolunteerInfoServiceImpl.class);
private Logger logger = LogManager.getLogger(ActLiveRecServiceImpl.class);
@Autowired
private ActLiveRecRedis actLiveRecRedis;
@ -71,6 +77,13 @@ public class ActLiveRecServiceImpl extends BaseServiceImpl<ActLiveRecDao, ActLiv
@Autowired
private ActLivePicDao actLivePicDao;
@Value("${openapi.scan.server.url}")
private String scanApiUrl;
@Value("${openapi.scan.method.textSyncScan}")
private String textSyncScanMethod;
@Value("${openapi.scan.method.imgSyncScan}")
private String imgSyncScanMethod;
@Override
public Result<ResiActLiveRecResultDTO> liveRecList(Map<String, String> map) {
if (map.get("actId") == null){
@ -125,11 +138,8 @@ public class ActLiveRecServiceImpl extends BaseServiceImpl<ActLiveRecDao, ActLiv
@Transactional(rollbackFor = Exception.class)
public Result<String> insertLive(TokenDto tokenDto, ResiActInsertLiveFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId());
// 文本校验
ValidityVerification verification = new ValidityVerification();
verification.textScanVerification(formDTO.getDesc(),"添加实况-文本内容审核失败");
// 图片校验
verification.imgScanVerification(formDTO.getImages(),"添加实况-图片审核失败");
// 文本校验/图片校验
this.auditActContent(formDTO.getDesc(),formDTO.getImages());
// 存储活动实况记录表
String uuid = UUID.randomUUID().toString().replaceAll("-","");
@ -153,6 +163,56 @@ public class ActLiveRecServiceImpl extends BaseServiceImpl<ActLiveRecDao, ActLiv
return new Result<String>().ok(uuid);
}
/**
* 内容校验
*
* @param context 文本
* @param imgList 图片
* @return void
* @Author zhangyong
* @Date 10:15 2020-07-28
**/
private void auditActContent(String context, List<String> imgList) {
//审核活动详情中的内容
if(StringUtils.isNotBlank(context)){
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setContent(context);
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> contentSyncScanRes = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!contentSyncScanRes.success()) {
logger.error("添加实况接口失败,返参:", JSON.toJSONString(contentSyncScanRes));
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!contentSyncScanRes.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode());
}
}
logger.info("添加实况成功");
}
if(null!=imgList&&imgList.size()>0){
//审核活动详情中的图片
ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO();
imgList.forEach(url -> {
ImgTaskDTO task = new ImgTaskDTO();
task.setDataId(UUID.randomUUID().toString().replace("-", ""));
task.setUrl(url);
imgScanParamDTO.getTasks().add(task);
});
Result<SyncScanResult> imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO);
if (!imgScanResult.success()){
logger.error("添加实况图片审核接口失败,返参:", JSON.toJSONString(imgScanResult));
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!imgScanResult.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.IMG_SCAN_FAILED.getCode());
}
}
logger.info("添加实况审核成功");
}
}
private void grantActPoints(ResiActInsertLiveFormDTO formDTO){
//备注
String remark=String.format(ActMessageConstant.ACT_POINTS_EVENT_VOLUNTEER_LIVE,formDTO.getUserId(),formDTO.getActId());

79
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInRecServiceImpl.java

@ -17,11 +17,21 @@
package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.nacos.client.utils.StringUtils;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.scan.param.ImgScanParamDTO;
import com.epmet.commons.tools.scan.param.ImgTaskDTO;
import com.epmet.commons.tools.scan.param.TextScanParamDTO;
import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
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.commons.tools.utils.ScanContentUtils;
import com.epmet.constant.ActConstant;
import com.epmet.dao.ActSignInPicDao;
import com.epmet.dao.ActSignInRecDao;
@ -35,8 +45,10 @@ import com.epmet.entity.ActSignInRecEntity;
import com.epmet.redis.ActSignInRecRedis;
import com.epmet.service.ActLiveRecService;
import com.epmet.service.ActSignInRecService;
import com.epmet.utils.ValidityVerification;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -64,15 +76,20 @@ public class ActSignInRecServiceImpl extends BaseServiceImpl<ActSignInRecDao, Ac
@Autowired
private ActLiveRecService actLiveRecService;
private Logger logger = LogManager.getLogger(ActSignInRecServiceImpl.class);
@Value("${openapi.scan.server.url}")
private String scanApiUrl;
@Value("${openapi.scan.method.textSyncScan}")
private String textSyncScanMethod;
@Value("${openapi.scan.method.imgSyncScan}")
private String imgSyncScanMethod;
@Override
@Transactional(rollbackFor = Exception.class)
public Result actSignIn(TokenDto tokenDto, ResiActSignInFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId());
// 文本校验
ValidityVerification verification = new ValidityVerification();
verification.textScanVerification(formDTO.getDesc(),"添加签到-文本内容审核失败");
// 图片校验
verification.imgScanVerification(formDTO.getImages(),"添加签到-图片审核失败");
// 文本校验/图片校验
this.auditActContent(formDTO.getDesc(),formDTO.getImages());
// 更新用户活动关系表 SIGN_IN_FLAG字段更新为已签到
ActUserRelationDTO actUserRelationDTO = new ActUserRelationDTO();
@ -109,4 +126,54 @@ public class ActSignInRecServiceImpl extends BaseServiceImpl<ActSignInRecDao, Ac
}
return new Result();
}
/**
* 内容校验
*
* @param context 文本
* @param imgList 图片
* @return void
* @Author zhangyong
* @Date 10:15 2020-07-28
**/
private void auditActContent(String context, List<String> imgList) {
//审核活动详情中的内容
if(StringUtils.isNotBlank(context)){
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setContent(context);
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> contentSyncScanRes = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!contentSyncScanRes.success()) {
logger.error("活动签到接口失败,返参:", JSON.toJSONString(contentSyncScanRes));
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!contentSyncScanRes.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode());
}
}
logger.info("活动签到成功");
}
if(null!=imgList&&imgList.size()>0){
//审核活动详情中的图片
ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO();
imgList.forEach(url -> {
ImgTaskDTO task = new ImgTaskDTO();
task.setDataId(UUID.randomUUID().toString().replace("-", ""));
task.setUrl(url);
imgScanParamDTO.getTasks().add(task);
});
Result<SyncScanResult> imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO);
if (!imgScanResult.success()){
logger.error("活动签到图片审核接口失败,返参:", JSON.toJSONString(imgScanResult));
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!imgScanResult.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.IMG_SCAN_FAILED.getCode());
}
}
logger.info("活动签到图片审核成功");
}
}
}

99
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java

@ -237,45 +237,19 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
Integer actTimeFlag = actInfoService.checkActTime(actInfoDTO);
if (actTimeFlag > NumConstant.ZERO){
signUp = false;
logger.info("活动报名失败,活动时间冲突");
logger.info("报名失败。您本次报名活动时间与已报名活动时间间隔较短,为了不影响您已报名的活动,请选择其他时间的活动,谢谢。");
throw new RenException(EpmetErrorCode.ACT_TIME_CONFLICT.getCode());
}
} else {
// 3.第一次报名
HeartUserInfoEntity entity = new HeartUserInfoEntity();
entity.setCustomerId(formDTO.getCustomerId());
entity.setUserId(formDTO.getUserId());
entity.setVolunteerFlag(volunteerFlag > NumConstant.ZERO);
entity.setKindnessTime(NumConstant.ZERO);
entity.setParticipationNum(NumConstant.ZERO);
entity.setObtainPointNum(NumConstant.ZERO);
heartUserInfoDao.insert(entity);
this.insertHeartUserInfo(formDTO, volunteerFlag);
}
if (signUp){
// 4.插入活动日志表
ActUserLogEntity userLogEntity = new ActUserLogEntity();
userLogEntity.setActId(formDTO.getActId());
userLogEntity.setUserId(formDTO.getUserId());
userLogEntity.setOperationType(ActConstant.ACT_USER_LOG_OPER_AUDITING);
actUserLogService.insert(userLogEntity);
this.insertActUserLog(formDTO);
}
ActUserRelationEntity entity = new ActUserRelationEntity();
entity.setActId(formDTO.getActId());
entity.setUserId(formDTO.getUserId());
entity.setStatus(ActConstant.ACT_USER_STATUS_AUDITING);
// 审核开关:1报名人员需要人工审核(true) 0不需要(false)
if (actInfoDTO.getAuditSwitch()){
entity.setPassedType(ActConstant.PASSEDTYPE_MANUAL);
} else {
entity.setPassedType(ActConstant.PASSEDTYPE_AUTO);
entity.setAuditTime(new Date());
}
Integer operationCount = baseDao.selectCountByActIdAndUserId(formDTO.getActId(), formDTO.getUserId());
if (operationCount > NumConstant.ZERO){
// 用户如果不是第一次参加 这次的活动,先删除关系表中的数据,在插入
baseDao.delSignUpRecord(entity);
}
baseDao.insert(entity);
// 5.插入 用户活动关系表
this.insertActUserRelation(formDTO, actInfoDTO);
}
/**
@ -322,4 +296,67 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
return satisfy;
}
}
/**
* 第一次报名活动需插入用户信息表
* @param formDTO
* @param volunteerFlag
* @return void
* @Author zhangyong
* @Date 09:35 2020-07-28
**/
private void insertHeartUserInfo(ResiActRegistrationFormDTO formDTO, Integer volunteerFlag){
HeartUserInfoEntity entity = new HeartUserInfoEntity();
entity.setCustomerId(formDTO.getCustomerId());
entity.setUserId(formDTO.getUserId());
entity.setVolunteerFlag(volunteerFlag > NumConstant.ZERO);
entity.setKindnessTime(NumConstant.ZERO);
entity.setParticipationNum(NumConstant.ZERO);
entity.setObtainPointNum(NumConstant.ZERO);
heartUserInfoDao.insert(entity);
}
/**
* 每次成功报名活动都需要插入用户活动关系日志表
* @param formDTO
* @return void
* @Author zhangyong
* @Date 09:37 2020-07-28
**/
private void insertActUserLog(ResiActRegistrationFormDTO formDTO){
ActUserLogEntity userLogEntity = new ActUserLogEntity();
userLogEntity.setActId(formDTO.getActId());
userLogEntity.setUserId(formDTO.getUserId());
userLogEntity.setOperationType(ActConstant.ACT_USER_LOG_OPER_AUDITING);
actUserLogService.insert(userLogEntity);
}
/**
* 活动报名成功插入用户活动关系表重复报名先删除后插入
*
* @param formDTO
* @param actInfoDTO
* @return void
* @Author zhangyong
* @Date 09:41 2020-07-28
**/
private void insertActUserRelation(ResiActRegistrationFormDTO formDTO, ActInfoDTO actInfoDTO){
ActUserRelationEntity entity = new ActUserRelationEntity();
entity.setActId(formDTO.getActId());
entity.setUserId(formDTO.getUserId());
entity.setStatus(ActConstant.ACT_USER_STATUS_AUDITING);
// 审核开关:1报名人员需要人工审核(true) 0不需要(false)
if (actInfoDTO.getAuditSwitch()){
entity.setPassedType(ActConstant.PASSEDTYPE_MANUAL);
} else {
entity.setPassedType(ActConstant.PASSEDTYPE_AUTO);
entity.setAuditTime(new Date());
}
Integer operationCount = baseDao.selectCountByActIdAndUserId(formDTO.getActId(), formDTO.getUserId());
if (operationCount > NumConstant.ZERO){
// 用户如果不是第一次参加 这次的活动,先删除关系表中的数据,在插入
baseDao.delSignUpRecord(entity);
}
baseDao.insert(entity);
}
}

94
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ValidityVerification.java

@ -1,94 +0,0 @@
package com.epmet.utils;
import com.alibaba.nacos.client.utils.StringUtils;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.scan.param.ImgScanParamDTO;
import com.epmet.commons.tools.scan.param.ImgTaskDTO;
import com.epmet.commons.tools.scan.param.TextScanParamDTO;
import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import org.springframework.beans.factory.annotation.Value;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
import java.util.UUID;
/**
* 文字图片合法性校验
*
* @author zhangyong
* @date 2020-07-15 14:26
*/
@Slf4j
public class ValidityVerification {
@Value("${openapi.scan.server.url}")
private String scanApiUrl;
@Value("${openapi.scan.method.textSyncScan}")
private String textSyncScanMethod;
@Value("${openapi.scan.method.imgSyncScan}")
private String imgSyncScanMethod;
/**
* 文本校验
* @param context 被校验的文本不能超过10000
* @param businessEnum 业务枚举定义校验失败后输出的日志信息
* @return void
* @auther zhangyong
* @Date 14:42 2020-07-15
**/
public void textScanVerification(String context, String businessEnum){
if (StringUtils.isNotBlank(context)) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setContent(context);
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!textSyncScanResult.success()) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
// 业务枚举:例如:评论话题失败,评论内容为:%s"
log.error(String.format(businessEnum, context));
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode());
}
}
}
}
/**
* 图片列表校验
* @param imgList 被校验的图片列表
* @param businessEnum 业务枚举定义校验失败后输出的日志信息
*
* @return void
* @auther zhangyong
* @Date 14:42 2020-07-15
**/
public void imgScanVerification(List<String> imgList, String businessEnum){
if (null != imgList && NumConstant.ZERO != imgList.size()){
ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO();
imgList.forEach(url -> {
ImgTaskDTO task = new ImgTaskDTO();
task.setDataId(UUID.randomUUID().toString().replace("-", ""));
task.setUrl(url);
imgScanParamDTO.getTasks().add(task);
});
Result<SyncScanResult> imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO);
if (!imgScanResult.success()){
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!imgScanResult.getData().isAllPass()) {
// 业务枚举:例如:评论话题失败,评论内容为:%s"
log.error(String.format(businessEnum));
throw new RenException(EpmetErrorCode.IMG_SCAN_FAILED.getCode());
}
}
}
}
}

4
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml

@ -300,7 +300,7 @@
then 'in_progress'
end as actCurrentState
FROM act_info i
LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID
LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID
WHERE i.DEL_FLAG = '0'
AND i.CUSTOMER_ID = #{customerId}
AND i.ACT_STATUS != 'finished' AND i.ACT_STATUS != 'canceled'
@ -403,7 +403,7 @@
IF(aur.SIGN_IN_FLAG = 'signed_in', true , false ) as isSignUp-- 是否已签到(true已签到,false未签到)
FROM
act_info i
LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID
LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID
LEFT JOIN act_user_relation aur ON aur.ACT_ID = i.ID AND aur.DEL_FLAG = '0' AND aur.USER_ID = #{userId}
WHERE
i.DEL_FLAG = '0'

2
epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-dev.yml

@ -3,7 +3,7 @@ services:
epmet-oss-server:
container_name: epmet-oss-server-dev
# image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-oss-server:0.3.2
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-oss-server:0.3.23
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-oss-server:0.3.24
ports:
- "8083:8083"
network_mode: host # 使用现有网络

2
epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-test.yml

@ -3,7 +3,7 @@ services:
epmet-oss-server:
container_name: epmet-oss-server-test
# image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-test/epmet-oss-server:0.3.2
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-oss-server:0.3.22
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-oss-server:0.3.23
ports:
- "8083:8083"
network_mode: host # 使用现有网络

2
epmet-module/epmet-oss/epmet-oss-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.23</version>
<version>0.3.24</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-oss</artifactId>

106
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAdjustmentLogDTO.java

@ -0,0 +1,106 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
*
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-07-27
*/
@Data
public class PointAdjustmentLogDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String id;
/**
* 关联的积分动作Id
*/
private String actionId;
/**
* 调整人名称xx机关-xx
*/
private String operatorName;
/**
* 调整原因
*/
private String adjustReason;
/**
* 调整积分
*/
private Integer point;
/**
* plus/minus
*/
private String adjustmentType;
/**
* 调整人所属机关Id
*/
private String operatorAgencyId;
/**
* 居民Id
*/
private String userId;
/**
*
*/
private String delFlag;
/**
*
*/
private Integer revision;
/**
*
*/
private Date createdTime;
/**
*
*/
private String createdBy;
/**
*
*/
private Date updatedTime;
/**
*
*/
private String updatedBy;
}

10
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointVerificationLogDTO.java

@ -48,16 +48,6 @@ public class PointVerificationLogDTO implements Serializable {
*/
private String userId;
/**
* 核销对象首次注册网格
*/
private String userRegistedGridId;
/**
* 核销对象首次注册网格所在机关
*/
private String userRegistedAgnecyId;
/**
* 核销人员ID
*/

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

@ -0,0 +1,29 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 用户Id 分页参数
* @ClassName CommonPageUserFormDTO
* @Auth wangc
* @Date 2020-07-24 13:24
*/
@Data
public class CommonPageUserFormDTO implements Serializable {
private static final long serialVersionUID = -6721313124444595189L;
public interface PageUserGroup extends CustomerClientShowGroup{}
@NotBlank(message = "获取不到用户Id" , groups = PageUserGroup.class)
private String userId;
@Min(value = 1)
private Integer pageNo = 1;
private Integer pageSize = 10;
}

56
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointAdjustmentFormDTO.java

@ -0,0 +1,56 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 积分调整传参积分dto
* @ClassName PointAdjustmentFormDTO
* @Auth wangc
* @Date 2020-07-27 13:36
*/
@Data
public class PointAdjustmentFormDTO implements Serializable {
private static final long serialVersionUID = -1879530107301465633L;
public interface PointAdjustmentGroup extends CustomerClientShowGroup{}
/**
* 用户Id
* */
@NotBlank(message = "用户Id不能为空", groups = PointAdjustmentGroup.class)
private String userId;
/**
* 积分调整标识 key:add/minus
* */
@NotBlank(message = "调整类型不能为空", groups = PointAdjustmentGroup.class)
private String adjustmentType;
/**
* 调整的分值
* */
private Integer point;
/**
* 调整原因
* */
@NotBlank(message = "调整原因不能为空", groups = PointAdjustmentGroup.class)
private String reason;
/**
* 操作人Id
* */
@NotBlank(message = "当前工作人员Id不能为空", groups = PointAdjustmentGroup.class)
private String operatorId;
/**
* 客户Id
* */
@NotBlank(message = "客户Id不能为空", groups = PointAdjustmentGroup.class)
private String customerId;
}

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

@ -0,0 +1,53 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 积分核销传参dto
*
* @ClassName PointVerificationFormDTO
* @Auth wangc
* @Date 2020-07-27 13:45
*/
@Data
public class PointVerificationFormDTO implements Serializable {
private static final long serialVersionUID = -154634518066538184L;
public interface PointVerificationGroup extends CustomerClientShowGroup{}
/**
* 用户Id
* */
@NotBlank(message = "用户Id不能为空", groups = PointVerificationGroup.class)
private String userId;
/**
* 核销备注
* */
@NotBlank(message = "核销备注不能为空", groups = PointVerificationGroup.class)
private String remark;
/**
* 核销积分数
* */
@Min(0)
private Integer point;
/**
* 操作人Id
* */
@NotBlank(message = "当前工作人员Id不能为空", groups = PointVerificationGroup.class)
private String operatorId;
private String longitude;
private String dimension;
private String address;
}

4
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/ResiCommonUserIdFormDTO.java

@ -16,8 +16,8 @@ import java.io.Serializable;
public class ResiCommonUserIdFormDTO implements Serializable {
private static final long serialVersionUID = -1961545266124776452L;
public interface UserId extends CustomerClientShowGroup{}
public interface UserIdGroup extends CustomerClientShowGroup{}
@NotBlank(message = "获取不到用户Id",groups = UserId.class)
@NotBlank(message = "获取不到用户Id",groups = UserIdGroup.class)
private String userId;
}

20
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/ResiPointRankFormDTO.java

@ -1,8 +1,10 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
@ -15,19 +17,29 @@ import java.io.Serializable;
public class ResiPointRankFormDTO implements Serializable {
private static final long serialVersionUID = 1534061512200591149L;
public interface ResiPointRankGroup extends CustomerClientShowGroup{}
/**
* 页码
* */
@Min(1)
private Integer pageNo;
@Min(value = 1,groups = ResiPointRankGroup.class)
private Integer pageNo = 1;
/**
* 每页数据条数
* */
private Integer pageSize;
private Integer pageSize = 10;
/**
* 时间维度 week month
* 时间维度 week month 如果为空则按照week处理
* */
private String timeDimension;
@NotBlank(message = "获取不到用户Id",groups = ResiPointRankGroup.class)
private String userId;
/**
* 客户Id不做校验如果前端不传则使用userId查询相应的客户Id
* */
private String customerId;
}

32
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/WorkPointVerificationFormDTO.java

@ -0,0 +1,32 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 工作端核销记录传参
* @ClassName WorkPointVerificationFormDTO
* @Auth wangc
* @Date 2020-07-24 16:25
*/
@Data
public class WorkPointVerificationFormDTO implements Serializable {
private static final long serialVersionUID = -590822390667788693L;
@NotBlank(message = "获取不到用户Id",groups = ResiCommonUserIdFormDTO.UserIdGroup.class)
private String staffId;
/**
* yyyy-MM
* */
private String timeParam;
@Min(1)
private Integer pageNo;
private Integer pageSize;
}

36
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointAdjustmentResultDTO.java

@ -0,0 +1,36 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @ClassName PointAdjustmentResultDTO
* @Auth wangc
* @Date 2020-07-27 09:45
*/
@Data
public class PointAdjustmentResultDTO implements Serializable {
private static final long serialVersionUID = -5339173292750971212L;
/**
* 操作日期
* */
private String date;
/**
* 调整积分
* */
private String point;
/**
* 调整原因
* */
private String reason;
/**
* 调整人昵称
* */
private String staffNickname;
}

2
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointDetailResultDTO.java

@ -19,6 +19,6 @@ public class PointDetailResultDTO implements Serializable {
private Integer point;
private String pointUnit;
private String upLimit;
private String enabledFlag;
private Boolean enabledFlag;
private String upLimitDesc;
}

1
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointRuleResultDTO.java

@ -16,6 +16,7 @@ public class PointRuleResultDTO implements Serializable {
private String ruleId;
private String ruleName;
private String ruleDesc;
private Boolean enabledFlag;
/**
* 拼接好的 积分值/单位
*/

36
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointVerificationResultDTO.java

@ -0,0 +1,36 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 积分核销返参Dto
* @ClassName PointVerificationResultDTO
* @Auth wangc
* @Date 2020-07-27 13:57
*/
@Data
public class PointVerificationResultDTO implements Serializable {
private static final long serialVersionUID = 6990717665110392389L;
/**
* 核销成功标识
* */
private boolean successFlag;
/**
* 失败原因
* */
private String failureReason;
/**
* 用户(居民)昵称
* */
private String userNickname;
/**
* 用户(居民)头像
* */
private String userHeadPhoto;
}

2
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankListResultDTO.java

@ -33,5 +33,5 @@ public class ResiPointRankListResultDTO implements Serializable {
/**
* 积分排名列表
* */
private List<ResiPointRankingResultDTO> rankList;
private ResiPointRankingResultDTO rankList;
}

27
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/WorkPointVerficationListResultDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description 工作端积分核销记录列表
* @ClassName WorkPointVerficationListResultDTO
* @Auth wangc
* @Date 2020-07-24 15:38
*/
@Data
public class WorkPointVerficationListResultDTO implements Serializable {
private static final long serialVersionUID = 2737976236826002595L;
/**
* 当月总积分
* */
private Integer totalPoint;
/**
* 核销列表
* */
List<WorkPointVerificationDetailResultDTO> checkingList;
}

33
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/WorkPointVerificationDetailResultDTO.java

@ -0,0 +1,33 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 工作端积分核销显示记录
* @ClassName WorkPointVerificationDetailResultDTO
* @Auth wangc
* @Date 2020-07-24 15:38
*/
@Data
public class WorkPointVerificationDetailResultDTO implements Serializable {
private static final long serialVersionUID = -205177259417194562L;
/**
* 被核销用户昵称
* */
private String userNickname;
/**
* 核销积分 "-100"
* */
private String point;
/**
* 核销备注
* */
private String remark;
}

38
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/WorkPointVerificationLogResultDTO.java

@ -0,0 +1,38 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 工作端积分核销记录
* @ClassName WorkPointVerificationLogResultDTO
* @Auth wangc
* @Date 2020-07-24 15:38
*/
@Data
public class WorkPointVerificationLogResultDTO implements Serializable {
private static final long serialVersionUID = -3570820382554221450L;
/**
* 积分
* */
private Integer point;
/**
* 用户Id
* */
private String userId;
/**
* 日期 yyyy-MM-dd HH:mm:ss
* */
private String date;
/**
* 核销备注
* */
private String remark;
}

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

@ -1,8 +1,13 @@
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.result.ResiPointDetailResultDTO;
import com.epmet.feign.fallback.EpmetPointOpenFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
/**
* 本服务对外开放的API,其他服务通过引用此client调用该服务
@ -12,4 +17,14 @@ import org.springframework.cloud.openfeign.FeignClient;
*/
@FeignClient(name = ServiceConstant.EPMET_HEART_SERVER, fallback = EpmetPointOpenFeignClientFallback.class)
public interface EpmetPointOpenFeignClient {
/**
* @Description 获取指定居民的积分信息
* @param dto
* @return
* @author wangc
* @date 2020.07.22 15:58
**/
@GetMapping("mypoint")
Result<ResiPointDetailResultDTO> myPoint(TokenDto dto);
}

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

@ -1,5 +1,10 @@
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.result.ResiPointDetailResultDTO;
import com.epmet.feign.EpmetPointOpenFeignClient;
import org.springframework.stereotype.Component;
@ -11,4 +16,8 @@ import org.springframework.stereotype.Component;
*/
@Component
public class EpmetPointOpenFeignClientFallback implements EpmetPointOpenFeignClient {
@Override
public Result<ResiPointDetailResultDTO> myPoint(TokenDto dto) {
return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "myPoint", dto);
}
}

4
epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml

@ -1,8 +1,8 @@
version: "3.7"
services:
oper-crm-server:
epmet-point-server:
container_name: epmet-point-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-point-server:0.0.1
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-point-server:0.0.4
ports:
- "8112:8112"
network_mode: host # 使用现有网络

2
epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-prod.yml

@ -1,6 +1,6 @@
version: "3.7"
services:
oper-crm-server:
epmet-point-server:
container_name: epmet-point-server-prod
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-point-server:0.0.1
ports:

2
epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-test.yml

@ -1,6 +1,6 @@
version: "3.7"
services:
oper-crm-server:
epmet-point-server:
container_name: epmet-point-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-point-server:0.0.1
ports:

4
epmet-module/epmet-point/epmet-point-server/pom.xml

@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.0.1</version>
<version>0.0.4</version>
<parent>
<artifactId>epmet-point</artifactId>
<groupId>com.epmet</groupId>
@ -128,7 +128,7 @@
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>123456</spring.redis.password>
<!-- nacos -->
<nacos.register-enabled>false</nacos.register-enabled>
<nacos.register-enabled>true</nacos.register-enabled>
<nacos.server-addr>122.152.200.70:8848</nacos.server-addr>
<nacos.discovery.namespace>fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b</nacos.discovery.namespace>
<nacos.config.namespace></nacos.config.namespace>

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

@ -1,8 +1,23 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.CustomerUserFormDTO;
import com.epmet.dto.form.IssueInitiatorFormDTO;
import com.epmet.dto.result.CustomerUser4PointResultDTO;
import com.epmet.dto.result.CustomerUserDetailResultDTO;
import com.epmet.dto.result.PointAdjustmentResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.service.PointAdjustmentLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @description: 工作人员积分调整Controller
* @date: Created in 2020-07-20 16:38
@ -11,4 +26,48 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("work/adjustment")
public class AdjustmentController {
@Autowired
EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
PointAdjustmentLogService pointAdjustmentLogService;
/**
* @Description 调整积分时获取用户列表
* @param param
* @return
* @author wangc
* @date 2020.07.27 10:57
**/
@PostMapping("userlist")
public Result<List<CustomerUser4PointResultDTO>> userList(@RequestBody CustomerUserFormDTO param){
ValidatorUtils.validateEntity(param, CustomerUserFormDTO.CustomerIdGroup.class);
return epmetUserOpenFeignClient.customerUserList(param);
}
/**
* @Description 调整积分时获取用户详情
* @param param
* @return
* @author wangc
* @date 2020.07.27 11:15
**/
@PostMapping("userdetail")
public Result<CustomerUserDetailResultDTO> userDetail(@RequestBody IssueInitiatorFormDTO param){
ValidatorUtils.validateEntity(param,IssueInitiatorFormDTO.UserIdGroup.class);
return new Result<CustomerUserDetailResultDTO>().ok(pointAdjustmentLogService.userDetail(param));
}
/**
* @Description 根据UserId获取积分调整记录
* @param param :: getUserId
* @return
* @author wangc
* @date 2020.07.27 10:51
**/
@PostMapping("adjustrecord")
public Result<List<PointAdjustmentResultDTO>> adjustRecord(@RequestBody IssueInitiatorFormDTO param){
ValidatorUtils.validateEntity(param, IssueInitiatorFormDTO.UserIdGroup.class);
return new Result<List<PointAdjustmentResultDTO>>().ok(pointAdjustmentLogService.adjustRecord(param));
}
}

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

@ -11,4 +11,6 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("work/exchange")
public class ExchangeController {
}

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

@ -1,7 +1,24 @@
package com.epmet.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.epmet.commons.tools.annotation.LoginUser;
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.ResiPointRankFormDTO;
import com.epmet.dto.result.ResiPointDetailResultDTO;
import com.epmet.dto.result.ResiPointLogListResultDTO;
import com.epmet.dto.result.ResiPointRankListResultDTO;
import com.epmet.service.PointVerificationLogService;
import com.epmet.service.UserPointActionLogService;
import com.epmet.service.UserPointStatisticalDailyService;
import com.epmet.service.UserPointTotalService;
import com.epmet.utils.ModuleConstant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @description: 居民端积分信息controller
@ -11,4 +28,105 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("resi/point")
public class ResiPointController {
@Autowired
private UserPointTotalService userPointTotalService;
@Autowired
private UserPointStatisticalDailyService userPointStatisticalDailyService;
@Autowired
private PointVerificationLogService pointVerificationLogService;
@Autowired
private UserPointActionLogService pointActionLogService;
/**
* @Description 获取指定居民的积分信息
* @param dto
* @return
* @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));
}
/**
* @Description 获取客户下用户积分排名榜
* @param dto
* @param pointRankFormDTO
* @return
* @author wangc
* @date 2020.07.22 16:13
**/
@PostMapping("rank")
public Result<List<ResiPointRankListResultDTO>> rank(@LoginUser TokenDto dto,@RequestBody ResiPointRankFormDTO pointRankFormDTO){
pointRankFormDTO.setUserId(dto.getUserId());
ValidatorUtils.validateEntity(pointRankFormDTO, ResiPointRankFormDTO.ResiPointRankGroup.class);
return new Result<List<ResiPointRankListResultDTO>>().ok(userPointTotalService.getPointRanking(pointRankFormDTO));
}
/**
* @Description 获取居民端周积分排行榜 还有当前用的信息
* @param dto
* @param pointRankFormDTO
* @return
* @author wangc
* @date 2020.07.21 16:57
**/
@PostMapping("weeklyrank")
public Result<List<ResiPointRankListResultDTO>> weeklyRank(@LoginUser TokenDto dto,@RequestBody ResiPointRankFormDTO pointRankFormDTO){
pointRankFormDTO.setUserId(dto.getUserId());
pointRankFormDTO.setTimeDimension(ModuleConstant.TIME_DIMENSION_WEEK);
ValidatorUtils.validateEntity(pointRankFormDTO, ResiPointRankFormDTO.ResiPointRankGroup.class);
return new Result<List<ResiPointRankListResultDTO>>().ok(userPointStatisticalDailyService.getPointRankWithinTimeZone(pointRankFormDTO));
}
/**
* @Description 获取居民端月积分排行榜 还有当前用的信息
* @param dto
* @param pointRankFormDTO
* @return
* @author wangc
* @date 2020.07.21 16:57
**/
@PostMapping("monthlyrank")
public Result<List<ResiPointRankListResultDTO>> monthlyRank(@LoginUser TokenDto dto,@RequestBody ResiPointRankFormDTO pointRankFormDTO){
pointRankFormDTO.setUserId(dto.getUserId());
pointRankFormDTO.setTimeDimension(ModuleConstant.TIME_DIMENSION_MONTH);
ValidatorUtils.validateEntity(pointRankFormDTO,ResiPointRankFormDTO.ResiPointRankGroup.class);
return new Result<List<ResiPointRankListResultDTO>>().ok(userPointStatisticalDailyService.getPointRankWithinTimeZone(pointRankFormDTO));
}
/**
* @Description 查找指定用户的积分记录
* @param dto
* @param pageUserParam
* @return
* @author wangc
* @date 2020.07.22 14:05
**/
@PostMapping("records")
public Result<List<ResiPointLogListResultDTO>> records(@LoginUser TokenDto dto,@RequestBody CommonPageUserFormDTO pageUserParam){
pageUserParam.setUserId(dto.getUserId());
ValidatorUtils.validateEntity(pageUserParam, CommonPageUserFormDTO.PageUserGroup.class);
return new Result<List<ResiPointLogListResultDTO>>().ok(pointActionLogService.getMyPointRecord(pageUserParam));
}
/**
* @Description 查找指定用户的积分兑换记录
* @param dto
* @param pageUserParam
* @return
* @author wangc
* @date 2020.07.22 14:05
**/
@PostMapping("exchangedrecord")
public Result<List<ResiPointLogListResultDTO>> exchangeRecord(@LoginUser TokenDto dto,@RequestBody CommonPageUserFormDTO pageUserParam){
pageUserParam.setUserId(dto.getUserId());
ValidatorUtils.validateEntity(pageUserParam,CommonPageUserFormDTO.PageUserGroup.class);
return new Result<List<ResiPointLogListResultDTO>>().ok(pointVerificationLogService.getMyExchangeRecord(pageUserParam));
}
}

46
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAdjustmentLogDao.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.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.PointAdjustmentResultDTO;
import com.epmet.entity.PointAdjustmentLogEntity;
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-07-27
*/
@Mapper
public interface PointAdjustmentLogDao extends BaseDao<PointAdjustmentLogEntity> {
/**
* @Description 查询积分调整列表
* @param userId
* @return
* @author wangc
* @date 2020.07.27 10:44
**/
List<PointAdjustmentResultDTO> selectAdjustmentListByUserId(@Param("userId") String userId);
}

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

@ -19,10 +19,12 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.ResiPointLogPeriodResultDTO;
import com.epmet.dto.result.WorkPointVerificationLogResultDTO;
import com.epmet.entity.PointVerificationLogEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
@ -43,4 +45,14 @@ public interface PointVerificationLogDao extends BaseDao<PointVerificationLogEnt
**/
List<ResiPointLogPeriodResultDTO> selectVerificationLog(@Param("userId") String userId);
/**
* @Description 获取工作人员月度核销记录
* @param staffId
* @param startDate
* @param endDate
* @return
* @author wangc
* @date 2020.07.25 13:17
**/
List<WorkPointVerificationLogResultDTO> selectStaffVerificationLog(String staffId, Date startDate, Date endDate);
}

11
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationStatisticalDailyDao.java

@ -20,6 +20,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.PointVerificationStatisticalDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 工作人员核销数据统计
@ -29,5 +30,13 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface PointVerificationStatisticalDailyDao extends BaseDao<PointVerificationStatisticalDailyEntity> {
/**
* @Description 查询指定日期的工作人员核销积分是否存在
* @param createdBy
* @param dateId
* @return
* @author wangc
* @date 2020.07.27 17:37
**/
PointVerificationStatisticalDailyEntity selectIfExisted(@Param("createdBy") String createdBy, @Param("dateId") String dateId);
}

8
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java

@ -45,4 +45,12 @@ public interface UserPointStatisticalDailyDao extends BaseDao<UserPointStatistic
**/
List<ResiPointRankResultDTO> selectPointRankWithinTimeZone(@Param("customerId") String customerId,@Param("dimension") String dimension,@Param("dimensionId") String dimensionId);
/**
* @Description 查询有无指定日期的积分日统计
* @param userId
* @return
* @author wangc
* @date 2020.07.27 16:20
**/
UserPointStatisticalDailyEntity selectIfExisted(@Param("userId") String userId,@Param("dateId") String dateId,@Param("actionFlag")String actionFlag);
}

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

@ -53,4 +53,13 @@ public interface UserPointTotalDao extends BaseDao<UserPointTotalEntity> {
**/
List<ResiPointRankResultDTO> selectUserPointRank(@Param("customerId") String customerId);
/**
* @Description 根据userId查找是否存在数据
* @param userId
* @return
* @author wangc
* @date 2020.07.27 16:51
**/
UserPointTotalEntity selectIfExisted(@Param("userId") String userId);
}

76
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAdjustmentLogEntity.java

@ -0,0 +1,76 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
*
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-07-27
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("point_adjustment_log")
public class PointAdjustmentLogEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 关联的积分动作Id
*/
private String actionId;
/**
* 调整人名称xx机关-xx
*/
private String operatorName;
/**
* 调整原因
*/
private String adjustReason;
/**
* 调整积分
*/
private Integer point;
/**
* plus/minus
*/
private String adjustmentType;
/**
* 调整人所属机关Id
*/
private String operatorAgencyId;
/**
* 居民Id
*/
private String userId;
}

10
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointVerificationLogEntity.java

@ -48,16 +48,6 @@ public class PointVerificationLogEntity extends BaseEpmetEntity {
*/
private String userId;
/**
* 核销对象首次注册网格
*/
private String userRegistedGridId;
/**
* 核销对象首次注册网格所在机关
*/
private String userRegistedAgnecyId;
/**
* 核销人员ID
*/

18
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/redis/PointRedis.java

@ -0,0 +1,18 @@
package com.epmet.redis;
import com.epmet.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @Description 积分缓存相关
* @ClassName PointRedis
* @Auth wangc
* @Date 2020-07-27 17:25
*/
@Component
public class PointRedis {
@Autowired
private RedisUtils redisUtils;
}

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

@ -0,0 +1,126 @@
/**
* 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.PointAdjustmentLogDTO;
import com.epmet.dto.form.IssueInitiatorFormDTO;
import com.epmet.dto.form.PointAdjustmentFormDTO;
import com.epmet.dto.result.CustomerUserDetailResultDTO;
import com.epmet.dto.result.PointAdjustmentResultDTO;
import com.epmet.entity.PointAdjustmentLogEntity;
import java.util.List;
import java.util.Map;
/**
*
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-07-27
*/
public interface PointAdjustmentLogService extends BaseService<PointAdjustmentLogEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<PointAdjustmentLogDTO>
* @author generator
* @date 2020-07-27
*/
PageData<PointAdjustmentLogDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<PointAdjustmentLogDTO>
* @author generator
* @date 2020-07-27
*/
List<PointAdjustmentLogDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return PointAdjustmentLogDTO
* @author generator
* @date 2020-07-27
*/
PointAdjustmentLogDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-07-27
*/
void save(PointAdjustmentLogDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-07-27
*/
void update(PointAdjustmentLogDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-07-27
*/
void delete(String[] ids);
/**
* @Description 根据UserId获取积分调整记录
* @param param :: getUserId
* @return
* @author wangc
* @date 2020.07.27 10:51
**/
List<PointAdjustmentResultDTO> adjustRecord(IssueInitiatorFormDTO param);
/**
* @Description 用户详情
* @param param
* @return
* @author wangc
* @date 2020.07.27 10:57
**/
CustomerUserDetailResultDTO userDetail(IssueInitiatorFormDTO param);
/**
* @Description 积分调整
* @param param
* @return
* @author wangc
* @date 2020.07.27 13:52
**/
void adjustPoint(PointAdjustmentFormDTO param);
}

28
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationLogService.java

@ -20,8 +20,12 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.PointVerificationLogDTO;
import com.epmet.dto.form.ResiCommonUserIdFormDTO;
import com.epmet.dto.form.CommonPageUserFormDTO;
import com.epmet.dto.form.PointVerificationFormDTO;
import com.epmet.dto.form.WorkPointVerificationFormDTO;
import com.epmet.dto.result.PointVerificationResultDTO;
import com.epmet.dto.result.ResiPointLogListResultDTO;
import com.epmet.dto.result.WorkPointVerficationListResultDTO;
import com.epmet.entity.PointVerificationLogEntity;
import java.util.List;
@ -97,10 +101,28 @@ public interface PointVerificationLogService extends BaseService<PointVerificati
/**
* @Description 查找指定用户的积分兑换记录
* @param userId
* @param pageUser
* @return
* @author wangc
* @date 2020.07.22 14:05
**/
List<ResiPointLogListResultDTO> getMyExchangeRecord(ResiCommonUserIdFormDTO userId);
List<ResiPointLogListResultDTO> getMyExchangeRecord(CommonPageUserFormDTO pageUser);
/**
* @Description 获取工作端积分核销记录
* @param verificationParam
* @return
* @author wangc
* @date 2020.07.24 16:08
**/
WorkPointVerficationListResultDTO getStaffVerificationRecordMonthly(WorkPointVerificationFormDTO verificationParam);
/**
* @Description 积分核销
* @param verificationParam
* @return
* @author wangc
* @date 2020.07.27 14:03
**/
PointVerificationResultDTO verifyPoint(PointVerificationFormDTO verificationParam);
}

9
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationStatisticalDailyService.java

@ -92,4 +92,13 @@ public interface PointVerificationStatisticalDailyService extends BaseService<Po
* @date 2020-07-20
*/
void delete(String[] ids);
/**
* @Description 新增或修改积分核销数据
* @param entity
* @return
* @author wangc
* @date 2020.07.27 17:28
**/
void insertOrUpdate(PointVerificationStatisticalDailyEntity entity);
}

7
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java

@ -20,7 +20,7 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.UserPointActionLogDTO;
import com.epmet.dto.form.ResiCommonUserIdFormDTO;
import com.epmet.dto.form.CommonPageUserFormDTO;
import com.epmet.dto.result.ResiPointLogListResultDTO;
import com.epmet.entity.UserPointActionLogEntity;
@ -97,11 +97,12 @@ public interface UserPointActionLogService extends BaseService<UserPointActionLo
/**
* @Description 查找指定用户的积分记录
* @param userId
* @param pageUser
* @return
* @author wangc
* @date 2020.07.22 14:05
**/
List<ResiPointLogListResultDTO> getMyPointRecord(ResiCommonUserIdFormDTO userId);
List<ResiPointLogListResultDTO> getMyPointRecord(CommonPageUserFormDTO pageUser);
}

11
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java

@ -102,5 +102,14 @@ public interface UserPointStatisticalDailyService extends BaseService<UserPointS
* @author wangc
* @date 2020.07.21 16:57
**/
ResiPointRankListResultDTO getPointRankWithinTimeZone(ResiPointRankFormDTO pointRankFormDTO);
List<ResiPointRankListResultDTO> getPointRankWithinTimeZone(ResiPointRankFormDTO pointRankFormDTO);
/**
* @Description 用户积分日统计新增或修改
* @param entity
* @return
* @author wangc
* @date 2020.07.27 16:10
**/
void insertOrUpdate(UserPointStatisticalDailyEntity entity);
}

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

@ -20,6 +20,10 @@ 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.ResiCommonUserIdFormDTO;
import com.epmet.dto.form.ResiPointRankFormDTO;
import com.epmet.dto.result.ResiPointDetailResultDTO;
import com.epmet.dto.result.ResiPointRankListResultDTO;
import com.epmet.entity.UserPointTotalEntity;
import java.util.List;
@ -92,4 +96,31 @@ public interface UserPointTotalService extends BaseService<UserPointTotalEntity>
* @date 2020-07-20
*/
void delete(String[] ids);
/**
* @Description 获取指定居民的积分信息
* @param userId
* @return
* @author wangc
* @date 2020.07.22 15:58
**/
ResiPointDetailResultDTO getMyPoint(ResiCommonUserIdFormDTO userId);
/**
* @Description 获取客户下用户积分排名榜
* @param pointRankFormDTO
* @return
* @author wangc
* @date 2020.07.22 16:13
**/
List<ResiPointRankListResultDTO> getPointRanking(ResiPointRankFormDTO pointRankFormDTO);
/**
* @Description 新增或修改用户总积分记录
* @param entity
* @return
* @author wangc
* @date 2020.07.27 16:45
**/
void insertOrUpdate(UserPointTotalEntity entity);
}

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

@ -0,0 +1,242 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
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.IssueInitiatorFormDTO;
import com.epmet.dto.form.PointAdjustmentFormDTO;
import com.epmet.dto.form.ResiCommonUserIdFormDTO;
import com.epmet.dto.result.CustomerUserDetailResultDTO;
import com.epmet.dto.result.PointAdjustmentResultDTO;
import com.epmet.dto.result.ResiPointDetailResultDTO;
import com.epmet.dto.result.StaffEtAgencyResultDTO;
import com.epmet.entity.PointAdjustmentLogEntity;
import com.epmet.entity.UserPointActionLogEntity;
import com.epmet.entity.UserPointStatisticalDailyEntity;
import com.epmet.entity.UserPointTotalEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.service.PointAdjustmentLogService;
import com.epmet.service.UserPointStatisticalDailyService;
import com.epmet.service.UserPointTotalService;
import com.epmet.utils.DimIdGenerator;
import com.epmet.utils.ModuleConstant;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
*
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-07-27
*/
@Service
public class PointAdjustmentLogServiceImpl extends BaseServiceImpl<PointAdjustmentLogDao, PointAdjustmentLogEntity> implements PointAdjustmentLogService {
@Autowired
EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
UserPointTotalService userPointTotalService;
@Autowired
UserPointActionLogDao userPointActionLogDao;
@Autowired
UserPointStatisticalDailyService userPointStatisticalDailyService;
@Autowired
PointAdjustmentLogDao pointAdjustmentLogDao;
@Override
public PageData<PointAdjustmentLogDTO> page(Map<String, Object> params) {
IPage<PointAdjustmentLogEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, PointAdjustmentLogDTO.class);
}
@Override
public List<PointAdjustmentLogDTO> list(Map<String, Object> params) {
List<PointAdjustmentLogEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, PointAdjustmentLogDTO.class);
}
private QueryWrapper<PointAdjustmentLogEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<PointAdjustmentLogEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public PointAdjustmentLogDTO get(String id) {
PointAdjustmentLogEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, PointAdjustmentLogDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(PointAdjustmentLogDTO dto) {
PointAdjustmentLogEntity entity = ConvertUtils.sourceToTarget(dto, PointAdjustmentLogEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(PointAdjustmentLogDTO dto) {
PointAdjustmentLogEntity entity = ConvertUtils.sourceToTarget(dto, PointAdjustmentLogEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @Description 根据UserId获取积分调整记录
* @param param :: getUserId
* @return
* @author wangc
* @date 2020.07.27 10:51
**/
@Override
public List<PointAdjustmentResultDTO> adjustRecord(IssueInitiatorFormDTO param) {
return baseDao.selectAdjustmentListByUserId(param.getUserId());
}
/**
* @Description 用户详情
* @param param
* @return
* @author wangc
* @date 2020.07.27 10:57
**/
@Override
public CustomerUserDetailResultDTO userDetail(IssueInitiatorFormDTO param) {
Result<CustomerUserDetailResultDTO> detailResult = epmetUserOpenFeignClient.customerUserDetail(param);
if(!detailResult.success()){
throw new RenException(detailResult.getCode());
}
ResiCommonUserIdFormDTO userParam = ConvertUtils.sourceToTarget(param,ResiCommonUserIdFormDTO.class);
ResiPointDetailResultDTO pointDto = userPointTotalService.getMyPoint(userParam);
if(null != detailResult.getData()){
CustomerUserDetailResultDTO result = new CustomerUserDetailResultDTO();
result.setPoint(null != pointDto ? pointDto.getUsablePoint() : NumConstant.ZERO);
}
detailResult.getData().setPoint(null != pointDto ? pointDto.getUsablePoint() : NumConstant.ZERO);
return detailResult.getData();
}
/**
* @Description 积分调整
* @param param
* @return
* @author wangc
* @date 2020.07.27 13:52
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void adjustPoint(PointAdjustmentFormDTO param) {
if(null == param.getPoint()) throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
Date currentTime = new Date();
Integer point = param.getPoint();
if(StringUtils.equals(ModuleConstant.OPERATION_TYPE_MINUS,param.getAdjustmentType())){
if(point > NumConstant.ZERO){
point *= NumConstant.ONE_NEG;
}
}else{
if(point < NumConstant.ZERO){
point *= NumConstant.ONE_NEG;
}
}
//0.工作人员基本信息[agencyId 昵称]
IssueInitiatorFormDTO staffParam = new IssueInitiatorFormDTO();
staffParam.setUserId(param.getOperatorId());
Result<StaffEtAgencyResultDTO> staffResult =
epmetUserOpenFeignClient.staffMsg(staffParam);
String agencyId = ModuleConstant.EMPTY_STR;
String operatorName = ModuleConstant.EMPTY_STR;
if(staffResult.success() && null != staffResult.getData()){
agencyId = staffResult.getData().getAgencyId();
operatorName = staffResult.getData().getNickname();
}
//1.记录用户积分行为记录表
UserPointActionLogEntity userPointActionEntity = new UserPointActionLogEntity();
userPointActionEntity.setUserId(param.getUserId());
userPointActionEntity.setCustomerId(param.getCustomerId());
userPointActionEntity.setActionFlag(param.getAdjustmentType());
userPointActionEntity.setPoint(point);
userPointActionEntity.setEventStatement(param.getReason());
userPointActionEntity.setEventName(ModuleConstant.EVENT_NAME_ADJUSTMENT);
userPointActionEntity.setOperatorAgencyId(agencyId);
userPointActionLogDao.insert(userPointActionEntity);
//2.记录积分调整记录表
PointAdjustmentLogEntity adjustmentEntity = new PointAdjustmentLogEntity();
adjustmentEntity.setActionId(userPointActionEntity.getId());
adjustmentEntity.setOperatorName(operatorName);
adjustmentEntity.setAdjustReason(param.getReason());
adjustmentEntity.setAdjustmentType(param.getAdjustmentType());
adjustmentEntity.setPoint(point);
adjustmentEntity.setOperatorAgencyId(agencyId);
adjustmentEntity.setUserId(param.getUserId());
//此处设置无效,会拦截到当前请求token中的userId,实际与这里的operatorId一致
adjustmentEntity.setCreatedBy(param.getOperatorId());
pointAdjustmentLogDao.insert(adjustmentEntity);
//3.新增或更新用户积分日统计表
DimIdGenerator.DimIdBean dim = DimIdGenerator.getDimIdBean(currentTime);
UserPointStatisticalDailyEntity statistical = ConvertUtils.sourceToTarget(dim,UserPointStatisticalDailyEntity.class);
statistical.setUserId(param.getUserId());
statistical.setActionFlag(param.getAdjustmentType());
statistical.setCustomerId(param.getCustomerId());
statistical.setPointChange(point);
userPointStatisticalDailyService.insertOrUpdate(statistical);
//4.更新用户积分总表
UserPointTotalEntity total = new UserPointTotalEntity();
total.setUserId(param.getUserId());
total.setCustomerId(param.getCustomerId());
//增量
total.setUsedPoint(NumConstant.ZERO);
total.setUsablePoint(point);
total.setTotalPoint(point);
userPointTotalService.insertOrUpdate(total);
}
}

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

@ -115,6 +115,7 @@ public class PointRuleServiceImpl extends BaseServiceImpl<PointRuleDao, PointRul
log.error("list ruleId:{} have not pointUnit or pointNum,pointRule:{}", JSON.toJSONString(pointRuleEntity));
return null;
}
resultDTO.setEnabledFlag(NumConstant.ONE_STR.equals(pointRuleEntity.getEnabledFlag()) ? true : false);
resultDTO.setPointValue(pointRuleEntity.getPoint().toString().concat("分").concat(StrConstant.SEPARATOR).concat(pointUnitEnum.getDesc()));
return resultDTO;
}).filter(fun -> fun != null).collect(Collectors.toList());
@ -129,7 +130,7 @@ public class PointRuleServiceImpl extends BaseServiceImpl<PointRuleDao, PointRul
}
PointDetailResultDTO resultDTO = ConvertUtils.sourceToTarget(pointRuleEntity, PointDetailResultDTO.class);
resultDTO.setRuleId(pointRuleEntity.getId());
resultDTO.setEnabledFlag(NumConstant.ONE_STR.equals(pointRuleEntity.getEnabledFlag()) ? "true" : "false");
resultDTO.setEnabledFlag(NumConstant.ONE_STR.equals(pointRuleEntity.getEnabledFlag()) ? true : false);
return resultDTO;
}

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

@ -20,25 +20,42 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.PointVerificationLogDao;
import com.epmet.dao.UserPointActionLogDao;
import com.epmet.dto.PointVerificationLogDTO;
import com.epmet.dto.form.ResiCommonUserIdFormDTO;
import com.epmet.dto.result.ResiPointLogListResultDTO;
import com.epmet.dto.result.ResiPointLogPeriodResultDTO;
import com.epmet.entity.PointVerificationLogEntity;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.*;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.redis.PointRedis;
import com.epmet.service.PointVerificationLogService;
import com.epmet.service.PointVerificationStatisticalDailyService;
import com.epmet.service.UserPointStatisticalDailyService;
import com.epmet.service.UserPointTotalService;
import com.epmet.utils.DimIdGenerator;
import com.epmet.utils.ModuleConstant;
import com.github.pagehelper.PageHelper;
import com.google.common.collect.Maps;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZoneId;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -50,6 +67,22 @@ import java.util.stream.Collectors;
@Service
public class PointVerificationLogServiceImpl extends BaseServiceImpl<PointVerificationLogDao, PointVerificationLogEntity> implements PointVerificationLogService {
protected final Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private UserPointTotalService userPointTotalService;
@Autowired
private PointVerificationLogDao pointVerificationLogDao;
@Autowired
private PointVerificationStatisticalDailyService pointVerificationStatisticalDailyService;
@Autowired
PointRedis pointRedis;
@Autowired
private UserPointActionLogDao userPointActionLogDao;
@Autowired
private UserPointStatisticalDailyService userPointStatisticalDailyService;
@Override
public PageData<PointVerificationLogDTO> page(Map<String, Object> params) {
IPage<PointVerificationLogEntity> page = baseDao.selectPage(
@ -104,14 +137,15 @@ public class PointVerificationLogServiceImpl extends BaseServiceImpl<PointVerifi
/**
* @Description 查找指定用户的积分兑换记录
* @param userId
* @param pageUser
* @return
* @author wangc
* @date 2020.07.22 14:05
**/
@Override
public List<ResiPointLogListResultDTO> getMyExchangeRecord(ResiCommonUserIdFormDTO userId) {
List<ResiPointLogPeriodResultDTO> logList = baseDao.selectVerificationLog(userId.getUserId());
public List<ResiPointLogListResultDTO> getMyExchangeRecord(CommonPageUserFormDTO pageUser) {
PageHelper.startPage(pageUser.getPageNo(),pageUser.getPageSize());
List<ResiPointLogPeriodResultDTO> logList = baseDao.selectVerificationLog(pageUser.getUserId());
List<ResiPointLogListResultDTO> result = new LinkedList<>();
if(null != logList && !logList.isEmpty()){
Map<String,List<ResiPointLogPeriodResultDTO>> map =
@ -130,4 +164,204 @@ public class PointVerificationLogServiceImpl extends BaseServiceImpl<PointVerifi
return result;
}
/**
* @Description 获取工作端积分核销记录
* @param verificationParam
* @return
* @author wangc
* @date 2020.07.24 16:08
**/
@Override
public WorkPointVerficationListResultDTO getStaffVerificationRecordMonthly(WorkPointVerificationFormDTO verificationParam) {
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN);
if(StringUtils.isNotBlank(verificationParam.getTimeParam()) && verificationParam.getTimeParam().matches(ModuleConstant.MONTH_REG)){
verificationParam.setTimeParam(new StringBuilder(verificationParam.getTimeParam()).append(ModuleConstant.DATE_COMPLEMENT).toString());
}else{
verificationParam.setTimeParam(format.format(new Date()));
}
WorkPointVerficationListResultDTO result = new WorkPointVerficationListResultDTO();
result.setTotalPoint(NumConstant.ZERO);
List<WorkPointVerificationDetailResultDTO> resultObj = new LinkedList<>();
try{
Date date = format.parse(verificationParam.getTimeParam());
List<WorkPointVerificationLogResultDTO> dataList =
baseDao.selectStaffVerificationLog(verificationParam.getStaffId(),getFirstDayDateOfMonth(date),getLastDayOfMonth(date));
result.setTotalPoint(
dataList.stream().mapToInt(o -> o.getPoint()).sum()
);
List<String> userIds = dataList.stream().map(data -> data.getUserId()).collect(Collectors.toList());
Result<List<UserBaseInfoResultDTO>> userInfo =
epmetUserOpenFeignClient.queryUserBaseInfo(userIds);
boolean userRequestCallback = userInfo.success() && null != userInfo.getData() && !userInfo.getData().isEmpty();
for(int i = NumConstant.ZERO ; i < dataList.size() ; i++){
WorkPointVerificationDetailResultDTO o = new WorkPointVerificationDetailResultDTO();
o.setPoint(new StringBuilder("-").append(dataList.get(i).getPoint().toString()).toString());
o.setRemark(dataList.get(i).getRemark());
if(userRequestCallback) {
//如果是陌生人显示微信昵称
o.setUserNickname(userInfo.getData().get(i) == null ? ModuleConstant.EMPTY_STR : (StringUtils.isBlank(userInfo.getData().get(i).getShowName()) ? userInfo.getData().get(i).getNickname() : userInfo.getData().get(i).getShowName()));
}
resultObj.add(o);
}
}catch (Exception e){
logger.error(String.format(ModuleConstant.DATE_TRANSLATION_ERROR,e.getMessage()));
}
result.setCheckingList(resultObj);
return result;
}
/**
* @Description 积分核销
* @param verificationParam
* @return
* @author wangc
* @date 2020.07.27 14:03
**/
@Override
@Transactional(rollbackFor = Exception.class)
public PointVerificationResultDTO verifyPoint(PointVerificationFormDTO verificationParam) {
Date currentTime = new Date();
PointVerificationResultDTO result = new PointVerificationResultDTO();
ResiCommonUserIdFormDTO userId = new ResiCommonUserIdFormDTO();
userId.setUserId(verificationParam.getUserId());
ResiPointDetailResultDTO currentPoint = userPointTotalService.getMyPoint(userId);
if(null == currentPoint || null == currentPoint.getUsablePoint() || currentPoint.getUsablePoint() < verificationParam.getPoint()){
result.setSuccessFlag(false);
result.setFailureReason(ModuleConstant.POINT_NOT_ENOUGH);
return result;
}
IssueInitiatorFormDTO staffId = new IssueInitiatorFormDTO();
staffId.setUserId(verificationParam.getOperatorId());
Result<StaffEtAgencyResultDTO> staffResult =
epmetUserOpenFeignClient.staffMsg(staffId);
//保证积分为负数,因为是积分核销,只有在积分核销日统计和积分核销日志里存储正数
Integer point = verificationParam.getPoint();
if(point > NumConstant.ZERO){
point *= NumConstant.ONE_NEG;
}
String customerId = ModuleConstant.EMPTY_STR;
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();
operatorName = staffResult.getData().getNickname();
agencyId = staffResult.getData().getAgencyId();
}
//1.记录积分行为日志 - 居民端
UserPointActionLogEntity action = new UserPointActionLogEntity();
action.setCreatedBy(verificationParam.getOperatorId());
action.setUserId(verificationParam.getUserId());
action.setActionFlag(ModuleConstant.OPERATION_TYPE_MINUS);
action.setEventName(ModuleConstant.EVENT_NAME_EXCHANGE);
action.setEventStatement(verificationParam.getRemark());
action.setPoint(point);
userPointActionLogDao.insert(action);
//2.记录积分核销日志表
PointVerificationLogEntity verificationLog = new PointVerificationLogEntity();
verificationLog.setActionId(action.getId());
verificationLog.setUserId(verificationParam.getUserId());
verificationLog.setOperatorId(verificationParam.getOperatorId());
verificationLog.setOperatorName(operatorName);
verificationLog.setOperatorAgencyId(agencyId);
verificationLog.setExchangedItem(verificationParam.getRemark());
verificationLog.setPoint(point * NumConstant.ONE_NEG);
verificationLog.setLongitude(verificationParam.getLongitude());
verificationLog.setDimension(verificationParam.getDimension());
verificationLog.setAddress(verificationParam.getAddress());
pointVerificationLogDao.insert(verificationLog);
//3.记录积分日统计表
DimIdGenerator.DimIdBean dim = DimIdGenerator.getDimIdBean(currentTime);
UserPointStatisticalDailyEntity userStatistical = ConvertUtils.sourceToTarget(dim,UserPointStatisticalDailyEntity.class);
userStatistical.setUserId(verificationParam.getUserId());
userStatistical.setActionFlag(ModuleConstant.OPERATION_TYPE_EXCHANGE);
userStatistical.setCustomerId(customerId);
userStatistical.setPointChange(point);
userPointStatisticalDailyService.insertOrUpdate(userStatistical);
//4.记录积分核销日统计 - 政府端
statistical.setVerificatedPoint(point * NumConstant.ONE_NEG);
pointVerificationStatisticalDailyService.insertOrUpdate(statistical);
//5.更新用户总积分表
UserPointTotalEntity userPoint = new UserPointTotalEntity();
userPoint.setUserId(verificationParam.getUserId());
userPoint.setCustomerId(customerId);
//负数
userPoint.setTotalPoint(point);
//负数
userPoint.setUsablePoint(point);
//正数
userPoint.setUsedPoint(point * NumConstant.ONE_NEG);
userPointTotalService.insertOrUpdate(userPoint);
//6.将核销结果记录redis(List) key -> [epmet:point:verification:userId] lpush #新元素插入表头 lindex key 0 #表头
result.setSuccessFlag(true);
List<String> userParam = new LinkedList<>();
userParam.add(verificationParam.getUserId());
Result<List<UserBaseInfoResultDTO>> userResult =
epmetUserOpenFeignClient.queryUserBaseInfo(userParam);
String userHeadPhoto = ModuleConstant.EMPTY_STR;
String userNickname = ModuleConstant.EMPTY_STR;
if(userResult.success() && null != userResult.getData() && !userResult.getData().isEmpty()){
userHeadPhoto = userResult.getData().get(NumConstant.ZERO).getHeadImgUrl();
userNickname = userResult.getData().get(NumConstant.ZERO).getShowName();
}
result.setUserHeadPhoto(userHeadPhoto);
result.setUserNickname(userNickname);
return result;
}
/**
* @Description 得到指定日所在月第一天
* @param date
* @return
* @author wangc
* @date 2020.07.27 17:21
**/
private static Date getFirstDayDateOfMonth(final Date date) {
final Calendar cal = Calendar.getInstance();
cal.setTime(date);
final int last = cal.getActualMinimum(Calendar.DAY_OF_MONTH);
cal.set(Calendar.DAY_OF_MONTH, last);
LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(cal.getTimeInMillis()), ZoneId.systemDefault());
LocalDateTime startOfDay = localDateTime.with(LocalTime.MIN);
return Date.from(startOfDay.atZone(ZoneId.systemDefault()).toInstant());
}
/**
* @Description 得到指定日所在月最后一天
* @param date
* @return
* @author wangc
* @date 2020.07.27 17:21
**/
public static Date getLastDayOfMonth(final Date date) {
final Calendar cal = Calendar.getInstance();
cal.setTime(date);
final int last = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
cal.set(Calendar.DAY_OF_MONTH, last);
LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(cal.getTimeInMillis()), ZoneId.systemDefault());;
LocalDateTime endOfDay = localDateTime.with(LocalTime.MAX);
return Date.from(endOfDay.atZone(ZoneId.systemDefault()).toInstant());
}
}

18
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationStatisticalDailyServiceImpl.java

@ -97,4 +97,22 @@ public class PointVerificationStatisticalDailyServiceImpl extends BaseServiceImp
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @Description 新增或修改积分核销数据
* @param entity
* @return
* @author wangc
* @date 2020.07.27 17:28
**/
@Override
public void insertOrUpdate(PointVerificationStatisticalDailyEntity entity) {
PointVerificationStatisticalDailyEntity existed = baseDao.selectIfExisted(entity.getCreatedBy(),entity.getDateId());
if(null != existed && StringUtils.isNotBlank(existed.getId())){
existed.setVerificatedPoint(null == existed.getVerificatedPoint() ? entity.getVerificatedPoint() : existed.getVerificatedPoint() + entity.getVerificatedPoint());
updateById(existed);
}else{
insert(entity);
}
}
}

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

@ -25,11 +25,12 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.UserPointActionLogDao;
import com.epmet.dto.UserPointActionLogDTO;
import com.epmet.dto.form.ResiCommonUserIdFormDTO;
import com.epmet.dto.form.CommonPageUserFormDTO;
import com.epmet.dto.result.ResiPointLogListResultDTO;
import com.epmet.dto.result.ResiPointLogPeriodResultDTO;
import com.epmet.entity.UserPointActionLogEntity;
import com.epmet.service.UserPointActionLogService;
import com.github.pagehelper.PageHelper;
import com.google.common.collect.Maps;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
@ -102,14 +103,15 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl<UserPointActi
/**
* @Description 查找指定用户的积分记录
* @param userId
* @param pageUser
* @return
* @author wangc
* @date 2020.07.22 14:05
**/
@Override
public List<ResiPointLogListResultDTO> getMyPointRecord(ResiCommonUserIdFormDTO userId) {
List<ResiPointLogPeriodResultDTO> logList = baseDao.selectPointActionLogList(userId.getUserId());
public List<ResiPointLogListResultDTO> getMyPointRecord(CommonPageUserFormDTO pageUser) {
PageHelper.startPage(pageUser.getPageNo(),pageUser.getPageSize());
List<ResiPointLogPeriodResultDTO> logList = baseDao.selectPointActionLogList(pageUser.getUserId());
List<ResiPointLogListResultDTO> result = new LinkedList<>();
if(null != logList && !logList.isEmpty()){
Map<String,List<ResiPointLogPeriodResultDTO>> map =

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

@ -20,23 +20,31 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.UserPointStatisticalDailyDao;
import com.epmet.dto.UserPointStatisticalDailyDTO;
import com.epmet.dto.form.ResiPointRankFormDTO;
import com.epmet.dto.result.ResiPointRankListResultDTO;
import com.epmet.dto.result.ResiPointRankResultDTO;
import com.epmet.dto.result.ResiPointRankingResultDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.entity.UserPointStatisticalDailyEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.service.UserPointStatisticalDailyService;
import com.epmet.utils.DimIdGenerator;
import com.epmet.utils.ModuleConstant;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
* 用户积分统计情况
@ -47,6 +55,8 @@ import java.util.Map;
@Service
public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl<UserPointStatisticalDailyDao, UserPointStatisticalDailyEntity> implements UserPointStatisticalDailyService {
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Override
public PageData<UserPointStatisticalDailyDTO> page(Map<String, Object> params) {
@ -108,13 +118,100 @@ public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl<UserPo
* @date 2020.07.21 16:57
**/
@Override
public ResiPointRankListResultDTO getPointRankWithinTimeZone(ResiPointRankFormDTO pointRankFormDTO) {
//默认查周数据
if(StringUtils.isBlank(pointRankFormDTO.getTimeDimension())) {
pointRankFormDTO.setTimeDimension(ModuleConstant.TIME_ZONE_WEEK);
public List<ResiPointRankListResultDTO> getPointRankWithinTimeZone(ResiPointRankFormDTO pointRankFormDTO) {
List<ResiPointRankListResultDTO> result = new LinkedList<>();
ResiPointRankListResultDTO o = new ResiPointRankListResultDTO();
//需要参数 Id 维度值 维度标识
//1.获取当前用户昵称以及当前用户所属客户Id
List<String> userIdParam = new LinkedList<>();
userIdParam.add(pointRankFormDTO.getUserId());
Result<List<UserBaseInfoResultDTO>> myResiInfoResult =
epmetUserOpenFeignClient.queryUserBaseInfo(userIdParam);
if(myResiInfoResult.success() && null != myResiInfoResult.getData() && !myResiInfoResult.getData().isEmpty()){
if(StringUtils.isBlank(pointRankFormDTO.getCustomerId())) {
//缓存中陌生人游客也有对应的customerId
pointRankFormDTO.setCustomerId(myResiInfoResult.getData().get(NumConstant.ZERO).getCustomerId());
}
//微信昵称
o.setMyNickname(myResiInfoResult.getData().get(NumConstant.ZERO).getNickname());
}
//2.获取维度值
DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(new Date());
String dimVal = StringUtils.equals(ModuleConstant.TIME_ZONE_WEEK,pointRankFormDTO.getTimeDimension()) ? dimIdBean.getWeekId() : dimIdBean.getMonthId();
//3.查询排行榜信息,个人排行(分页)
if(NumConstant.ONE < pointRankFormDTO.getPageNo()){
PageHelper.startPage(pointRankFormDTO.getPageNo(),pointRankFormDTO.getPageSize());
}
List<ResiPointRankResultDTO> rankList =
baseDao.selectPointRankWithinTimeZone(pointRankFormDTO.getCustomerId(),pointRankFormDTO.getTimeDimension(),dimVal);
if(null == rankList || rankList.isEmpty()){
o.setMyPoint(NumConstant.ZERO);
o.setMyRanking(NumConstant.ZERO);
return result;
}
//如果请求的是第一页
if(NumConstant.ONE == pointRankFormDTO.getPageNo()) {
ResiPointRankResultDTO myself =
rankList.stream().filter(obj -> StringUtils.equals(obj.getUserId(), pointRankFormDTO.getUserId())).findFirst().get();
if (null != myself) {
o.setMyPoint(myself.getTotalPoint());
o.setMyRanking(myself.getRank());
} else {
o.setMyPoint(NumConstant.ZERO);
if (rankList.get(rankList.size() - NumConstant.ONE).getTotalPoint() > NumConstant.ZERO) {
o.setMyRanking(rankList.get(rankList.size() - NumConstant.ONE).getRank() + NumConstant.ONE);
} else {
o.setMyRanking(rankList.get(rankList.size() - NumConstant.ONE).getRank());
}
}
int fromIndex = pointRankFormDTO.getPageNo() * pointRankFormDTO.getPageSize();
int toIndex = (pointRankFormDTO.getPageNo() + 1) * pointRankFormDTO.getPageSize();
if(toIndex > rankList.size()) {
toIndex = rankList.size();
}
rankList = rankList.subList(fromIndex,toIndex);
}
List<String> userIds = rankList.stream().map(ResiPointRankResultDTO::getUserId).collect(Collectors.toList());
//查询用户昵称
Result<List<UserBaseInfoResultDTO>> userInfo =
epmetUserOpenFeignClient.queryUserBaseInfo(userIds);
boolean userRequestCallback = userInfo.success() && null != userInfo.getData() && !userInfo.getData().isEmpty();
for (int i = NumConstant.ZERO; i < rankList.size(); i++) {
ResiPointRankListResultDTO resultObj = ConvertUtils.sourceToTarget(o,ResiPointRankListResultDTO.class);
ResiPointRankingResultDTO target = new ResiPointRankingResultDTO();
target.setRanking(rankList.get(i).getRank());
target.setPoint(rankList.get(i).getTotalPoint());
if(userRequestCallback) {
target.setNickname(null == userInfo.getData().get(i) ? "" : userInfo.getData().get(i).getNickname());
}
resultObj.setRankList(target);
result.add(resultObj);
}
return result;
}
return null;
/**
* @Description 用户积分日统计新增或修改
* @param entity
* @return
* @author wangc
* @date 2020.07.27 16:10
**/
@Override
public void insertOrUpdate(UserPointStatisticalDailyEntity entity) {
UserPointStatisticalDailyEntity existed = baseDao.selectIfExisted(entity.getUserId(),entity.getDateId(),entity.getActionFlag());
if(null != existed && StringUtils.isNotBlank(existed.getId())){
existed.setPointChange(null == existed.getPointChange() ? entity.getPointChange() : existed.getPointChange() + entity.getPointChange());
updateById(existed);
}else{
insert(entity);
}
}
}

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

@ -20,20 +20,30 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.UserPointTotalDao;
import com.epmet.dto.UserPointTotalDTO;
import com.epmet.dto.form.ResiCommonUserIdFormDTO;
import com.epmet.dto.form.ResiPointRankFormDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.UserPointTotalEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.service.UserPointTotalService;
import com.epmet.utils.DimIdGenerator;
import com.epmet.utils.ModuleConstant;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
* 用户积分总计
@ -44,6 +54,8 @@ import java.util.Map;
@Service
public class UserPointTotalServiceImpl extends BaseServiceImpl<UserPointTotalDao, UserPointTotalEntity> implements UserPointTotalService {
@Autowired
EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Override
public PageData<UserPointTotalDTO> page(Map<String, Object> params) {
@ -97,4 +109,123 @@ public class UserPointTotalServiceImpl extends BaseServiceImpl<UserPointTotalDao
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @Description 获取指定居民的积分信息
* @param userId
* @return
* @author wangc
* @date 2020.07.22 15:58
**/
@Override
public ResiPointDetailResultDTO getMyPoint(ResiCommonUserIdFormDTO userId) {
return baseDao.selectPointByUserId(userId.getUserId());
}
/**
* @Description 获取客户下用户积分排名榜
* @param pointRankFormDTO
* @return
* @author wangc
* @date 2020.07.22 16:13
**/
@Override
public List<ResiPointRankListResultDTO> getPointRanking(ResiPointRankFormDTO pointRankFormDTO) {
List<ResiPointRankListResultDTO> result = new LinkedList<>();
ResiPointRankListResultDTO o = new ResiPointRankListResultDTO();
//1.获取当前用户昵称以及当前用户所属客户Id
List<String> userIdParam = new LinkedList<>();
userIdParam.add(pointRankFormDTO.getUserId());
Result<List<UserBaseInfoResultDTO>> myResiInfoResult =
epmetUserOpenFeignClient.queryUserBaseInfo(userIdParam);
if(myResiInfoResult.success() && null != myResiInfoResult.getData() && !myResiInfoResult.getData().isEmpty()){
if(StringUtils.isBlank(pointRankFormDTO.getCustomerId())) {
pointRankFormDTO.setCustomerId(myResiInfoResult.getData().get(NumConstant.ZERO).getCustomerId());
}
//微信昵称
o.setMyNickname(myResiInfoResult.getData().get(NumConstant.ZERO).getNickname());
}
//2.查询排行榜信息,个人排行(分页)
if(NumConstant.ONE < pointRankFormDTO.getPageNo()){
PageHelper.startPage(pointRankFormDTO.getPageNo(),pointRankFormDTO.getPageSize());
}
//排行榜
List<ResiPointRankResultDTO> rankList =
baseDao.selectUserPointRank(pointRankFormDTO.getCustomerId());
//当排行榜没有数据时
if(null == rankList || rankList.isEmpty()){
o.setMyPoint(NumConstant.ZERO);
o.setMyRanking(NumConstant.ZERO);
result.add(o);
return result;
}
//如果当前请求不是第一页
if(NumConstant.ONE == pointRankFormDTO.getPageNo()) {
ResiPointRankResultDTO myself =
rankList.stream().filter(obj -> StringUtils.equals(obj.getUserId(), pointRankFormDTO.getUserId())).findFirst().get();
if (null != myself) {
o.setMyPoint(myself.getTotalPoint());
o.setMyRanking(myself.getRank());
} else {
if (rankList.get(rankList.size() - NumConstant.ONE).getTotalPoint() > NumConstant.ZERO) {
o.setMyRanking(rankList.get(rankList.size() - NumConstant.ONE).getRank() + NumConstant.ONE);
} else {
o.setMyRanking(rankList.get(rankList.size() - NumConstant.ONE).getRank());
}
}
int fromIndex = pointRankFormDTO.getPageNo() * pointRankFormDTO.getPageSize();
int toIndex = (pointRankFormDTO.getPageNo() + 1) * pointRankFormDTO.getPageSize();
if(toIndex > rankList.size()) {
toIndex = rankList.size();
}
//将假分页结果替换到rankList
rankList = rankList.subList(fromIndex,toIndex);
}
List<String> userIds = rankList.stream().map(ResiPointRankResultDTO::getUserId).collect(Collectors.toList());
//查询用户昵称
Result<List<UserBaseInfoResultDTO>> userInfo =
epmetUserOpenFeignClient.queryUserBaseInfo(userIds);
boolean userRequestCallback = userInfo.success() && null != userInfo.getData() && !userInfo.getData().isEmpty();
for (int i = NumConstant.ZERO; i < rankList.size(); i++) {
ResiPointRankListResultDTO resultObj = ConvertUtils.sourceToTarget(o,ResiPointRankListResultDTO.class);
ResiPointRankingResultDTO target = new ResiPointRankingResultDTO();
target.setRanking(rankList.get(i).getRank());
target.setPoint(rankList.get(i).getTotalPoint());
if(userRequestCallback) {
target.setNickname(null == userInfo.getData().get(i) ? "" : userInfo.getData().get(i).getNickname());
}
resultObj.setRankList(target);
result.add(resultObj);
}
return result;
}
/**
* @Description 新增或修改用户总积分记录
* @param entity
* @return
* @author wangc
* @date 2020.07.27 16:45
**/
@Override
public void insertOrUpdate(UserPointTotalEntity entity) {
UserPointTotalEntity existed = baseDao.selectIfExisted(entity.getUserId());
if(null != existed && StringUtils.isBlank(existed.getId())){
existed.setUsedPoint(null == existed.getUsedPoint() ? entity.getUsedPoint() : entity.getUsedPoint() + existed.getUsedPoint());
existed.setUsablePoint(null == existed.getUsablePoint() ? entity.getUsablePoint() : entity.getUsablePoint() + existed.getUsablePoint());
existed.setTotalPoint(null == existed.getTotalPoint() ? entity.getTotalPoint() : entity.getTotalPoint() + existed.getTotalPoint());
updateById(existed);
}else{
insert(entity);
}
}
}

91
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/utils/DimIdGenerator.java

@ -0,0 +1,91 @@
package com.epmet.utils;
import com.epmet.commons.tools.utils.DateUtils;
import lombok.Data;
import java.util.Calendar;
import java.util.Date;
public class DimIdGenerator {
/**
* 生成日期维度ID
* @param targetDate
* @return
*/
public static String getDateDimId(Date targetDate) {
return DateUtils.format(targetDate, DateUtils.DATE_PATTERN_YYYYMMDD);
}
/**
* 获取月维度ID
* @param date
* @return
*/
public static String getMonthDimId(Date date) {
return DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMM);
}
/**
* 获取周维度ID ,每周的星期一为 周的开始
* @param date
* @return
*/
public static String getWeekDimId(Date date) {
String yyyy = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYY);
Calendar calendar = Calendar.getInstance();
calendar.setFirstDayOfWeek(Calendar.MONDAY);
calendar.setTime(date);
return yyyy.concat("W").concat(calendar.get(Calendar.WEEK_OF_YEAR)+"");
}
/**
* 获取季度维度ID
* @param date
* @return
*/
public static String getQuarterDimId(Date date) {
String yyyy = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYY);
return yyyy.concat("Q").concat(DateUtils.getQuarterIndex(date) + "");
}
/**
* 获取年维度ID
* @param date
* @return
*/
public static String getYearDimId(Date date) {
return DateUtils.format(date, DateUtils.DATE_PATTERN_YYYY);
}
/**
* 获取封装了所有ID的对象
* @return
*/
public static DimIdBean getDimIdBean(Date date) {
DimIdBean dimIdBean = new DimIdBean();
dimIdBean.setDateId(getDateDimId(date));
dimIdBean.setMonthId(getMonthDimId(date));
dimIdBean.setWeekId(getWeekDimId(date));
dimIdBean.setQuarterId(getQuarterDimId(date));
dimIdBean.setYearId(getYearDimId(date));
return dimIdBean;
}
public static void main(String[] args) {
DimIdBean dimIdBean = getDimIdBean(DateUtils.stringToDate("2020-06-14",DateUtils.DATE_PATTERN));
System.out.println(dimIdBean);
}
@Data
public static class DimIdBean {
private String dateId;
private String monthId;
private String quarterId;
private String yearId;
private String weekId;
public DimIdBean() {
}
}
}

55
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/utils/ModuleConstant.java

@ -20,31 +20,74 @@ public interface ModuleConstant extends Constant {
/**
* 正则表达式 日期 严格按照yyyy-MM-dd格式匹配
* */
*/
String DATE_REG = "^([1-9]\\d{3}-)([0-1][1-9]-)(([0-3]{0,1}[0-9]))$";
/**
* 正则表达式 严格按照yyyyWcc格式匹配
* */
*/
String WEEK_REG = "^([1-9]\\d{3}W)(([0-4][1-9])|50|51|52)";
/**
* 正则表达式 月份 严格按照yyyy-MM格式匹配
* */
*/
String MONTH_REG = "^([1-9]\\d{3}-)(([0][1-9])|10|11|12)";
/**
* 兑换记录标题
* */
*/
String TITLE_EXCHANGE_POINT = "积分兑换";
/**
* 按周排行
* */
*/
String TIME_ZONE_WEEK = "week";
/**
* 按月排行
* */
*/
String TIME_ZONE_MONTH = "month";
/**
* 给传参 yyyy-MM形式补全日期
*/
String DATE_COMPLEMENT = "-01";
/**
* 日期转换格式异常
*/
String DATE_TRANSLATION_ERROR = "日期转换格式异常 -> 【%s】";
/**
* 时间维度
*/
String TIME_DIMENSION_WEEK = "week";
/**
* 时间维度
*/
String TIME_DIMENSION_MONTH = "month";
/**
*
*/
String OPERATION_TYPE_MINUS = "minus";
/**
*
*/
String OPERATION_TYPE_PLUS = "plus";
/**
* 核销
*/
String OPERATION_TYPE_EXCHANGE = "exchange";
String EMPTY_STR = "";
String EVENT_NAME_ADJUSTMENT = "积分调整";
String EVENT_NAME_EXCHANGE = "积分兑换";
String POINT_NOT_ENOUGH = "积分余额不足";
}

43
epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAdjustmentLogDao.xml

@ -0,0 +1,43 @@
<?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.PointAdjustmentLogDao">
<resultMap type="com.epmet.entity.PointAdjustmentLogEntity" id="pointAdjustmentLogMap">
<result property="id" column="ID"/>
<result property="actionId" column="ACTION_ID"/>
<result property="operatorName" column="OPERATOR_NAME"/>
<result property="adjustReason" column="ADJUST_REASON"/>
<result property="point" column="POINT"/>
<result property="adjustmentType" column="ADJUSTMENT_TYPE"/>
<result property="operatorAgencyId" column="OPERATOR_AGENCY_ID"/>
<result property="userId" column="USER_ID"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
</resultMap>
<!-- 查询积分调整记录 -->
<select id="selectAdjustmentListByUserId" resultType="com.epmet.dto.result.PointAdjustmentResultDTO">
SELECT
operator_name AS staffNickname,
adjust_reason AS reason,
DATE_FORMAT( created_time, '%Y-%m-%d %H:%i:%s' ) AS date,
CASE
action_flag
WHEN 'plus' THEN
CONCAT( '+', POINT ) ELSE CONCAT( '-', POINT )
END AS POINT
FROM
point_adjustment_log
WHERE
del_flag = '0'
AND user_id = #{userId}
ORDER BY
created_time DESC
</select>
</mapper>

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

@ -7,8 +7,6 @@
<result property="id" column="ID"/>
<result property="actionId" column="ACTION_ID"/>
<result property="userId" column="USER_ID"/>
<result property="userRegistedGridId" column="USER_REGISTED_GRID_ID"/>
<result property="userRegistedAgnecyId" column="USER_REGISTED_AGNECY_ID"/>
<result property="operatorId" column="OPERATOR_ID"/>
<result property="operatorName" column="OPERATOR_NAME"/>
<result property="operatorAgencyId" column="OPERATOR_AGENCY_ID"/>
@ -42,4 +40,22 @@
ORDER BY
CREATED_TIME DESC
</select>
<!-- 获取工作人员月度核销记录 -->
<select id="selectStaffVerificationLog" resultType="com.epmet.dto.result.WorkPointVerificationLogResultDTO">
SELECT
user_id,
exchanged_item AS remark,
point,
DATE_FORMAT(created_time,'%Y-%m-%d %H:%i:%s') AS date
FROM
point_verification_log
WHERE
del_flag = '0'
AND operator_id = #{staffId}
AND created_time &gt; #{startDate}
AND created_time &lt; #{endDate}
ORDER BY
created_time DESC
</select>
</mapper>

14
epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointVerificationStatisticalDailyDao.xml

@ -23,5 +23,19 @@
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<!-- 查询指定日期的工作人员核销积分是否存在 -->
<select id="selectIfExisted" resultType="com.epmet.entity.PointVerificationStatisticalDailyEntity">
SELECT
ID,
VERIFICATED_POINT
FROM
point_verification_statistical_daily
WHERE
del_flag = '0'
AND
date_id = #{dateId}
AND
created_by = #{createdBy}
</select>
</mapper>

20
epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml

@ -23,12 +23,14 @@
</resultMap>
<!-- 查询客户下周/月度用户积分排行榜 传参:客户Id | 维度 | 维度值 -->
<!-- user_point_statistical_daily中的action_flag有三种key值,plus(获取),exchange(积分兑换),minus(调整、惩罚),当action_flag为minus时,point_change为负值,其余均为正数 -->
<select id="selectPointRankWithinTimeZone" resultType="com.epmet.dto.result.ResiPointRankResultDTO">
SELECT
IF
( @point > point.TOTAL_POINT, @rank := @rank + 1, @rank := @rank + 0 ) AS rank,
point.user_id,
point.TOTAL_POINT,
-- CASE WHEN point.TOTAL_POINT <![CDATA[>=]]> 0 THEN point.TOTAL_POINT ELSE 0 END AS totalPoint,
@point := point.TOTAL_POINT
FROM
(
@ -47,6 +49,8 @@
AND MONTH_ID = #{dimensionId}
</if>
AND ACTION_FLAG = 'plus'
OR ACTION_FLAG = 'minus'
GROUP BY
USER_ID
ORDER BY
@ -55,5 +59,21 @@
( SELECT @point := NULL, @rank := 1 ) a
</select>
<!-- 查询有无指定日期的积分日统计 userId dateId actionFlag-->
<select id="selectIfExisted" resultType="com.epmet.entity.UserPointStatisticalDailyEntity" >
SELECT
id,
point_change
FROM
user_point_statistical_daily
WHERE
del_flag = '0'
AND
user_id = #{userId}
AND
date_id = #{dateId}
AND
action_flag = #{actionFlag}
</select>
</mapper>

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

@ -44,4 +44,19 @@
( SELECT @point := NULL, @rank := 1 ) a
</select>
<!-- 根据userId查找是否存在数据 -->
<select id="selectIfExisted" resultType="com.epmet.entity.UserPointTotalEntity">
SELECT
ID,
USERD_POINT,
USABLE_POINT,
TOTAL_POINT
FROM
user_point_total
WHERE
del_flag = '0'
AND
user_id = #{userId}
</select>
</mapper>

2
epmet-module/epmet-point/pom.xml

@ -15,8 +15,8 @@
<packaging>pom</packaging>
<modules>
<module>epmet-point-server</module>
<module>epmet-point-client</module>
<module>epmet-point-server</module>
</modules>
</project>

2
epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-third-server:
container_name: epmet-third-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.64
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.67
ports:
- "8110:8110"
network_mode: host # 使用现有网络

2
epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-third-server:
container_name: epmet-third-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-third-server:0.0.58
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-third-server:0.0.65
ports:
- "8110:8110"
network_mode: host # 使用现有网络

2
epmet-module/epmet-third/epmet-third-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.0.64</version>
<version>0.0.67</version>
<parent>
<groupId>com.epmet</groupId>

13
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java

@ -1,9 +1,7 @@
package com.epmet.service.impl;
import cn.hutool.core.convert.Convert;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.nacos.client.config.utils.IOUtils;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
@ -13,6 +11,7 @@ import com.epmet.constant.ModuleConstant;
import com.epmet.constant.ThirdRedisKeyConstant;
import com.epmet.constant.ThirdRunTimeInfoConstant;
import com.epmet.dao.*;
import com.epmet.dto.PaCustomerUserAgencyDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.EpmetUserOpenFeignClient;
@ -81,6 +80,8 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private AuthResultRecordDao authResultRecordDao;
@Autowired
private PaCustomerUserAgencyDao paCustomerUserAgencyDao;
@Value("${third.platform.appId}")
private String componentAppId;
@ -652,10 +653,12 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
* @author zxc
*/
public String getLoginUserCustomerId(TokenDto tokenDto){
LoginUserDetailsFormDTO dto = new LoginUserDetailsFormDTO();
/*LoginUserDetailsFormDTO dto = new LoginUserDetailsFormDTO();
BeanUtils.copyProperties(tokenDto,dto);
LoginUserDetailsResultDTO data = epmetUserOpenFeignClient.getLoginUserDetails(dto).getData();
return data.getCustomerId();
LoginUserDetailsResultDTO data = epmetUserOpenFeignClient.getLoginUserDetails(dto).getData();*/
PaCustomerUserAgencyDTO result = paCustomerUserAgencyDao.selectByUserId(tokenDto.getUserId());
// return data.getCustomerId();
return result.getCustomerId();
}
/**

10
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -5,6 +5,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerPartyBranchDTO;
import com.epmet.dto.form.AddAgencyAndStaffFormDTO;
import com.epmet.dto.form.BelongGridNameFormDTO;
import com.epmet.dto.form.ListPartyBranchFormDTO;
import com.epmet.dto.result.*;
import com.epmet.feign.fallback.GovOrgOpenFeignClientFallback;
@ -166,4 +167,13 @@ public interface GovOrgOpenFeignClient {
**/
@PostMapping("/gov/org/customeragency/querysponsorlist/{staffId}")
Result<ActSponsorResultDTO> querySponsorList(@PathVariable("staffId") String staffId);
/**
*
* @Description 根据网格id查询网格名称
* @Author zxc
* @CreatedTime 2020/4/27 9:22
*/
@PostMapping("/gov/org/customergrid/getgridnamebygridid")
Result<BelongGridNameResultDTO> getGridNameByGridId(@RequestBody BelongGridNameFormDTO formDTO);
}

6
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -6,6 +6,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerPartyBranchDTO;
import com.epmet.dto.form.AddAgencyAndStaffFormDTO;
import com.epmet.dto.form.BelongGridNameFormDTO;
import com.epmet.dto.form.ListPartyBranchFormDTO;
import com.epmet.dto.result.*;
import com.epmet.feign.GovOrgOpenFeignClient;
@ -102,4 +103,9 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
public Result<ActSponsorResultDTO> querySponsorList(String staffId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "querySponsorList", staffId);
}
@Override
public Result<BelongGridNameResultDTO> getGridNameByGridId(BelongGridNameFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridNameByGridId", formDTO);
}
}

2
epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
gov-voice-server:
container_name: gov-voice-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/gov-voice-server:0.3.60
image: 192.168.1.130:10080/epmet-cloud-dev/gov-voice-server:0.3.62
ports:
- "8105:8105"
network_mode: host # 使用现有网络

2
epmet-module/gov-voice/gov-voice-server/pom.xml

@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.60</version>
<version>0.3.62</version>
<parent>
<artifactId>gov-voice</artifactId>
<groupId>com.epmet</groupId>

3
epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml

@ -143,8 +143,7 @@
TITLE AS "title",
IFNULL(PREVIEW_CONTENT, "") AS "content",
UNIX_TIMESTAMP(CREATED_TIME) AS "createdTime",
AUDIT_STATUS,
AUDIT_REASON
STATUS_FLAG AS auditStatus
FROM draft
WHERE DEL_FLAG = '0'
AND (STATUS_FLAG = 'unpublish' OR STATUS_FLAG = 'auditfail')

55
epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerAppRedisDTO.java

@ -0,0 +1,55 @@
/**
* 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 lombok.Data;
import java.io.Serializable;
/**
* 客户表 app redis 缓存对象
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-07-27
*/
@Data
public class CustomerAppRedisDTO implements Serializable {
private static final long serialVersionUID = -1619187268905620766L;
/**
* 客户Id
*/
private String customerId;
/**
* 小程序的appId
*/
private String appId;
/**
* resiwork
*/
private String client;
/**
* app的secret
*/
private String secret;
}

2
epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
oper-crm-server:
container_name: oper-crm-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/oper-crm-server:0.3.54
image: 192.168.1.130:10080/epmet-cloud-dev/oper-crm-server:0.3.55
ports:
- "8090:8090"
network_mode: host # 使用现有网络

2
epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-prod.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
oper-crm-server:
container_name: oper-crm-server-prod
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/oper-crm-server:0.3.54
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/oper-crm-server:0.3.55
ports:
- "8090:8090"
network_mode: host # 使用现有网络

2
epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
oper-crm-server:
container_name: oper-crm-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/oper-crm-server:0.3.54
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/oper-crm-server:0.3.55
ports:
- "8090:8090"
network_mode: host # 使用现有网络

2
epmet-module/oper-crm/oper-crm-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.54</version>
<version>0.3.55</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>oper-crm</artifactId>

6
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerAppController.java

@ -25,7 +25,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.CustomerAppDTO;
import com.epmet.dto.form.CustomerAppSecretFormDTO;
import com.epmet.service.CustomerAppIdService;
import com.epmet.service.CustomerAppService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -42,9 +42,9 @@ import java.util.Map;
@RestController
@RequestMapping("customerapp")
public class CustomerAppController {
@Autowired
private CustomerAppIdService customerAppIdService;
private CustomerAppService customerAppIdService;
@GetMapping("page")
public Result<PageData<CustomerAppDTO>> page(@RequestParam Map<String, Object> params){

2
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerAppIdService.java → epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerAppService.java

@ -31,7 +31,7 @@ import java.util.Map;
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-07-27
*/
public interface CustomerAppIdService extends BaseService<CustomerAppEntity> {
public interface CustomerAppService extends BaseService<CustomerAppEntity> {
/**
* 默认分页

33
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerAppIdServiceImpl.java → epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerAppServiceImpl.java

@ -22,26 +22,53 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.CustomerAppDao;
import com.epmet.dto.CustomerAppDTO;
import com.epmet.dto.CustomerAppRedisDTO;
import com.epmet.entity.CustomerAppEntity;
import com.epmet.service.CustomerAppIdService;
import com.epmet.service.CustomerAppService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.SetOperations;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.PostConstruct;
import java.util.List;
import java.util.Map;
/**
* 客户表 appId
* 客户表 app表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-07-27
*/
@Slf4j
@Service
public class CustomerAppIdServiceImpl extends BaseServiceImpl<CustomerAppDao, CustomerAppEntity> implements CustomerAppIdService {
public class CustomerAppServiceImpl extends BaseServiceImpl<CustomerAppDao, CustomerAppEntity> implements CustomerAppService {
@Autowired
private RedisTemplate redisTemplate;
@PostConstruct
private void initApp2Redis() {
SetOperations<String, CustomerAppRedisDTO> appSet = redisTemplate.opsForSet();
List<CustomerAppDTO> configAllApp = this.getConfigAllApp();
if (!CollectionUtils.isEmpty(configAllApp)) {
String appKey = RedisKeys.getCustomerAppKey();
List<CustomerAppRedisDTO> redisDTOS = ConvertUtils.sourceToTarget(configAllApp, CustomerAppRedisDTO.class);
if (CollectionUtils.isEmpty(redisDTOS)) {
log.error("initApp2Redis fail,convert return null");
return;
}
redisDTOS.forEach(app -> appSet.add(appKey, app));
log.info("initApp2Redis success");
}
}
@Override
public PageData<CustomerAppDTO> page(Map<String, Object> params) {

4
epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyResiUserInfoResultDTO.java

@ -42,5 +42,9 @@ public class MyResiUserInfoResultDTO implements Serializable {
* 拥有角色名称列表可为空[]
* */
private List<String> roleList;
/**
* 累计积分
* */
private Integer point;
}

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

@ -12,13 +12,11 @@ import com.epmet.constant.PartyMemberConstant;
import com.epmet.constant.PartyMemberMessageConstant;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.SmsTemplateConstant;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.CustomerStaffGridDTO;
import com.epmet.dto.UserResiInfoDTO;
import com.epmet.dto.UserRoleDTO;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.modules.feign.EpmetUserFeignClient;
import com.epmet.modules.feign.GovOrgFeignClient;
import com.epmet.modules.feign.ResiGroupFeignClient;
@ -91,6 +89,8 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
private ResiGroupFeignClient resiGroupFeignClient;
@Autowired
private PartymemberAuthRecordService partymemberAuthRecordService;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Override
@Transactional(rollbackFor = Exception.class)
@ -266,6 +266,16 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
//判断是否已注册居民,如果没有则注册居民
isResiRegister(partyMemberInfoDTO);
//将身份证号更新到用户基础信息表中
UserBaseInfoDTO baseInfo = new UserBaseInfoDTO();
baseInfo.setUserId(partyMemberInfoDTO.getUserId());
baseInfo.setIdNum(partyMemberInfoDTO.getIdCard());
baseInfo.setBuildingAddress(partyMemberInfoDTO.getBuilding());
baseInfo.setStreet(partyMemberInfoDTO.getStreet());
baseInfo.setSurname(partyMemberInfoDTO.getSurname());
baseInfo.setName(partyMemberInfoDTO.getName());
epmetUserOpenFeignClient.saveUserBaseInfo(baseInfo);
return result;
}

34
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerUserFormDTO.java

@ -0,0 +1,34 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 查询一个客户下所有用户包括陌生人
* @ClassName CustomerUserFormDTO
* @Auth wangc
* @Date 2020-07-25 15:38
*/
@Data
public class CustomerUserFormDTO implements Serializable {
private static final long serialVersionUID = -8209934663808878617L;
public interface CustomerIdGroup extends CustomerClientShowGroup{}
@NotBlank(message = "客户Id不能为空", groups = CustomerIdGroup.class)
private String customerId;
/**
* 查询参数全名
* */
private String name;
@Min(1)
private Integer pageNo = 1;
private Integer pageSize = 20;
}

5
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IssueInitiatorFormDTO.java

@ -1,7 +1,9 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
@ -14,9 +16,12 @@ public class IssueInitiatorFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
public interface UserIdGroup extends CustomerClientShowGroup{}
/**
* 话题id
*/
@NotBlank(message = "用户Id不能为空",groups = UserIdGroup.class)
private String userId;

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

Loading…
Cancel
Save