Browse Source

Merge remote-tracking branch 'remotes/origin/dev' into release

master
jianjun 5 years ago
parent
commit
0b9fb8e306
  1. 2
      epmet-auth/deploy/docker-compose-dev.yml
  2. 2
      epmet-auth/pom.xml
  3. 21
      epmet-auth/src/main/java/com/epmet/service/impl/PublicUserLoginServiceImpl.java
  4. 8
      epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java
  5. 6
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  6. 6
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java
  7. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ConvertUtils.java
  8. 2
      epmet-gateway/deploy/docker-compose-dev.yml
  9. 2
      epmet-gateway/pom.xml
  10. 2
      epmet-gateway/src/main/resources/bootstrap.yml
  11. 17
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditingUserDetailResultDTO.java
  12. 16
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserHistoricalActResultDTO.java
  13. 2
      epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml
  14. 2
      epmet-module/epmet-heart/epmet-heart-server/pom.xml
  15. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java
  16. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java
  17. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSummaryDao.java
  18. 33
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/UserKindnessTimeLogDao.java
  19. 56
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/UserKindnessTimeLogEntity.java
  20. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSummaryService.java
  21. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSummaryServiceImpl.java
  22. 16
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java
  23. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartUserInfoServiceImpl.java
  24. 25
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java
  25. 97
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
  26. 109
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java
  27. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml
  28. 34
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/epmet_heart.sql
  29. 45
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml
  30. 1
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActLiveRecDao.xml
  31. 20
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/UserKindnessTimeLogDao.xml
  32. 37
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointExchangeResponseResultDTO.java
  33. 10
      epmet-module/epmet-point/epmet-point-client/src/main/java/dto/form/SendPointFormDTO.java
  34. 2
      epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml
  35. 2
      epmet-module/epmet-point/epmet-point-server/pom.xml
  36. 2
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/MqSubcribeConfig.java
  37. 33
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/MqPointCallbackController.java
  38. 4
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointRuleController.java
  39. 13
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java
  40. 3
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDao.java
  41. 8
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java
  42. 15
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/redis/PointRedis.java
  43. 10
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRuleService.java
  44. 10
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationLogService.java
  45. 11
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java
  46. 13
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java
  47. 39
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java
  48. 185
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java
  49. 2
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/utils/ModuleConstant.java
  50. 7
      epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml
  51. 5
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAdjustmentLogDao.xml
  52. 10
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRuleDao.xml
  53. 20
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml
  54. 5
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeCustomerDTO.java
  55. 4
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/UploadListFormDTO.java
  56. 6
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CustomerUserResultDTO.java
  57. 6
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/InitCustomerResultDTO.java
  58. 2
      epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml
  59. 2
      epmet-module/epmet-third/epmet-third-server/pom.xml
  60. 9
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AppLetAuthorizationController.java
  61. 7
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/BusinessInfoDao.java
  62. 4
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeCustomerDao.java
  63. 7
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniCategoryInfoDao.java
  64. 7
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniInfoDao.java
  65. 7
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniNetworkInfoDao.java
  66. 5
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeCustomerEntity.java
  67. 2
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/AppLetAuthorizationService.java
  68. 2
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeCustomerService.java
  69. 6
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/AppLetAuthorizationServiceImpl.java
  70. 4
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeCustomerServiceImpl.java
  71. 3
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java
  72. 7
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java
  73. 2
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaCustomerServiceImpl.java
  74. 2
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java
  75. 3
      epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.3__thirdUpdate.sql
  76. 11
      epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/BusinessInfoDao.xml
  77. 3
      epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeCustomerDao.xml
  78. 2
      epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CustomerMpDao.xml
  79. 11
      epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniCategoryInfoDao.xml
  80. 13
      epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniInfoDao.xml
  81. 11
      epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniNetworkInfoDao.xml
  82. 2
      epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-dev.yml
  83. 2
      epmet-module/oper-crm/oper-crm-server/pom.xml
  84. 11
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java
  85. 1
      epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/addCutomerApp.sql
  86. 2
      epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-dev.yml
  87. 2
      epmet-module/resi-mine/resi-mine-server/pom.xml
  88. 2
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/controller/MineController.java
  89. 116
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiVolunteerAuthenticateFormDTO.java
  90. 10
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  91. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  92. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java
  93. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java
  94. 30
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java
  95. 2
      epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml

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.59
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.65
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.59</version>
<version>0.3.65</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-cloud</artifactId>

21
epmet-auth/src/main/java/com/epmet/service/impl/PublicUserLoginServiceImpl.java

@ -171,13 +171,14 @@ public class PublicUserLoginServiceImpl implements PublicUserLoginService {
}
Object RegisterResult = result.getData();
JSONObject jsonObject = JSON.parseObject(RegisterResult.toString());
CustomerUserResultDTO resultDTO = ConvertUtils.mapToEntity(jsonObject, CustomerUserResultDTO.class);
Map<String,Object> map = (Map)jsonObject.get("paUserResult");
PaUserDTO userDTO = ConvertUtils.mapToEntity(map, PaUserDTO.class);
//登陆
if (formDTO.getIsLogon() && null == resultDTO.getPaUserResult()) {
if (formDTO.getIsLogon() && null == userDTO) {
throw new RenException(EpmetErrorCode.PUBLIC_NOT_EXISTS.getCode());
}
//注册
if (!formDTO.getIsLogon() && null != resultDTO.getPaUserResult()) {
if (!formDTO.getIsLogon() && null != userDTO) {
throw new RenException(EpmetErrorCode.MOBILE_USED.getCode());
}
//3、发送短信验证码
@ -216,10 +217,12 @@ public class PublicUserLoginServiceImpl implements PublicUserLoginService {
}
Object RegisterResult = result.getData();
JSONObject jsonObject = JSON.parseObject(RegisterResult.toString());
CustomerUserResultDTO resultDTO = ConvertUtils.mapToEntity(jsonObject, CustomerUserResultDTO.class);
//2.用户不存在时不允许登陆
PaUserDTO userDTO = resultDTO.getPaUserResult();
Map<String,Object> map1 = (Map)jsonObject.get("paUserResult");
PaUserDTO userDTO = ConvertUtils.mapToEntity(map1, PaUserDTO.class);
logger.info("map1的值:"+map1);
logger.info("userDTO的值:"+userDTO);
if (null == userDTO || StringUtils.isBlank(userDTO.getId())) {
throw new RenException(EpmetErrorCode.PUBLIC_NOT_EXISTS.getCode());
}
@ -236,13 +239,17 @@ public class PublicUserLoginServiceImpl implements PublicUserLoginService {
//4-1.生成token
String token = this.generateGovWxmpToken(userDTO.getId());
//4-2.判断是否存在信息,给customerId赋值
PaCustomerDTO customerDTO = resultDTO.getPaCustomerResult();
Map<String,Object> map2 = (Map)jsonObject.get("paCustomerResult");
logger.info("map2的值:"+map2);
PaCustomerDTO customerDTO = ConvertUtils.mapToEntity(map2, PaCustomerDTO.class);
String customerId = "";
if (null != customerDTO && !StringUtils.isBlank(customerDTO.getId())) {
customerId = customerDTO.getId();
}
//4-3.token存入redis
PaUserWechatDTO wechatDTO = resultDTO.getPaUserWechatResult();
Map<String,Object> map3 = (Map)jsonObject.get("paUserWechatResult");
logger.info("map3的值:"+map3);
PaUserWechatDTO wechatDTO = ConvertUtils.mapToEntity(map3, PaUserWechatDTO.class);
String openid = wechatDTO.getWxOpenId();
String unionId = (null == wechatDTO.getUnionId() ? "" : wechatDTO.getUnionId());
this.saveLatestGovTokenDto(customerId, userDTO.getId(), openid, unionId, token);

8
epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java

@ -507,6 +507,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService {
public PaCustomerDTO getCustomerInfo(String appId){
JSONObject jsonObject = new JSONObject();
String data = HttpClientManager.getInstance().sendPostByJSON(AuthHttpUrlConstant.CUSTOMER_MSG_URL + appId, JSON.toJSONString(jsonObject)).getData();
logger.info("ThirdLoginServiceImpl.getCustomerInfo:httpclient->url:"+AuthHttpUrlConstant.CUSTOMER_MSG_URL+",结果->"+data);
JSONObject toResult = JSON.parseObject(data);
Result mapToResult = ConvertUtils.mapToEntity(toResult, Result.class);
if (!mapToResult.success()) {
@ -515,8 +516,9 @@ public class ThirdLoginServiceImpl implements ThirdLoginService {
}
Object PublicCustomerResultDTO = mapToResult.getData();
JSONObject json = JSON.parseObject(PublicCustomerResultDTO.toString());
PublicCustomerResultDTO publicCustomerResultDTO = ConvertUtils.mapToEntity(json, PublicCustomerResultDTO.class);
PaCustomerDTO customer = publicCustomerResultDTO.getCustomer();
Map<String,Object> map = (Map)json.get("customer");
PaCustomerDTO customer = ConvertUtils.mapToEntity(map, PaCustomerDTO.class);
logger.info("小程序登陆third服务获取客户用户信息PaCustomerDTO->"+customer);
return customer;
}
@ -527,6 +529,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService {
*/
public UserWechatDTO getUserWeChat(WxLoginFormDTO resiLoginFormDTO){
String data = HttpClientManager.getInstance().sendPostByJSON(AuthHttpUrlConstant.RESI_AND_WORK_LOGIN_URL, JSON.toJSONString(resiLoginFormDTO)).getData();
logger.info("ThirdLoginServiceImpl.getUserWeChat:httpclient->url:"+AuthHttpUrlConstant.RESI_AND_WORK_LOGIN_URL+",结果->"+data);
JSONObject toResult = JSON.parseObject(data);
Result mapToResult = ConvertUtils.mapToEntity(toResult, Result.class);
if (!mapToResult.success()) {
@ -536,6 +539,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService {
Object UserWeChatDTO = mapToResult.getData();
JSONObject json = JSON.parseObject(UserWeChatDTO.toString());
UserWechatDTO userWechatDTO = ConvertUtils.mapToEntity(json, UserWechatDTO.class);
logger.info("小程序登陆third服务获取微信用户信息userWechatDTO->"+userWechatDTO);
return userWechatDTO;
}

6
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java

@ -271,4 +271,10 @@ public class RedisKeys {
return rootPrefix.concat("oper:user:shorId:").concat(shortUserId);
}
/**
* 居民端积分核销结果
* */
public static String getPointVerificationResultKey(String userId){
return rootPrefix.concat("resi:point:exchange:").concat(userId);
}
}

6
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java

@ -171,6 +171,10 @@ public class RedisUtils {
}
}
public Object lindex(String key,Long index){
return redisTemplate.opsForList().index(key,index);
}
public Object rightPop(String key) {
return redisTemplate.opsForList().rightPop(key);
}
@ -190,7 +194,7 @@ public class RedisUtils {
}
public String getString(String key) {
return getString(key, DEFAULT_EXPIRE);
return stringRedisTemplate.opsForValue().get(key);
}
/**

3
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ConvertUtils.java

@ -62,6 +62,9 @@ public class ConvertUtils {
}
public static <T> T mapToEntity(Map<String, Object> map, Class<T> entity) {
if (null == map){
return null;
}
T t = null;
try {
t = entity.newInstance();

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

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-gateway-server:
container_name: epmet-gateway-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:0.3.28
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:0.3.29
ports:
- "8080:8080"
network_mode: host # 使用现有网络

2
epmet-gateway/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.28</version>
<version>0.3.29</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-cloud</artifactId>

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

@ -353,8 +353,6 @@ renren:
- /resi/group/**
- /resi/partymember/**
- /gov/grid/**
- /heart/**
- /point/**
management:
endpoints:
web:

17
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditingUserDetailResultDTO.java

@ -1,6 +1,7 @@
package com.epmet.dto.result.work;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
@ -65,22 +66,6 @@ public class AuditingUserDetailResultDTO implements Serializable {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date signUpTime;
/**
* 返回文本已拒绝5次
*/
private String refusedCountDesc;
/**
* 最近一次拒绝原因
*/
private String latestRefusedReason;
/**
* 最近一次拒绝的时间yyyy-MM-dd HH:mm:ss
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date latestAuditTime;
/**
* 历史活动情况
*/

16
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserHistoricalActResultDTO.java

@ -1,12 +1,15 @@
package com.epmet.dto.result.work;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* 描述一下
* 报名审核-人员历史活动情况 返参DTO
*
* @author yinzuomei@elink-cn.com
* @date 2020/7/23 16:15
@ -51,4 +54,15 @@ public class UserHistoricalActResultDTO implements Serializable {
*历史活动列表
*/
private List<UserHistoricalActInfoDTO> actInfoList;
public UserHistoricalActResultDTO() {
userId = StrConstant.EPMETY_STR;
headImgUrl = StrConstant.EPMETY_STR;
nickName = StrConstant.EPMETY_STR;
realName = StrConstant.EPMETY_STR;
signInActNum = NumConstant.ZERO;
signUpActNum = NumConstant.ZERO;
obtainPointsActNum = NumConstant.ZERO;
actInfoList = new ArrayList<>();
}
}

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

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-heart-server:
container_name: epmet-heart-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-heart-server:0.0.18
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-heart-server:0.0.24
ports:
- "8111:8111"
network_mode: host # 使用现有网络

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.18</version>
<version>0.0.24</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

@ -192,12 +192,12 @@ public class ResiActListController {
* 活动详情-已结束-回顾稿
*
* @param formDto
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.resi.ResiActSummaryResultDTO>
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.resi.ResiActSummaryResultDTO>>
* @Author zhangyong
* @Date 13:39 2020-07-21
**/
@PostMapping("summary/list")
public Result<ResiActSummaryResultDTO> summaryList(@RequestBody ResiActContentFormDTO formDto) {
public Result<List<ResiActSummaryResultDTO>> summaryList(@RequestBody ResiActContentFormDTO formDto) {
ValidatorUtils.validateEntity(formDto, ResiActContentFormDTO.AddUserInternalGroup.class);
return actSummaryService.summaryList(formDto);
}

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

@ -190,12 +190,20 @@ public class WorkActController {
return new Result();
}
/**
* @return com.epmet.commons.tools.utils.Result
* @param formDTO
* @author yinzuomei
* @description 测试积分发放接口
* @Date 2020/7/31 13:19
**/
@PostMapping("testgrantpoint")
public Result testGrantPoint(@RequestBody TestGrantFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO,TestGrantFormDTO.AddUserInternalGroup.class);
workActService.testGrantPoint(formDTO);
return new Result();
}
/**
* @return com.epmet.commons.tools.utils.Result
* @param formDTO

8
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSummaryDao.java

@ -23,6 +23,8 @@ import com.epmet.dto.result.resi.ResiActSummaryResultDTO;
import com.epmet.entity.ActSummaryEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 活动回顾表
*
@ -36,9 +38,9 @@ public interface ActSummaryDao extends BaseDao<ActSummaryEntity> {
* 活动详情-已结束-回顾稿
*
* @param formDto
* @return com.epmet.dto.result.resi.ResiActSummaryResultDTO
* @return java.util.List<com.epmet.dto.result.resi.ResiActSummaryResultDTO>
* @Author zhangyong
* @Date 15:11 2020-07-22
* @Date 15:03 2020-07-31
**/
ResiActSummaryResultDTO selectListSummary(ResiActContentFormDTO formDto);
List<ResiActSummaryResultDTO> selectListSummary(ResiActContentFormDTO formDto);
}

33
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/UserKindnessTimeLogDao.java

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

56
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/UserKindnessTimeLogEntity.java

@ -0,0 +1,56 @@
/**
* 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-31
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("user_kindness_time_log")
public class UserKindnessTimeLogEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 活动id
*/
private String actId;
/**
* 居民端用户id
*/
private String resiUserId;
/**
* 服务时长
*/
private Integer kindnessTime;
}

4
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSummaryService.java

@ -100,9 +100,9 @@ public interface ActSummaryService extends BaseService<ActSummaryEntity> {
* 活动详情-已结束-回顾稿
*
* @param formDto
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.resi.ResiActSummaryResultDTO>
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.resi.ResiActSummaryResultDTO>>
* @Author zhangyong
* @Date 13:39 2020-07-21
**/
Result<ResiActSummaryResultDTO> summaryList(ResiActContentFormDTO formDto);
Result<List<ResiActSummaryResultDTO>> summaryList(ResiActContentFormDTO formDto);
}

4
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSummaryServiceImpl.java

@ -106,8 +106,8 @@ public class ActSummaryServiceImpl extends BaseServiceImpl<ActSummaryDao, ActSum
}
@Override
public Result<ResiActSummaryResultDTO> summaryList(ResiActContentFormDTO formDto) {
return new Result<ResiActSummaryResultDTO>().ok(baseDao.selectListSummary(formDto));
public Result<List<ResiActSummaryResultDTO>> summaryList(ResiActContentFormDTO formDto) {
return new Result<List<ResiActSummaryResultDTO>>().ok(baseDao.selectListSummary(formDto));
}
}

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

@ -264,8 +264,12 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
this.insertHeartUserInfo(formDTO, volunteerFlag);
}
if (signUp){
// 4.插入活动日志表
this.insertActUserLog(formDTO);
// 4.插入用户参加活动-待审核的活动日志表
this.insertActUserLog(formDTO, ActConstant.ACT_USER_LOG_OPER_AUDITING);
if (!actInfoDTO.getAuditSwitch()){
// 自动审核通过,插入用户参加活动-审核通过的日志信息
this.insertActUserLog(formDTO, ActConstant.ACT_USER_LOG_OPER_PASSED);
}
}
// 5.插入 用户活动关系表
this.insertActUserRelation(formDTO, actInfoDTO);
@ -334,15 +338,16 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
/**
* 每次成功报名活动都需要插入用户活动关系日志表
* @param formDTO
* @param userOperationType 用户审核类型待审核通过不通过取消
* @return void
* @Author zhangyong
* @Date 09:37 2020-07-28
**/
private void insertActUserLog(ResiActRegistrationFormDTO formDTO){
private void insertActUserLog(ResiActRegistrationFormDTO formDTO, String userOperationType){
ActUserLogEntity userLogEntity = new ActUserLogEntity();
userLogEntity.setActId(formDTO.getActId());
userLogEntity.setUserId(formDTO.getUserId());
userLogEntity.setOperationType(ActConstant.ACT_USER_LOG_OPER_AUDITING);
userLogEntity.setOperationType(userOperationType);
actUserLogService.insert(userLogEntity);
}
@ -359,11 +364,12 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
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.setStatus(ActConstant.ACT_USER_STATUS_AUDITING);
entity.setPassedType(ActConstant.PASSEDTYPE_MANUAL);
} else {
entity.setStatus(ActConstant.ACT_USER_STATUS_PASSED);
entity.setPassedType(ActConstant.PASSEDTYPE_AUTO);
entity.setAuditTime(new Date());
}

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartUserInfoServiceImpl.java

@ -128,6 +128,8 @@ public class HeartUserInfoServiceImpl extends BaseServiceImpl<HeartUserInfoDao,
@Override
public Result<List<ResiLeaderboardResultDTO>> leaderboard(ResiActBaseFormDTO formDTO) {
List<ResiLeaderboardResultDTO> resultDtoS = new ArrayList<>();
int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize();
formDTO.setPageNo(pageIndex);
// 获取排好序的 排行榜
List<HeartUserInfoDTO> leaderboardList = baseDao.selectListLeaderboard(formDTO);
if (leaderboardList.size() > NumConstant.ZERO){

25
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java

@ -33,7 +33,7 @@ import com.epmet.constant.ActMessageConstant;
import com.epmet.dao.VolunteerInfoDao;
import com.epmet.dto.HeartUserInfoDTO;
import com.epmet.dto.VolunteerInfoDTO;
import com.epmet.dto.form.WxUserInfoFormDTO;
import com.epmet.dto.form.PasswordLoginUserInfoFormDTO;
import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO;
import com.epmet.dto.result.ResiUserBaseInfoResultDTO;
import com.epmet.dto.result.resi.ResiVolunteerInfoResultDTO;
@ -93,9 +93,9 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
// 发送消息 由积分系统消费消息(需要使用规则)
this.grantActPoints(formDTO);
}
// 更新用户基础信息表 并 更新用户微信表
WxUserInfoFormDTO wxUserInfoFormDTO = this.packageWxUserInfo(formDTO);
return epmetUserOpenFeignClient.updateUserBaseAndWxUserInfo(wxUserInfoFormDTO);
// 志愿者认证,更新用户基础信息
com.epmet.dto.form.ResiVolunteerAuthenticateFormDTO param = ConvertUtils.sourceToTarget(formDTO, com.epmet.dto.form.ResiVolunteerAuthenticateFormDTO.class);
return epmetUserOpenFeignClient.volunteerBaseInfo(param);
}
private void grantActPoints(ResiVolunteerAuthenticateFormDTO formDTO){
@ -122,23 +122,6 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
}
}
/**
* 根据志愿者认证参数组装微信基本信息
*
* @param formDTO
* @return com.epmet.dto.form.WxUserInfoFormDTO
* @Author zhangyong
* @Date 13:54 2020-07-28
**/
private WxUserInfoFormDTO packageWxUserInfo(ResiVolunteerAuthenticateFormDTO formDTO){
WxUserInfoFormDTO wxUserInfoFormDTO = new WxUserInfoFormDTO();
wxUserInfoFormDTO.setUserId(formDTO.getUserId());
wxUserInfoFormDTO.setNickName(formDTO.getNickname());
wxUserInfoFormDTO.setAvatarUrl(formDTO.getAvatarUrl());
wxUserInfoFormDTO.setGender(formDTO.getGender());
return wxUserInfoFormDTO;
}
@Override
public Result<ResiVolunteerInfoResultDTO> selectVolunteerInfoByUserId(TokenDto tokenDto) {
ResiVolunteerInfoResultDTO resultDTO = new ResiVolunteerInfoResultDTO();

97
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java

@ -91,6 +91,8 @@ public class WorkActServiceImpl implements WorkActService {
private ActSummaryDao actSummaryDao;
@Autowired
private ActGrantPointLogDao actGrantPointLogDao;
@Autowired
private UserKindnessTimeLogDao userKindnessTimeLogDao;
/**
* @return void
* @author yinzuomei
@ -621,7 +623,7 @@ public class WorkActServiceImpl implements WorkActService {
public void cancelAct(CancelActFormDTO formDTO) {
ActInfoDTO actInfoDTO=actInfoService.get(formDTO.getActId());
if(null==actInfoDTO){
logger.error("act_info is null");
logger.error("act_info is null actId="+formDTO.getActId());
return ;
}
if(!actInfoDTO.getCreatedBy().equals(loginUserUtil.getLoginUserId())){
@ -809,7 +811,7 @@ public class WorkActServiceImpl implements WorkActService {
public void finishAct(String actId) {
ActInfoDTO actInfoDTO=actInfoService.get(actId);
if(null==actInfoDTO){
logger.error("act_info is null");
logger.error("act_info is null actId="+actId);
return;
}
//校验是否可以结束
@ -826,9 +828,18 @@ public class WorkActServiceImpl implements WorkActService {
//发放积分调用事件
if(actInfoDTO.getReward()>0){
this.grantActPoints(actInfoDTO);
}else{
logger.info("活动积分为"+actInfoDTO.getReward()+"无需发放积分");
}
}
/**
* @return void
* @param actInfoDTO
* @author yinzuomei
* @description 活动发放积分
* @Date 2020/7/31 13:12
**/
private void grantActPoints(ActInfoDTO actInfoDTO) {
//查询已经给分的用户
QueryWrapper<ActUserRelationEntity> wrapper = new QueryWrapper<>();
@ -837,7 +848,7 @@ public class WorkActServiceImpl implements WorkActService {
.eq("REWARD_FLAG",ActConstant.ACT_USER_STATUS_AGREE);
List<ActUserRelationEntity> actUserRelationEntityList=actUserRelationDao.selectList(wrapper);
if(null==actUserRelationEntityList||actUserRelationEntityList.size()<1){
logger.info("不存在给分的记录,无需发送消息时间");
logger.info(String.format("活动%s,不存在给分的记录,无需发送消息时间",actInfoDTO.getId()));
return;
}
//查询当前用户所属组织信息
@ -879,7 +890,7 @@ public class WorkActServiceImpl implements WorkActService {
actGrantPointLogEntity.setResponseMsg(JSON.toJSONString(result));
actGrantPointLogDao.insert(actGrantPointLogEntity);
if(!result.success()){
logger.error("活动积分发放失败");
logger.error("活动积分发放失败,act_grant_point_log.id="+actGrantPointLogEntity.getId());
}
}
@ -925,6 +936,13 @@ public class WorkActServiceImpl implements WorkActService {
logger.info("积分发方成功");
}
/**
* @return void
* @param actInfoDTO
* @author yinzuomei
* @description //发放爱心时长、参与活动并获得积分的次数
* @Date 2020/7/31 13:15
**/
private void updateHeartUserInfo(ActInfoDTO actInfoDTO) {
List<ActUserRelationDTO> actUserRelationDTOList=actUserRelationService.getUserList(actInfoDTO.getId(),StrConstant.EPMETY_STR);
for(ActUserRelationDTO actUserRelation:actUserRelationDTOList){
@ -932,23 +950,46 @@ public class WorkActServiceImpl implements WorkActService {
if(null==heartUserInfoDTO){
continue;
}
if(ActConstant.ACT_USER_STATUS_AGREE.equals(actUserRelation.getRewardFlag())){
heartUserInfoDTO.setObtainPointNum(heartUserInfoDTO.getObtainPointNum()+1);
}
//爱心时长发放(签到的。未签到但是有积分的)
if(ActConstant.ACT_USER_STATUS_SIGNED_IN.equals(actUserRelation.getSignInFlag())){
//已签到的
heartUserInfoDTO.setKindnessTime(heartUserInfoDTO.getKindnessTime()+actInfoDTO.getServiceMin());
}else{
//未签到,但是有积分的
if(actInfoDTO.getReward()>0){
if(ActConstant.ACT_USER_STATUS_AGREE.equals(actUserRelation.getRewardFlag())){
heartUserInfoDTO.setObtainPointNum(heartUserInfoDTO.getObtainPointNum()+1);
}
}
if(actInfoDTO.getServiceMin()>0){
//爱心时长发放(签到的。未签到但是有积分的)
if(ActConstant.ACT_USER_STATUS_SIGNED_IN.equals(actUserRelation.getSignInFlag())){
//已签到的
heartUserInfoDTO.setKindnessTime(heartUserInfoDTO.getKindnessTime()+actInfoDTO.getServiceMin());
UserKindnessTimeLogEntity userKindnessTimeLogEntity=new UserKindnessTimeLogEntity();
userKindnessTimeLogEntity.setActId(actInfoDTO.getId());
userKindnessTimeLogEntity.setKindnessTime(actInfoDTO.getServiceMin());
userKindnessTimeLogEntity.setResiUserId(actUserRelation.getUserId());
userKindnessTimeLogDao.insert(userKindnessTimeLogEntity);
}else{
//未签到,但是有积分的
if(ActConstant.ACT_USER_STATUS_AGREE.equals(actUserRelation.getRewardFlag())){
heartUserInfoDTO.setKindnessTime(heartUserInfoDTO.getKindnessTime()+actInfoDTO.getServiceMin());
UserKindnessTimeLogEntity userKindnessTimeLogEntity=new UserKindnessTimeLogEntity();
userKindnessTimeLogEntity.setActId(actInfoDTO.getId());
userKindnessTimeLogEntity.setKindnessTime(actInfoDTO.getServiceMin());
userKindnessTimeLogEntity.setResiUserId(actUserRelation.getUserId());
userKindnessTimeLogDao.insert(userKindnessTimeLogEntity);
}
}
}
heartUserInfoService.update(heartUserInfoDTO);
if(actInfoDTO.getReward()>0||actInfoDTO.getServiceMin()>0){
heartUserInfoService.update(heartUserInfoDTO);
}
}
}
/**
* @return void
* @param actId
* @author yinzuomei
* @description 活动结束后生成统计表
* @Date 2020/7/31 13:15
**/
private void saveActStatistical(String actId) {
ActStatisticalDTO actStatisticalDTO=new ActStatisticalDTO();
actStatisticalDTO.setActId(actId);
@ -971,6 +1012,13 @@ public class WorkActServiceImpl implements WorkActService {
actStatisticalService.save(actStatisticalDTO);
}
/**
* @return void
* @param actId
* @author yinzuomei
* @description 保存活动结束日志
* @Date 2020/7/31 13:16
**/
private void saveActOperationRec(String actId) {
ActOperationRecEntity actOperationRecEntity=new ActOperationRecEntity();
actOperationRecEntity.setActId(actId);
@ -980,6 +1028,13 @@ public class WorkActServiceImpl implements WorkActService {
actOperationRecDao.insert(actOperationRecEntity);
}
/**
* @return com.epmet.dto.ActInfoDTO
* @param actInfoDTO
* @author yinzuomei
* @description 校验是否可以结束
* @Date 2020/7/31 13:16
**/
private ActInfoDTO checkActInfoDTO(ActInfoDTO actInfoDTO) {
//只有我发布的活动,我可以就结束
if(!actInfoDTO.getCreatedBy().equals(loginUserUtil.getLoginUserId())){
@ -1012,7 +1067,7 @@ public class WorkActServiceImpl implements WorkActService {
public void summaryAct(SummaryActFormDTO formDTO) {
ActInfoDTO actInfoDTO=actInfoService.get(formDTO.getActId());
if(null==actInfoDTO){
logger.info("act_info is null");
logger.error("act_info is null actId="+formDTO.getActId());
return;
}
if(!actInfoDTO.getActStatus().equals(ActConstant.ACT_STATUS_FINISHED)){
@ -1127,7 +1182,7 @@ public class WorkActServiceImpl implements WorkActService {
//删除所有的草稿
this.deleteDraft();
publishActResultDTO.setActId(rePublishFormDTO.getActId());
//发送消息通知-暂时不做了
//发送消息通知-暂时不做了,前端默认串的是不通知
/*if(rePublishFormDTO.getNoticePassedPeople()){
this.noticePassedPeople(originalActInfo,newActInfoEntity);
}*/
@ -1135,14 +1190,4 @@ public class WorkActServiceImpl implements WorkActService {
}
private void noticePassedPeople(ActInfoDTO originalActInfo, ActInfoEntity newActInfoEntity) {
/* List<ActUserRelationDTO> actUserRelationDTOList=actUserRelationDao.selectAuditingAndPassedList(originalActInfo.getId());
if(null==actUserRelationDTOList||actUserRelationDTOList.size()<1){
logger.info("不存在待审核人员、已经审核用户,无需发送站内信");
return;
}
String originalTitle=originalActInfo.getTitle();
//活动地点、活动预计开始时间、活动预计结束时间、活动积分、签到时间开始、签到结束时间、签到地点*/
}
}

109
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java

@ -34,6 +34,7 @@ import com.epmet.service.ActInfoService;
import com.epmet.service.ActUserRelationService;
import com.epmet.service.HeartUserInfoService;
import com.epmet.service.WorkActUserService;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
@ -102,9 +103,15 @@ public class WorkActUserServiceImpl implements WorkActUserService {
//赋值基本信息
for(UserBaseInfoResultDTO userBaseInfoResultDTO:userInfoList){
if(actUserRelationDTO.getUserId().equals(userBaseInfoResultDTO.getUserId())){
auditingDTO.setRealName(userBaseInfoResultDTO.getRealName());
auditingDTO.setNickName(userBaseInfoResultDTO.getNickname());
auditingDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl());
if(StringUtils.isNotBlank(userBaseInfoResultDTO.getRealName())){
auditingDTO.setRealName(userBaseInfoResultDTO.getRealName());
}
if(StringUtils.isNotBlank(userBaseInfoResultDTO.getNickname())){
auditingDTO.setNickName(userBaseInfoResultDTO.getNickname());
}
if(StringUtils.isNotBlank((userBaseInfoResultDTO.getHeadImgUrl()))){
auditingDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl());
}
break;
}
}
@ -145,9 +152,15 @@ public class WorkActUserServiceImpl implements WorkActUserService {
//赋值基本信息
for(UserBaseInfoResultDTO userBaseInfoResultDTO:userInfoList){
if(actUserRelationDTO.getUserId().equals(userBaseInfoResultDTO.getUserId())){
passedDTO.setRealName(userBaseInfoResultDTO.getRealName());
passedDTO.setNickName(userBaseInfoResultDTO.getNickname());
passedDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl());
if(StringUtils.isNotBlank(userBaseInfoResultDTO.getRealName())){
passedDTO.setRealName(userBaseInfoResultDTO.getRealName());
}
if(StringUtils.isNotBlank(userBaseInfoResultDTO.getNickname())){
passedDTO.setNickName(userBaseInfoResultDTO.getNickname());
}
if(StringUtils.isNotBlank(userBaseInfoResultDTO.getHeadImgUrl())){
passedDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl());
}
break;
}
}
@ -189,9 +202,15 @@ public class WorkActUserServiceImpl implements WorkActUserService {
//赋值基本信息
for(UserBaseInfoResultDTO userBaseInfoResultDTO:userInfoList){
if(actUserRelationDTO.getUserId().equals(userBaseInfoResultDTO.getUserId())){
rejectedDTO.setRealName(userBaseInfoResultDTO.getRealName());
rejectedDTO.setNickName(userBaseInfoResultDTO.getNickname());
rejectedDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl());
if(StringUtils.isNotBlank(userBaseInfoResultDTO.getRealName())){
rejectedDTO.setRealName(userBaseInfoResultDTO.getRealName());
}
if(StringUtils.isNotBlank(userBaseInfoResultDTO.getNickname())){
rejectedDTO.setNickName(userBaseInfoResultDTO.getNickname());
}
if(StringUtils.isNotBlank(userBaseInfoResultDTO.getHeadImgUrl())){
rejectedDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl());
}
break;
}
}
@ -233,9 +252,15 @@ public class WorkActUserServiceImpl implements WorkActUserService {
//赋值基本信息
for(UserBaseInfoResultDTO userBaseInfoResultDTO:userInfoList){
if(actUserRelationDTO.getUserId().equals(userBaseInfoResultDTO.getUserId())){
cancelDTO.setRealName(userBaseInfoResultDTO.getRealName());
cancelDTO.setNickName(userBaseInfoResultDTO.getNickname());
cancelDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl());
if(StringUtils.isNotBlank(userBaseInfoResultDTO.getRealName())){
cancelDTO.setRealName(userBaseInfoResultDTO.getRealName());
}
if(StringUtils.isNotBlank(userBaseInfoResultDTO.getNickname())){
cancelDTO.setNickName(userBaseInfoResultDTO.getNickname());
}
if(StringUtils.isNotBlank(userBaseInfoResultDTO.getHeadImgUrl())){
cancelDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl());
}
break;
}
}
@ -295,10 +320,24 @@ public class WorkActUserServiceImpl implements WorkActUserService {
resultDTO.setActUserRelationId(actUserRelationDTO.getId());
resultDTO.setActId(actUserRelationDTO.getActId());
resultDTO.setUserId(actUserRelationDTO.getUserId());
resultDTO.setRealName(userBaseInfo.getRealName());
resultDTO.setGender(userBaseInfo.getGender());
resultDTO.setMobile(userBaseInfo.getMobile());
resultDTO.setIdNum(userBaseInfo.getIdNum());
if (StringUtils.isNotBlank(userBaseInfo.getRealName())) {
resultDTO.setRealName(userBaseInfo.getRealName());
} else {
resultDTO.setRealName(StrConstant.EPMETY_STR);
}
if (StringUtils.isNotBlank(userBaseInfo.getGender())) {
resultDTO.setGender(userBaseInfo.getGender());
} else {
resultDTO.setGender(StrConstant.EPMETY_STR);
}
if (StringUtils.isNotBlank(userBaseInfo.getMobile())) {
resultDTO.setMobile(userBaseInfo.getMobile());
} else {
resultDTO.setMobile(StrConstant.EPMETY_STR);
}
if (StringUtils.isNotBlank(userBaseInfo.getIdNum())) {
resultDTO.setIdNum(userBaseInfo.getIdNum());
}
resultDTO.setAddress(userBaseInfo.getStreet()+userBaseInfo.getDistrict()+userBaseInfo.getBuildingAddress());
resultDTO.setSignUpTime(actUserRelationDTO.getCreatedTime());
/**
@ -320,8 +359,6 @@ public class WorkActUserServiceImpl implements WorkActUserService {
historicalAuditResult.setLatestAuditTime(latestRefused.getCreatedTime());
historicalAuditResult.setLatestRefusedReason(latestRefused.getReason());
historicalAuditResult.setRefusedCountDesc(String.format("已拒绝%s次",refusedCount));
resultDTO.setLatestAuditTime(latestRefused.getCreatedTime());
resultDTO.setLatestRefusedReason(latestRefused.getReason());
resultDTO.setHistoricalAuditResult(historicalAuditResult);
}
}else if(ActConstant.ACT_USER_STATUS_PASSED.equals(resultDTO.getStatus())||ActConstant.ACT_USER_STATUS_REFUSED.equals(resultDTO.getStatus())){
@ -352,9 +389,15 @@ public class WorkActUserServiceImpl implements WorkActUserService {
UserBaseInfoResultDTO userBaseInfoResultDTO=this.queryUserBaseInfo(formDTO.getUserId());
//基本信息
resultDTO.setUserId(formDTO.getUserId());
resultDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl());
resultDTO.setNickName(userBaseInfoResultDTO.getNickname());
resultDTO.setRealName(userBaseInfoResultDTO.getRealName());
if(StringUtils.isNotBlank(userBaseInfoResultDTO.getHeadImgUrl())){
resultDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl());
}
if(StringUtils.isNotBlank(userBaseInfoResultDTO.getNickname())){
resultDTO.setNickName(userBaseInfoResultDTO.getNickname());
}
if(StringUtils.isNotBlank(userBaseInfoResultDTO.getRealName())){
resultDTO.setRealName(userBaseInfoResultDTO.getRealName());
}
//参与活动统计值
HistoricalActInfo historicalActInfo=getHistoricalActInfo(formDTO.getUserId());
resultDTO.setSignInActNum(historicalActInfo.getSignInActNum());
@ -503,9 +546,15 @@ public class WorkActUserServiceImpl implements WorkActUserService {
//基础信息赋值
for(UserBaseInfoResultDTO userBaseInfo:userInfoList){
if(joinedUserResultDTO.getUserId().equals(userBaseInfo.getUserId())){
joinedUserResultDTO.setRealName(userBaseInfo.getRealName());
joinedUserResultDTO.setNickName(userBaseInfo.getNickname());
joinedUserResultDTO.setHeadImgUrl(userBaseInfo.getHeadImgUrl());
if(StringUtils.isNotBlank(userBaseInfo.getRealName())){
joinedUserResultDTO.setRealName(userBaseInfo.getRealName());
}
if(StringUtils.isNotBlank(userBaseInfo.getNickname())){
joinedUserResultDTO.setNickName(userBaseInfo.getNickname());
}
if(StringUtils.isNotBlank(userBaseInfo.getHeadImgUrl())){
joinedUserResultDTO.setHeadImgUrl(userBaseInfo.getHeadImgUrl());
}
break;
}
@ -536,9 +585,15 @@ public class WorkActUserServiceImpl implements WorkActUserService {
//基础信息赋值
for(UserBaseInfoResultDTO userBaseInfo:userInfoList){
if(canceledUserResultDTO.getUserId().equals(userBaseInfo.getUserId())){
canceledUserResultDTO.setRealName(userBaseInfo.getRealName());
canceledUserResultDTO.setNickName(userBaseInfo.getNickname());
canceledUserResultDTO.setHeadImgUrl(userBaseInfo.getHeadImgUrl());
if(StringUtils.isNotBlank(userBaseInfo.getRealName())){
canceledUserResultDTO.setRealName(userBaseInfo.getRealName());
}
if(StringUtils.isNotBlank(userBaseInfo.getNickname())){
canceledUserResultDTO.setNickName(userBaseInfo.getNickname());
}
if(StringUtils.isNotBlank(userBaseInfo.getHeadImgUrl())){
canceledUserResultDTO.setHeadImgUrl(userBaseInfo.getHeadImgUrl());
}
break;
}

6
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml

@ -133,4 +133,8 @@ elink:
appId: @elink.mq.appId@ #项目接入亿联云的应用Id
token: @elink.mq.token@ #项目接入亿联云的应用token 相当于secret
host: @elink.mq.host@ #亿联云消息网关服务地址
sendMsgPath: @elink.mq.sendMsgPath@ #发送消息路径
sendMsgPath: @elink.mq.sendMsgPath@ #发送消息路径
dingTalk:
robot:
webHook: @dingTalk.robot.webHook@
secret: @dingTalk.robot.secret@

34
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/epmet_heart.sql

@ -11,7 +11,7 @@
Target Server Version : 50728
File Encoding : 65001
Date: 30/07/2020 14:11:45
Date: 31/07/2020 17:50:23
*/
SET NAMES utf8mb4;
@ -64,13 +64,13 @@ CREATE TABLE `act_customized` (
DROP TABLE IF EXISTS `act_grant_point_log`;
CREATE TABLE `act_grant_point_log` (
`ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`ACT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`REWARD` int(11) NOT NULL,
`REMARK` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
`OPERATOR_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`SEND_MSG` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL,
`RESPONSE_MSG` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL,
`CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户id',
`ACT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '活动id',
`REWARD` int(11) NOT NULL COMMENT '积分值,其实就是活动设置的积分',
`REMARK` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
`OPERATOR_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '当前操作工作人员id',
`SEND_MSG` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '发送消息体',
`RESPONSE_MSG` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '返回消息体',
`REVISION` int(11) NOT NULL DEFAULT 0 COMMENT '乐观锁',
`DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '删除标记',
`CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人',
@ -423,6 +423,24 @@ CREATE TABLE `latest_act_info` (
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '最近一次编辑的活动信息' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for user_kindness_time_log
-- ----------------------------
DROP TABLE IF EXISTS `user_kindness_time_log`;
CREATE TABLE `user_kindness_time_log` (
`ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键',
`ACT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '活动id',
`RESI_USER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '居民端用户id',
`KINDNESS_TIME` int(11) NOT NULL COMMENT '服务时长',
`DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '删除标识 0.未删除 1.已删除',
`REVISION` int(11) NOT NULL DEFAULT 0 COMMENT '乐观锁',
`CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人(工作人员id)',
`CREATED_TIME` datetime(0) NOT NULL COMMENT '创建时间(操作的时间)',
`UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime(0) NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户爱心时长记录表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for volunteer_info
-- ----------------------------

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

@ -65,14 +65,13 @@
'signing_up' AS actCurrentState, -- 活动状态:报名中,未报满
IF(u.USER_ID = #{userId},'signed_up','no_signed_up') as signupFlag
FROM act_info i
LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0'
LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' AND u.`STATUS` != 'refused' AND u.`STATUS` != 'canceled' AND u.USER_ID = #{userId}
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.ACT_STATUS = 'published'
AND <![CDATA[ DATE_FORMAT(i.SIGN_UP_END_TIME,'%Y-%m-%d %H:%i:%s') >= ]]> NOW() -- 报名截止时间 >= 当前时间
AND (i.ACT_QUOTA_CATEGORY = 0 OR i.ACT_QUOTA > IFNULL(c.signupNum, 0)) -- 不限名额或者报名人数未报满
AND i.CUSTOMER_ID = #{customerId}
GROUP BY i.ID
ORDER BY i.ACT_QUOTA_CATEGORY DESC,i.CREATED_TIME DESC
</select>
@ -92,7 +91,7 @@
'enough' AS actCurrentState, -- 活动状态:报名中,已报满
IF(u.USER_ID = #{userId},'signed_up','no_signed_up') as signupFlag
FROM act_info i
LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0'
LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' AND u.`STATUS` != 'refused' AND u.`STATUS` != 'canceled' AND u.USER_ID = #{userId}
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.ACT_STATUS = 'published'
@ -100,7 +99,6 @@
AND i.ACT_QUOTA_CATEGORY = 1 -- 固定名额
AND i.ACT_QUOTA = IFNULL(c.signupNum, 0) -- 名额已满
AND i.CUSTOMER_ID = #{customerId}
GROUP BY i.ID
ORDER BY i.CREATED_TIME DESC
</select>
@ -120,14 +118,13 @@
'end_sign_up' AS actCurrentState, -- 活动状态:未开始
IF(u.USER_ID = #{userId},'signed_up','no_signed_up') as signupFlag
FROM act_info i
LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0'
LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' AND u.`STATUS` != 'refused' AND u.`STATUS` != 'canceled' AND u.USER_ID = #{userId}
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'
-- 活动开始时间 > 当前时间 并且 报名截止时间 &lt; 当前时间 报名已结束,活动未开始 未开始
AND ( <![CDATA[ DATE_FORMAT(i.ACT_START_TIME,'%Y-%m-%d %H:%i:%s') > ]]> NOW() AND <![CDATA[ DATE_FORMAT(i.SIGN_UP_END_TIME,'%Y-%m-%d %H:%i:%s') < ]]> NOW() )
AND i.ACT_STATUS != 'canceled'
AND i.ACT_STATUS = 'published'
AND i.CUSTOMER_ID = #{customerId}
GROUP BY i.ID
ORDER BY i.CREATED_TIME DESC
</select>
@ -147,14 +144,13 @@
'in_progress' AS actCurrentState, -- 活动状态:进行中
IF(u.USER_ID = #{userId},'signed_up','no_signed_up') as signupFlag
FROM act_info i
LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0'
LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' AND u.`STATUS` != 'refused' AND u.`STATUS` != 'canceled' AND u.USER_ID = #{userId}
LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` = 'passed' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID
WHERE i.DEL_FLAG = '0'
-- 活动开始时间 &lt;= 当前时间 并且活动结束时间 >= 当前时间 进行中
AND ( <![CDATA[ DATE_FORMAT(i.ACT_START_TIME,'%Y-%m-%d %H:%i:%s') <= ]]> NOW() AND <![CDATA[ DATE_FORMAT(i.ACT_END_TIME,'%Y-%m-%d %H:%i:%s') >= ]]> NOW() )
AND i.ACT_STATUS != 'canceled'
-- 活动开始时间 &lt;= 当前时间 进行中
AND <![CDATA[ DATE_FORMAT(i.ACT_START_TIME,'%Y-%m-%d %H:%i:%s') <= ]]> NOW()
AND i.ACT_STATUS = 'published'
AND i.CUSTOMER_ID = #{customerId}
GROUP BY i.ID
ORDER BY i.CREATED_TIME DESC
</select>
@ -174,13 +170,11 @@
'finished' AS actCurrentState, -- 活动状态:已结束
IF(u.USER_ID = #{userId},'signed_up','no_signed_up') as signupFlag
FROM act_info i
LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0'
LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' AND u.`STATUS` != 'refused' AND u.`STATUS` != 'canceled' AND u.USER_ID = #{userId}
LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` = 'passed' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID
WHERE i.DEL_FLAG = '0'
AND i.ACT_STATUS != 'canceled'
AND <![CDATA[ DATE_FORMAT(i.ACT_END_TIME,'%Y-%m-%d %H:%i:%s') < ]]> NOW()
AND i.ACT_STATUS = 'finished'
AND i.CUSTOMER_ID = #{customerId}
GROUP BY i.ID
ORDER BY i.CREATED_TIME DESC
LIMIT #{pageNo}, #{pageSize}
</select>
@ -199,11 +193,13 @@
i.ACT_QUOTA actQuota,
IFNULL(c.signupNum, 0) signupNum, -- 已报名人数
'auditing' AS actCurrentState -- 活动状态
FROM act_info i LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND u.DEL_FLAG = '0'
FROM act_user_relation u LEFT JOIN act_info i ON i.ID = u.ACT_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 u.DEL_FLAG = '0'
AND u.USER_ID = #{userId}
AND u.`STATUS` = 'auditing'
AND i.ACT_STATUS = 'published'
ORDER BY i.CREATED_TIME DESC
LIMIT #{pageNo}, #{pageSize}
</select>
@ -222,11 +218,13 @@
i.ACT_QUOTA actQuota,
IFNULL(c.signupNum, 0) signupNum, -- 已报名人数
'passed' AS actCurrentState -- 活动状态
FROM act_info i LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND u.DEL_FLAG = '0'
FROM act_user_relation u LEFT JOIN act_info i ON i.ID = u.ACT_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 u.DEL_FLAG = '0'
AND u.USER_ID = #{userId}
AND u.`STATUS` = 'passed'
AND i.ACT_STATUS = 'published'
ORDER BY i.CREATED_TIME DESC
LIMIT #{pageNo}, #{pageSize}
</select>
@ -245,11 +243,13 @@
i.ACT_QUOTA actQuota,
IFNULL(c.signupNum, 0) signupNum, -- 已报名人数
'refused' AS actCurrentState -- 活动状态
FROM act_info i LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND u.DEL_FLAG = '0'
FROM act_user_relation u LEFT JOIN act_info i ON i.ID = u.ACT_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 u.DEL_FLAG = '0'
AND u.USER_ID = #{userId}
AND u.`STATUS` = 'refused'
AND i.ACT_STATUS = 'published'
ORDER BY i.CREATED_TIME DESC
LIMIT #{pageNo}, #{pageSize}
</select>
@ -268,11 +268,13 @@
i.ACT_QUOTA actQuota,
IFNULL(c.signupNum, 0) signupNum, -- 已报名人数
'canceld' AS actCurrentState -- 活动状态
FROM act_info i LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND u.DEL_FLAG = '0'
FROM act_user_relation u LEFT JOIN act_info i ON i.ID = u.ACT_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 u.DEL_FLAG = '0'
AND u.USER_ID = #{userId}
AND <![CDATA[ DATE_FORMAT(i.ACT_END_TIME,'%Y-%m-%d %H:%i:%s') < ]]> NOW() -- 活动结束时间 &lt; 当前时间, 活动已结束
AND u.`STATUS` = 'passed'
AND i.ACT_STATUS = 'finished'
ORDER BY i.CREATED_TIME DESC
LIMIT #{pageNo}, #{pageSize}
</select>
@ -330,6 +332,7 @@
AND r.DEL_FLAG = '0'
AND r.USER_ID = #{userId}
AND NOW() BETWEEN DATE_SUB(i.ACT_START_TIME, INTERVAL 1 HOUR) AND i.ACT_END_TIME
AND i.ACT_STATUS = 'published'
</select>
<!--活动回顾列表-->

1
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActLiveRecDao.xml

@ -32,6 +32,7 @@
FROM act_live_rec r
WHERE r.DEL_FLAG = '0'
AND r.ACT_ID = #{actId}
ORDER BY CREATED_TIME DESC
</select>
<!--根据实况id,查询每条实况对应的多张图片-->

20
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/UserKindnessTimeLogDao.xml

@ -0,0 +1,20 @@
<?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.UserKindnessTimeLogDao">
<resultMap type="com.epmet.entity.UserKindnessTimeLogEntity" id="userKindnessTimeLogMap">
<result property="id" column="ID"/>
<result property="actId" column="ACT_ID"/>
<result property="resiUserId" column="RESI_USER_ID"/>
<result property="kindnessTime" column="KINDNESS_TIME"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

37
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointExchangeResponseResultDTO.java

@ -0,0 +1,37 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @ClassName PointExchangeResponseResultDTO
* @Auth wangc
* @Date 2020-07-31 16:07
*/
@Data
public class PointExchangeResponseResultDTO implements Serializable {
private static final long serialVersionUID = -6342757960284704496L;
/**
* 核销成功标识
* */
private boolean resultFlag;
/**
* 失败原因
* */
private String failureReason;
private Integer point;
/**
* 工作人员昵称
* */
private String operatorName;
/**
* 工作人员头像
* */
private String operatorProfile;
}

10
epmet-module/epmet-point/epmet-point-client/src/main/java/dto/form/SendPointFormDTO.java

@ -4,8 +4,11 @@ package dto.form;/**
* @date 2020-07-17 17:16
**/
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* desc发送积分dto
* @author lyn
@ -13,6 +16,9 @@ import lombok.Data;
*/
@Data
public class SendPointFormDTO {
public interface SendPointGroup extends CustomerClientShowGroup{}
private String pointDesc;
/**
@ -33,15 +39,18 @@ public class SendPointFormDTO {
/**
* 客户Id
*/
@NotBlank(message = "客户Id不能为空", groups = SendPointGroup.class)
private String customerId;
/**
* 被操作用户id
*/
@NotBlank(message = "用户Id不能为空", groups = SendPointGroup.class)
private String userId;
/**
* 加减分标识 plus/minus
*/
@NotBlank(message = "加减标识不能为空", groups = SendPointGroup.class)
private String actionFlag;
@ -53,6 +62,7 @@ public class SendPointFormDTO {
/**
* 备注
*/
@NotBlank(message = "积分备注不能为空", groups = SendPointGroup.class)
private String remark;
/**

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

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-point-server:
container_name: epmet-point-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-point-server:0.0.11
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-point-server:0.0.15
ports:
- "8112:8112"
network_mode: host # 使用现有网络

2
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.11</version>
<version>0.0.15</version>
<parent>
<artifactId>epmet-point</artifactId>
<groupId>com.epmet</groupId>

2
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/MqSubcribeConfig.java

@ -40,6 +40,6 @@ public class MqSubcribeConfig {
param.put("mqSubscribeList", subscribeFormDTOList);
String jsonStrParam = JSON.toJSONString(param);
Result<String> result = HttpClientManager.getInstance().sendPostByHttps(mqServer, JSON.toJSONString(param));
logger.error("subscriber==jsonStrParam:{}=====result:{}" ,jsonStrParam, JSON.toJSONString(result));
logger.info("subscriber==jsonStrParam:{}=====result:{}" ,jsonStrParam, JSON.toJSONString(result));
}
}

33
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/MqPointCallbackController.java

@ -3,9 +3,11 @@ package com.epmet.controller;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.dto.form.mq.ReceiveMqMsg;
import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.service.UserPointActionLogService;
import dto.form.SendPointFormDTO;
import lombok.extern.slf4j.Slf4j;
@ -13,9 +15,12 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
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;
/**
* desc: 积分相关消息回调controller
*
@ -38,21 +43,21 @@ public class MqPointCallbackController {
* @return
*/
@RequestMapping("activeSendPoint")
public String activeSendPoint(ReceiveMqMsg mqMsg) {
public Result<Boolean> activeSendPoint(@RequestBody ReceiveMqMsg mqMsg) {
log.debug("activeSendPoint receive mqMsg:{}", JSON.toJSONString(mqMsg));
if (mqMsg == null || StringUtils.isBlank(mqMsg.getMsg())) {
log.warn("activeSendPoint mqMsg is empty");
return "success";
return new Result<Boolean>().ok(true);
}
SendPointFormDTO formDTO = ConvertUtils.sourceToTarget(mqMsg.getMsg(), SendPointFormDTO.class);
List<SendPointFormDTO> formDTO = JSON.parseArray(mqMsg.getMsg(), SendPointFormDTO.class);
try {
userPointActionLogService.grantPoint(formDTO);
} catch (Exception e) {
logger.error("activeSendPoint consume fail,msg:{}",JSON.toJSONString(mqMsg.getMsg()));
logger.error("activeSendPoint consume fail", e);
throw new RenException(EpmetErrorCode.SERVER_ERROR.getMsg());
}
log.info("activeSendPoint consumer success,formDTO:{}", JSON.toJSONString(formDTO));
return "success";
return new Result<Boolean>().ok(true);
}
/**
@ -62,21 +67,22 @@ public class MqPointCallbackController {
* @return
*/
@RequestMapping("registervolunteer")
public String registerVolunteer(ReceiveMqMsg mqMsg) {
public Result<Boolean> registerVolunteer(@RequestBody ReceiveMqMsg mqMsg) {
log.debug("registerVolunteer receive mqMsg:{}", JSON.toJSONString(mqMsg));
if (mqMsg == null || StringUtils.isBlank(mqMsg.getMsg())) {
log.warn("registerVolunteer mqMsg is empty");
return "success";
return new Result<Boolean>().ok(true);
}
BasePointEventMsg formDTO = ConvertUtils.sourceToTarget(mqMsg.getMsg(), BasePointEventMsg.class);
try {
//TODO 调用调整积分方法去给用户加减积分 userPointActionLogService.
userPointActionLogService.grantPointByEvent(EventEnum.REGISTER_VOLUNTEER.getEventTag(),formDTO);
} catch (Exception e) {
logger.error("registerVolunteer consume fail,msg:{}",JSON.toJSONString(mqMsg.getMsg()));
logger.error("registerVolunteer consume fail", e);
throw new RenException(EpmetErrorCode.SERVER_ERROR.getMsg());
}
log.info("registerVolunteer consumer success,formDTO:{}", JSON.toJSONString(formDTO));
return "success";
return new Result<Boolean>().ok(true);
}
/**
@ -86,21 +92,22 @@ public class MqPointCallbackController {
* @return
*/
@RequestMapping("pubactivelive")
public String pubActiveLive(ReceiveMqMsg mqMsg) {
public Result<Boolean> pubActiveLive(@RequestBody ReceiveMqMsg mqMsg) {
log.debug("pubActiveLive receive mqMsg:{}", JSON.toJSONString(mqMsg));
if (mqMsg == null || StringUtils.isBlank(mqMsg.getMsg())) {
log.warn("pubActiveLive mqMsg is empty");
return "success";
return new Result<Boolean>().ok(true);
}
BasePointEventMsg formDTO = ConvertUtils.sourceToTarget(mqMsg.getMsg(), BasePointEventMsg.class);
try {
//TODO 调用调整积分方法去给用户加减积分 userPointActionLogService.
userPointActionLogService.grantPointByEvent(EventEnum.ACTIVE_INSERT_LIVE.getEventTag(),formDTO);
} catch (Exception e) {
logger.error("pubActiveLive consume fail,msg:{}",JSON.toJSONString(mqMsg.getMsg()));
logger.error("pubActiveLive consume fail", e);
throw new RenException(EpmetErrorCode.SERVER_ERROR.getMsg());
}
log.info("pubActiveLive consumer success,formDTO:{}", JSON.toJSONString(formDTO));
return "success";
return new Result<Boolean>().ok(true);
}
}

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

@ -52,8 +52,8 @@ public class PointRuleController {
* @return
*/
@PostMapping(value = "list")
public Result<List<PointRuleResultDTO>> list(@LoginUser TokenDto tokenDTO, @RequestBody PointRuleListFormDTO formDTO) {
formDTO.setCustomerId(tokenDTO.getCustomerId());
public Result<List<PointRuleResultDTO>> list( @RequestBody PointRuleListFormDTO formDTO) {
formDTO.setCustomerId("3ef7e4bb195eb9e622d68b52509aa940");
ValidatorUtils.validateEntity(formDTO);
return new Result<List<PointRuleResultDTO>>().ok(pointRuleService.list(formDTO));
}

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

@ -7,6 +7,7 @@ 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.PointExchangeResponseResultDTO;
import com.epmet.dto.result.ResiPointDetailResultDTO;
import com.epmet.dto.result.ResiPointLogListResultDTO;
import com.epmet.dto.result.ResiPointRankListResultDTO;
@ -129,4 +130,16 @@ public class ResiPointController {
ValidatorUtils.validateEntity(pageUserParam,CommonPageUserFormDTO.PageUserGroup.class);
return new Result<List<ResiPointLogListResultDTO>>().ok(pointVerificationLogService.getMyExchangeRecord(pageUserParam));
}
/**
* @Description 居民端积分兑换响应
* @param tokenDto
* @return
* @author wangc
* @date 2020.07.31 16:17
**/
@PostMapping("exchangecallback")
public Result<PointExchangeResponseResultDTO> exchangeCallback(@LoginUser TokenDto tokenDto){
return new Result<PointExchangeResponseResultDTO>().ok(pointVerificationLogService.resiExchangeCallback(tokenDto.getUserId()));
}
}

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

@ -22,6 +22,7 @@ import com.epmet.dto.form.PointRuleListFormDTO;
import com.epmet.entity.PointRuleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PostMapping;
import java.util.List;
@ -51,4 +52,6 @@ public interface PointRuleDao extends BaseDao<PointRuleEntity> {
List<PointRuleEntity> selectListByFunctionId(PointRuleListFormDTO formDTO);
int updateByCustomerId(PointRuleEntity entity);
PointRuleEntity selectByEventCodeAndCustomerId(@Param("customerId") String customerId, @Param("eventCode") String eventCode);
}

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

@ -43,4 +43,12 @@ public interface UserPointActionLogDao extends BaseDao<UserPointActionLogEntity>
**/
List<ResiPointLogPeriodResultDTO> selectPointActionLogList(@Param("userId") String userId);
/**
* @Description 查询指定用户在某条规则下所得的积分总和
* @param
* @return
* @author wangc
* @date 2020.07.31 15:11
**/
Integer selectSumByEvent(@Param("userId") String userId,@Param("eventId") String eventId, @Param("sourceId") String sourceId,@Param("customerId") String customerId);
}

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

@ -1,6 +1,8 @@
package com.epmet.redis;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.dto.result.PointExchangeResponseResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@ -15,4 +17,17 @@ public class PointRedis {
@Autowired
private RedisUtils redisUtils;
public void lpush(String userId , PointExchangeResponseResultDTO verificationResult){
redisUtils.leftPush(RedisKeys.getPointVerificationResultKey(userId),verificationResult);
}
public Object lindex(String userId,Long index){
return redisUtils.lindex(RedisKeys.getPointVerificationResultKey(userId),index);
}
public String checkIfQrCodeExpire(String shortId){
String userId = (String)redisUtils.getString(RedisKeys.getShortUserIdKey(shortId));
return userId;
}
}

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

@ -56,4 +56,14 @@ public interface PointRuleService extends BaseService<PointRuleEntity> {
void update(TokenDto tokenDTO, PointRuleFormDTO formDTO);
void add(TokenDto tokenDTO, PointRuleFormDTO formDTO);
/**
* @Description 根据evetCode和客户Id查找积分规则详情
* @param customerId
* @param eventCode
* @return
* @author wangc
* @date 2020.07.31 14:54
**/
PointRuleEntity getByEventCodeAndCustomerId(String customerId,String eventCode);
}

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

@ -23,6 +23,7 @@ import com.epmet.dto.PointVerificationLogDTO;
import com.epmet.dto.form.CommonPageUserFormDTO;
import com.epmet.dto.form.PointVerificationFormDTO;
import com.epmet.dto.form.WorkPointVerificationFormDTO;
import com.epmet.dto.result.PointExchangeResponseResultDTO;
import com.epmet.dto.result.PointVerificationResultDTO;
import com.epmet.dto.result.ResiPointLogListResultDTO;
import com.epmet.dto.result.WorkPointVerficationListResultDTO;
@ -125,4 +126,13 @@ public interface PointVerificationLogService extends BaseService<PointVerificati
* @date 2020.07.27 14:03
**/
PointVerificationResultDTO verifyPoint(PointVerificationFormDTO verificationParam);
/**
* @Description 居民端积分核销响应
* @param userId
* @return
* @author wangc
* @date 2020.07.31 16:09
**/
PointExchangeResponseResultDTO resiExchangeCallback(String userId);
}

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

@ -18,6 +18,7 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.UserPointActionLogDTO;
import com.epmet.dto.form.CommonPageUserFormDTO;
@ -112,6 +113,14 @@ public interface UserPointActionLogService extends BaseService<UserPointActionLo
* @author wangc
* @date 2020.07.29 09:11
**/
void grantPoint(SendPointFormDTO grantPointParam);
void grantPoint(List<SendPointFormDTO> grantPointParam);
/**
* @Description 通过事件推送进行积分加减
* @param event
* @return
* @author wangc
* @date 2020.07.31 13:45
**/
void grantPointByEvent(String eventCode,BasePointEventMsg event);
}

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

@ -169,6 +169,19 @@ public class PointRuleServiceImpl extends BaseServiceImpl<PointRuleDao, PointRul
insertOperateRecord(tokenDTO, entity, null, CommonOperateTypeEnum.ADD.getCode());
}
/**
* @Description 根据evetCode和客户Id查找积分规则详情
* @param customerId
* @param eventCode
* @return
* @author wangc
* @date 2020.07.31 14:54
**/
@Override
public PointRuleEntity getByEventCodeAndCustomerId(String customerId, String eventCode) {
return baseDao.selectByEventCodeAndCustomerId(customerId,eventCode);
}
private void insertOperateRecord(TokenDto tokenDTO, PointRuleEntity entityNew, PointRuleEntity entityDB, String opType) {
RuleOperateLogEntity record = new RuleOperateLogEntity();
if (tokenDTO != null) {

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

@ -17,11 +17,13 @@
package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
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;
@ -77,7 +79,7 @@ public class PointVerificationLogServiceImpl extends BaseServiceImpl<PointVerifi
@Autowired
private PointVerificationStatisticalDailyService pointVerificationStatisticalDailyService;
@Autowired
PointRedis pointRedis;
private PointRedis pointRedis;
@Autowired
private UserPointActionLogDao userPointActionLogDao;
@Autowired
@ -237,6 +239,14 @@ public class PointVerificationLogServiceImpl extends BaseServiceImpl<PointVerifi
@Transactional(rollbackFor = Exception.class)
public PointVerificationResultDTO verifyPoint(PointVerificationFormDTO verificationParam) {
String decodedUserId = pointRedis.checkIfQrCodeExpire(verificationParam.getUserId());
if(StringUtils.isNotBlank(decodedUserId)){
verificationParam.setUserId(decodedUserId);
}else{
logger.error(String.format("用户二维码失效,参数详情 -> 【】", JSON.toJSON(verificationParam)));
throw new RenException("用户二维码失效");
}
DimIdGenerator.DimIdBean dim = DimIdGenerator.getDimIdBean(new Date());
PointVerificationResultDTO result = new PointVerificationResultDTO();
ResiCommonUserIdFormDTO userId = new ResiCommonUserIdFormDTO();
@ -245,6 +255,12 @@ public class PointVerificationLogServiceImpl extends BaseServiceImpl<PointVerifi
if(null == currentPoint || null == currentPoint.getUsablePoint() || currentPoint.getUsablePoint() < verificationParam.getPoint()){
result.setSuccessFlag(false);
result.setFailureReason(ModuleConstant.POINT_NOT_ENOUGH);
PointExchangeResponseResultDTO resultCache = new PointExchangeResponseResultDTO();
resultCache.setResultFlag(false);
resultCache.setFailureReason(ModuleConstant.POINT_NOT_ENOUGH);
pointRedis.lpush(verificationParam.getUserId(),resultCache);
return result;
}
IssueInitiatorFormDTO staffId = new IssueInitiatorFormDTO();
@ -321,11 +337,18 @@ public class PointVerificationLogServiceImpl extends BaseServiceImpl<PointVerifi
userPointTotalService.insertOrUpdate(userPoint);
//6.将核销结果记录redis(List) key -> [epmet:point:verification:userId] lpush #新元素插入表头 lindex key 0 #表头
PointExchangeResponseResultDTO resultCache = new PointExchangeResponseResultDTO();
resultCache.setResultFlag(true);
resultCache.setOperatorName(operatorName);
resultCache.setPoint(point * NumConstant.ONE_NEG);
//工作人员没有头像
pointRedis.lpush(verificationParam.getUserId(),resultCache);
result.setSuccessFlag(true);
List<String> userParam = new LinkedList<>();
userParam.add(verificationParam.getUserId());
Result<List<UserBaseInfoResultDTO>> userResult =
epmetUserOpenFeignClient.queryUserBaseInfo(userParam);
epmetUserOpenFeignClient.queryUserBaseInfo(userParam);
String userHeadPhoto = ModuleConstant.EMPTY_STR;
String userNickname = ModuleConstant.EMPTY_STR;
if(userResult.success() && null != userResult.getData() && !userResult.getData().isEmpty()){
@ -337,6 +360,18 @@ public class PointVerificationLogServiceImpl extends BaseServiceImpl<PointVerifi
return result;
}
/**
* @Description 居民端积分核销响应
* @param userId
* @return
* @author wangc
* @date 2020.07.31 16:09
**/
@Override
public PointExchangeResponseResultDTO resiExchangeCallback(String userId) {
return (PointExchangeResponseResultDTO)pointRedis.lindex(userId,NumConstant.ZERO_L);
}
/**
* @Description 得到指定日所在月第一天
* @param date

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

@ -17,19 +17,25 @@
package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
import com.epmet.commons.tools.enums.EventEnum;
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.validator.ValidatorUtils;
import com.epmet.dao.UserPointActionLogDao;
import com.epmet.dto.UserPointActionLogDTO;
import com.epmet.dto.form.CommonPageUserFormDTO;
import com.epmet.dto.form.PointRuleListFormDTO;
import com.epmet.dto.result.ResiPointLogListResultDTO;
import com.epmet.dto.result.ResiPointLogPeriodResultDTO;
import com.epmet.entity.PointRuleEntity;
import com.epmet.entity.UserPointActionLogEntity;
import com.epmet.entity.UserPointStatisticalDailyEntity;
import com.epmet.entity.UserPointTotalEntity;
@ -41,10 +47,16 @@ import com.epmet.utils.ModuleConstant;
import com.github.pagehelper.PageHelper;
import com.google.common.collect.Maps;
import dto.form.SendPointFormDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.Validate;
import org.bouncycastle.math.raw.Mod;
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 org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.stream.Collectors;
@ -55,14 +67,16 @@ import java.util.stream.Collectors;
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-07-20
*/
@Slf4j
@Service
public class UserPointActionLogServiceImpl extends BaseServiceImpl<UserPointActionLogDao, UserPointActionLogEntity> implements UserPointActionLogService {
private static Logger logger = LoggerFactory.getLogger(UserPointActionLogServiceImpl.class);
@Autowired
private UserPointTotalService userPointTotalService;
@Autowired
private UserPointStatisticalDailyService userPointStatisticalDailyService;
@Autowired
private PointRuleServiceImpl pointRuleService;
@Override
public PageData<UserPointActionLogDTO> page(Map<String, Object> params) {
IPage<UserPointActionLogEntity> page = baseDao.selectPage(
@ -134,7 +148,7 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl<UserPointActi
Map<String, List<ResiPointLogPeriodResultDTO>> sortedMap = Maps.newLinkedHashMap();
map.entrySet().stream().sorted(Map.Entry.<String, List<ResiPointLogPeriodResultDTO>>comparingByKey().reversed())
.forEachOrdered(e -> sortedMap.put(e.getKey(), e.getValue()));
map.entrySet().forEach(e -> {
sortedMap.entrySet().forEach(e -> {
ResiPointLogListResultDTO o = new ResiPointLogListResultDTO();
o.setDate(e.getKey());
o.setDailyList(e.getValue());
@ -147,59 +161,164 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl<UserPointActi
/**
* @Description 消息网关回调进行积分发放
* @param grantPointParam
* @param grantPointList
* @return
* @author wangc
* @date 2020.07.29 09:11
**/
@Override
public void grantPoint(SendPointFormDTO grantPointParam){
if(StringUtils.equals(ModuleConstant.OPERATION_TYPE_MINUS,grantPointParam.getActionFlag())){
@Transactional(rollbackFor = Exception.class)
public void grantPoint(List<SendPointFormDTO> grantPointList){
if (CollectionUtils.isEmpty(grantPointList)){
log.warn("grantPoint param is empty");
return;
}
grantPointList.forEach(grantPoint->{
plusPoint(grantPoint);
});
}
/**
* @Description 通过事件推送进行积分加减
* @param event
* @return
* @author wangc
* @date 2020.07.31 13:45
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void grantPointByEvent(String eventCode,BasePointEventMsg event) {
if(!StringUtils.equals(EventEnum.REGISTER_VOLUNTEER.getEventTag(),eventCode) && !StringUtils.equals(EventEnum.ACTIVE_INSERT_LIVE.getEventTag(),eventCode)){
logger.error(String.format("无法识别事件类型与积分规则,消息体->【%s】", JSON.toJSON(event)));
throw new RenException("无法识别事件类型与积分规则");
}
PointRuleEntity ruleInfo = pointRuleService.getByEventCodeAndCustomerId(event.getCustomerId(),eventCode);
if(null != ruleInfo && StringUtils.equals(NumConstant.ONE_STR,ruleInfo.getEnabledFlag())){
//校验是否达到上限
if(ruleInfo.getUpLimit() > NumConstant.ZERO){
Integer sum = baseDao.selectSumByEvent(event.getUserId(),eventCode,event.getSourceId(),event.getCustomerId());
if(null == sum) sum = NumConstant.ZERO;
if(StringUtils.equals(ModuleConstant.OPERATION_TYPE_PLUS,ruleInfo.getOperateType())){
sum += ruleInfo.getPoint();
if(ruleInfo.getPoint() < NumConstant.ZERO){
//保证要加的积分是正数
ruleInfo.setPoint(ruleInfo.getPoint() * NumConstant.ONE_NEG);
}
}else{
//actionLog中存的是正负数,如果是减操作,则算出来的是负数相加
sum -= ruleInfo.getPoint() * NumConstant.ONE_NEG;
sum *= NumConstant.ONE_NEG;
if(ruleInfo.getPoint() > NumConstant.ZERO){
//保证要扣减的积分是负数
ruleInfo.setPoint(ruleInfo.getPoint() * NumConstant.ONE_NEG);
}
}
//这里sum一定是正数
if(ruleInfo.getUpLimit() < (sum + ruleInfo.getPoint())){
log.info(String.format("该用户获取此类事件的积分已达上限,详细数据->【%s】", JSON.toJSON(event)));
return ;
}
}
//完成校验,可以进行积分操作
//1.新增用户积分行为记录
UserPointActionLogEntity action = new UserPointActionLogEntity();
action.setCustomerId(event.getCustomerId());
action.setPoint(ruleInfo.getPoint());
action.setEventStatement(event.getRemark());
action.setEventName(EventEnum.getEnum(eventCode).getEventDesc());
action.setEventId(eventCode);
action.setActionFlag(event.getActionFlag());
action.setUserId(event.getUserId());
action.setCreatedBy(StringUtils.isBlank(event.getOperatorId()) ? ModuleConstant.CREATED_BY_SYSTEM : event.getOperatorId());
action.setUpdatedBy(StringUtils.isBlank(event.getOperatorId()) ? ModuleConstant.CREATED_BY_SYSTEM : event.getOperatorId());
action.setSourceId(event.getSourceId());
action.setOperatorAgencyId(event.getOpAgencyId());
baseDao.insert(action);
//2.新增/修改用户积分日统计
DimIdGenerator.DimIdBean dimVal = DimIdGenerator.getDimIdBean(new Date());
UserPointStatisticalDailyEntity statistical = ConvertUtils.sourceToTarget(dimVal,UserPointStatisticalDailyEntity.class);
statistical.setPointChange(ruleInfo.getPoint());
statistical.setActionFlag(event.getActionFlag());
statistical.setCustomerId(event.getCustomerId());
statistical.setUserId(event.getUserId());
statistical.setCreatedBy(StringUtils.isBlank(event.getOperatorId()) ? ModuleConstant.CREATED_BY_SYSTEM : event.getOperatorId());
statistical.setUpdatedBy(StringUtils.isBlank(event.getOperatorId()) ? ModuleConstant.CREATED_BY_SYSTEM : event.getOperatorId());
userPointStatisticalDailyService.insertOrUpdate(statistical);
//3.新增/修改用户积分日统计
UserPointTotalEntity point = new UserPointTotalEntity();
point.setCustomerId(event.getCustomerId());
point.setUserId(event.getUserId());
point.setTotalPoint(ruleInfo.getPoint());
point.setUsablePoint(ruleInfo.getPoint());
point.setUsedPoint(NumConstant.ZERO);
point.setCreatedBy(StringUtils.isBlank(event.getOperatorId()) ? ModuleConstant.CREATED_BY_SYSTEM : event.getOperatorId());
point.setUpdatedBy(StringUtils.isBlank(event.getOperatorId()) ? ModuleConstant.CREATED_BY_SYSTEM : event.getOperatorId());
userPointTotalService.insertOrUpdate(point);
}else{
log.error(String.format("未检测到该用户下有效的积分规则,消息体->【%s】", JSON.toJSON(event)));
throw new RenException("未检测到该用户下有效的积分规则");
}
}
private void plusPoint(SendPointFormDTO grantPoint) {
ValidatorUtils.validateEntity(grantPoint, SendPointFormDTO.SendPointGroup.class);
if(StringUtils.equals(ModuleConstant.OPERATION_TYPE_MINUS,grantPoint.getActionFlag())){
//减
if(grantPointParam.getPoint() > NumConstant.ZERO){
if(grantPoint.getPoint() > NumConstant.ZERO){
//保证负数
grantPointParam.setPoint(grantPointParam.getPoint() * NumConstant.ONE_NEG);
grantPoint.setPoint(grantPoint.getPoint() * NumConstant.ONE_NEG);
}
}else{
//加
if(grantPointParam.getPoint() < NumConstant.ZERO){
if(grantPoint.getPoint() < NumConstant.ZERO){
//保证正数
grantPointParam.setPoint(grantPointParam.getPoint() * NumConstant.ONE_NEG);
grantPoint.setPoint(grantPoint.getPoint() * NumConstant.ONE_NEG);
}
}
//1.新增用户积分行为记录
UserPointActionLogEntity action = new UserPointActionLogEntity();
action.setCustomerId(grantPointParam.getCustomerId());
action.setPoint(grantPointParam.getPoint());
action.setEventStatement(grantPointParam.getPointDesc());
action.setCustomerId(grantPoint.getCustomerId());
action.setPoint(grantPoint.getPoint());
action.setEventStatement(grantPoint.getRemark());
action.setEventName(EventEnum.ACTIVE_SEND_POINT.getEventDesc());
action.setEventId(EventEnum.ACTIVE_INSERT_LIVE.getEventTag());
action.setActionFlag(grantPointParam.getActionFlag());
action.setUserId(grantPointParam.getUserId());
action.setCreatedBy(grantPointParam.getOperatorId());
action.setUpdatedBy(grantPointParam.getOperatorId());
action.setSourceId(grantPointParam.getSourceId());
action.setOperatorAgencyId(grantPointParam.getOpAgencyId());
action.setActionFlag(grantPoint.getActionFlag());
action.setUserId(grantPoint.getUserId());
action.setCreatedBy(grantPoint.getOperatorId());
action.setUpdatedBy(grantPoint.getOperatorId());
action.setSourceId(grantPoint.getSourceId());
action.setOperatorAgencyId(grantPoint.getOpAgencyId());
baseDao.insert(action);
//2.新增/修改用户积分日统计
DimIdGenerator.DimIdBean dimVal = DimIdGenerator.getDimIdBean(new Date());
UserPointStatisticalDailyEntity statistical = ConvertUtils.sourceToTarget(dimVal,UserPointStatisticalDailyEntity.class);
statistical.setPointChange(grantPointParam.getPoint());
statistical.setActionFlag(grantPointParam.getActionFlag());
statistical.setCustomerId(grantPointParam.getCustomerId());
statistical.setUserId(grantPointParam.getUserId());
statistical.setCreatedBy(grantPointParam.getOperatorId());
statistical.setUpdatedBy(grantPointParam.getOperatorId());
statistical.setPointChange(grantPoint.getPoint());
statistical.setActionFlag(grantPoint.getActionFlag());
statistical.setCustomerId(grantPoint.getCustomerId());
statistical.setUserId(grantPoint.getUserId());
statistical.setCreatedBy(grantPoint.getOperatorId());
statistical.setUpdatedBy(grantPoint.getOperatorId());
userPointStatisticalDailyService.insertOrUpdate(statistical);
//3.新增/修改用户总积分
//3.新增/修改用户积分日统计
UserPointTotalEntity point = new UserPointTotalEntity();
point.setCustomerId(grantPointParam.getCustomerId());
point.setUserId(grantPointParam.getUserId());
point.setTotalPoint(grantPointParam.getPoint());
point.setUsablePoint(grantPointParam.getPoint());
point.setCustomerId(grantPoint.getCustomerId());
point.setUserId(grantPoint.getUserId());
point.setTotalPoint(grantPoint.getPoint());
point.setUsablePoint(grantPoint.getPoint());
point.setUsedPoint(NumConstant.ZERO);
point.setCreatedBy(grantPointParam.getOperatorId());
point.setUpdatedBy(grantPointParam.getOperatorId());
point.setCreatedBy(grantPoint.getOperatorId());
point.setUpdatedBy(grantPoint.getOperatorId());
userPointTotalService.insertOrUpdate(point);
}

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

@ -90,4 +90,6 @@ public interface ModuleConstant extends Constant {
String EVENT_NAME_EXCHANGE = "积分兑换";
String POINT_NOT_ENOUGH = "积分余额不足";
String CREATED_BY_SYSTEM = "SYSTEM";
}

7
epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml

@ -116,4 +116,9 @@ ribbon:
#pageHelper分页插件
pagehelper:
helper-dialect: mysql
reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1
reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1
dingTalk:
robot:
webHook: @dingTalk.robot.webHook@
secret: @dingTalk.robot.secret@

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

@ -26,11 +26,10 @@
operator_name AS staffNickname,
adjust_reason AS reason,
DATE_FORMAT( created_time, '%Y-%m-%d %H:%i:%s' ) AS date,
CASE
CASE
ADJUSTMENT_TYPE
WHEN 'plus' THEN
CONCAT( '+', POINT ) ELSE CONCAT( '-', POINT )
END AS POINT
CONCAT( '+', POINT ) ELSE POINT END AS POINT
FROM
point_adjustment_log
WHERE

10
epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRuleDao.xml

@ -26,7 +26,7 @@
SELECT DISTINCT FUNCTION_ID FROM point_rule WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR}
</select>
<select id="selectListByFunctionId" resultMap="pointRuleMap">
SELECT ID,RULE_NAME,RULE_DESC,POINT,POINT_UNIT FROM point_rule WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR}
SELECT ID,RULE_NAME,RULE_DESC,POINT,POINT_UNIT,ENABLED_FLAG FROM point_rule WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND FUNCTION_ID = #{functionId,jdbcType=VARCHAR}
</select>
<update id="updateByCustomerId">
UPDATE point_rule
@ -36,4 +36,12 @@
UP_LIMIT = #{upLimit,jdbcType=INTEGER}
WHERE id = #{id,jdbcType=VARCHAR} and CUSTOMER_ID = #{customerId,jdbcType=VARCHAR}
</update>
<select id="selectByEventCodeAndCustomerId" resultType="com.epmet.entity.PointRuleEntity">
SELECT ID,RULE_NAME,RULE_DESC,POINT,POINT_UNIT,ENABLED_FLAG,UP_LIMIT,OPERATE_TYPE
FROM point_rule
WHERE
DEL_FLAG = '0'
CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND EVENT_CODE = #{eventCode,jdbcType=VARCHAR}
</select>
</mapper>

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

@ -27,7 +27,7 @@
SELECT
EVENT_NAME AS TITLE,
EVENT_STATEMENT AS REMARK,
CASE ACTION_FLAG WHEN 'plus' THEN concat('+',POINT) WHEN 'minus' THEN concat('-',POINT) END AS point,
CASE ACTION_FLAG WHEN 'plus' THEN concat('+',POINT) ELSE POINT END AS point,
DATE_FORMAT(CREATED_TIME,'%Y-%m-%d') AS DATE,
DATE_FORMAT(CREATED_TIME,'%H:%i') AS TIME
FROM
@ -40,4 +40,22 @@
CREATED_TIME DESC
</select>
<!-- 查询指定用户在某条规则下所得的积分总和 -->
<select id="selectSumByEvent" resultType="integer">
SELECT
SUM( POINT )
FROM
USER_POINT_ACTION_LOG
WHERE
DEL_FLAG = '0'
AND USER_ID = #{userId}
AND EVENT_ID = #{eventCode}
<if test='null != customerId and "" != customerId'>
AND CUSTOMER_ID = #{customerId}
</if>
<if test='null != sourceId and "" != sourceId'>
AND SOURCE_ID = #{sourceId}
</if>
</select>
</mapper>

5
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeCustomerDTO.java

@ -78,6 +78,11 @@ public class CodeCustomerDTO implements Serializable {
*/
private String userDesc;
/**
* 数据来源(dev:开发 test:体验 prod:生产)
*/
private String source;
/**
* 状态 未审核:unaudited审核中:auditing审核成功audit_success审核被拒绝audit_failed已撤回:withdrawn审核延后:delay发布成功release_success, 发布失败release_failed
*/

4
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/UploadListFormDTO.java

@ -43,4 +43,8 @@ public class UploadListFormDTO implements Serializable {
* 页面条数
*/
private Integer pageSize;
/**
* 数据来源(dev:开发 test:体验 prod:生产)
*/
private String source;
}

6
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CustomerUserResultDTO.java

@ -16,15 +16,15 @@ public class CustomerUserResultDTO implements Serializable {
private static final long serialVersionUID = 5214475907074876716L;
/**
* 用户信息
* 用户信息 别名不能随便修改 否则影响程序
*/
private PaUserDTO paUserResult;
/**
* 用户对应的客户信息
* 用户对应的客户信息 别名不能随便修改 否则影响程序
*/
private PaCustomerDTO paCustomerResult;
/**
* 用户对应的微信基本信息
* 用户对应的微信基本信息 别名不能随便修改 否则影响程序
*/
private PaUserWechatDTO paUserWechatResult;
}

6
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/InitCustomerResultDTO.java

@ -17,15 +17,15 @@ public class InitCustomerResultDTO implements Serializable {
private static final long serialVersionUID = 3253989119352850315L;
/**
* 注册客户信息
* 注册客户信息 别名不能随便修改 否则影响程序
*/
private PaCustomerDTO paCustomer;
/**
* 注册客户组织信息
* 注册客户组织信息 别名不能随便修改 否则影响程序
*/
private PaCustomerAgencyDTO paAgency;
/**
* 注册客户管理员信息
* 注册客户管理员信息 别名不能随便修改 否则影响程序
*/
private PaUserDTO paUser;

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.82
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.91
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.82</version>
<version>0.0.91</version>
<parent>
<groupId>com.epmet</groupId>

9
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AppLetAuthorizationController.java

@ -10,10 +10,7 @@ import com.epmet.dto.form.RemoveBindFormDTO;
import com.epmet.dto.result.GoToAuthResultDTO;
import com.epmet.service.AppLetAuthorizationService;
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 org.springframework.web.bind.annotation.*;
/**
* @Author zxc
@ -32,9 +29,9 @@ public class AppLetAuthorizationController {
* @author zxc
*/
@PostMapping("gotoauth")
public Result<GoToAuthResultDTO> goToAuth(@LoginUser TokenDto tokenDto, @RequestBody GoToAuthFormDTO formDTO){
public Result<GoToAuthResultDTO> goToAuth(@LoginUser TokenDto tokenDto, @RequestBody GoToAuthFormDTO formDTO, @RequestHeader("source")String source){
ValidatorUtils.validateEntity(formDTO);
GoToAuthResultDTO goToAuthResultDTO = appLetAuthorizationService.goToAuth(tokenDto,formDTO);
GoToAuthResultDTO goToAuthResultDTO = appLetAuthorizationService.goToAuth(tokenDto,formDTO,source);
return new Result().ok(goToAuthResultDTO);
}

7
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/BusinessInfoDao.java

@ -41,4 +41,11 @@ public interface BusinessInfoDao extends BaseDao<BusinessInfoEntity> {
*/
void insertBusinessInfo(@Param("businessInfoList") List<BusinessInfoFormDTO> businessInfoList);
/**
* @Description 功能开通信息删除
* @param
* @author zxc
*/
void deleteBusinessInfo(@Param("customerId")String customerId,@Param("clientType")String clientType);
}

4
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeCustomerDao.java

@ -76,9 +76,9 @@ public interface CodeCustomerDao extends BaseDao<CodeCustomerEntity> {
* 获取审核中代码列表
* @author zhaoqifeng
* @date 2020/7/15 18:17
* @param
* @param source
* @return java.util.List<com.epmet.dto.CodeCustomerDTO>
*/
List<CodeCustomerDTO> selectAuditingCodeList();
List<CodeCustomerDTO> selectAuditingCodeList(@Param("source") String source);
}

7
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniCategoryInfoDao.java

@ -41,4 +41,11 @@ public interface MiniCategoryInfoDao extends BaseDao<MiniCategoryInfoEntity> {
*/
void insertCategoryInfo(@Param("miniCategoryInfoList") List<MiniCategoryInfoFormDTO> miniCategoryInfoList);
/**
* @Description 小程序配置的类目信息删除
* @param
* @author zxc
*/
void deleteCategoryInfo(@Param("customerId")String customerId,@Param("clientType")String clientType);
}

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

@ -40,6 +40,13 @@ public interface MiniInfoDao extends BaseDao<MiniInfoEntity> {
*/
void insertMiniInfo(MiniInfoFormDTO formDTO);
/**
* @Description 删除小程序信息
* @param formDTO
* @author zxc
*/
void deleteMiniInfo(MiniInfoFormDTO formDTO);
/**
* @Description 根据原始ID查询 customerId clientType
* @param toUserName

7
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniNetworkInfoDao.java

@ -41,4 +41,11 @@ public interface MiniNetworkInfoDao extends BaseDao<MiniNetworkInfoEntity> {
*/
void insertNetworkInfo(@Param("networkInfoList") List<MiniNetworkInfoFormDTO> networkInfoList);
/**
* @Description 小程序配置的合法域名信息删除
* @param
* @author zxc
*/
void deleteNetworkInfo(@Param("customerId")String customerId,@Param("clientType")String clientType);
}

5
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeCustomerEntity.java

@ -78,6 +78,11 @@ public class CodeCustomerEntity extends BaseEpmetEntity {
*/
private String userDesc;
/**
* 数据来源(dev:开发 test:体验 prod:生产)
*/
private String source;
/**
* 状态 未审核:unaudited审核中:auditing审核成功audit_success审核被拒绝audit_failed已撤回:withdrawn审核延后:delay发布成功release_success, 发布失败release_failed
*/

2
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/AppLetAuthorizationService.java

@ -17,7 +17,7 @@ public interface AppLetAuthorizationService {
* @param tokenDto
* @author zxc
*/
GoToAuthResultDTO goToAuth(TokenDto tokenDto, GoToAuthFormDTO formDTO);
GoToAuthResultDTO goToAuth(TokenDto tokenDto, GoToAuthFormDTO formDTO,String source);
/**
* @Description 将公众号/小程序从开放平台帐号下解绑

2
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeCustomerService.java

@ -110,7 +110,7 @@ public interface CodeCustomerService extends BaseService<CodeCustomerEntity> {
* @param
* @return java.util.List<com.epmet.dto.CodeCustomerDTO>
*/
List<CodeCustomerDTO> getAuditingCodeList();
List<CodeCustomerDTO> getAuditingCodeList(String source);
/**
* 删除旧代码记录

6
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/AppLetAuthorizationServiceImpl.java

@ -55,14 +55,16 @@ public class AppLetAuthorizationServiceImpl implements AppLetAuthorizationServic
* @author zxc
*/
@Override
public GoToAuthResultDTO goToAuth(TokenDto tokenDto, GoToAuthFormDTO formDTO) {
public GoToAuthResultDTO goToAuth(TokenDto tokenDto, GoToAuthFormDTO formDTO,String source) {
GoToAuthResultDTO result = new GoToAuthResultDTO();
String userId = tokenDto.getUserId();
//获取预授权码
String preAuthCode = componentVerifyTicketService.preAuthCode();
String redirectUrl = WxMaCodeConstant.WEB_URL + formDTO.getClientType();
// String redirectUrl = WxMaCodeConstant.WEB_URL + formDTO.getClientType();
String redirectUrl = String.format(WxMaCodeConstant.WEB_URL,source,formDTO.getClientType());
String authUrl = String.format(WxMaCodeConstant.API_AUTH_REGISTER_URL, componentAppId, preAuthCode, redirectUrl);
result.setUrl(authUrl);
log.info("返回URL:"+result.getUrl());
return result;
}

4
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeCustomerServiceImpl.java

@ -115,8 +115,8 @@ public class CodeCustomerServiceImpl extends BaseServiceImpl<CodeCustomerDao, Co
}
@Override
public List<CodeCustomerDTO> getAuditingCodeList() {
return baseDao.selectAuditingCodeList();
public List<CodeCustomerDTO> getAuditingCodeList(String source) {
return baseDao.selectAuditingCodeList(source);
}
@Override

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

@ -152,6 +152,7 @@ public class CodeServiceImpl implements CodeService {
//将上传信息存入表中
CodeCustomerDTO codeCustomerDTO = ConvertUtils.sourceToTarget(formDTO, CodeCustomerDTO.class);
codeCustomerDTO.setCustomerName(paCustomerDTO.getCustomerName());
codeCustomerDTO.setSource(paCustomerDTO.getSource());
codeCustomerDTO.setExtJson(extJson);
codeCustomerDTO.setAppId(authInfo.getAuthorizerAppid());
codeCustomerDTO.setStatus(CodeConstant.UNAUDITED);
@ -162,7 +163,7 @@ public class CodeServiceImpl implements CodeService {
@Override
public PageData uploadList(UploadListFormDTO formDTO) {
List<CodeCustomerDTO> auditingList = codeCustomerService.getAuditingCodeList();
List<CodeCustomerDTO> auditingList = codeCustomerService.getAuditingCodeList(formDTO.getSource());
if (null != auditingList && auditingList.size() > NumConstant.ZERO) {
auditingList.forEach(code -> {
//获取小程序调用令牌

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

@ -125,7 +125,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
switch (infotype){
case ModuleConstant.TICKET_UNDERLINE_KEY: //接收票据 【component_verify_ticket】
String ComponentVerifyTicket = result.get(ModuleConstant.TICKET_KEY);
log.info(String.format(COMPONENT_VERIFY_TICKET));
log.info(String.format(COMPONENT_VERIFY_TICKET,ComponentVerifyTicket));
// 缓存 ticket
redisThird.setComponentVerifyTicket(ComponentVerifyTicket);
// 存数据库
@ -437,6 +437,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
miniInfoFormDTO.setCustomerId(customerId);
miniInfoFormDTO.setClientType(clientType);
//基础信息插入
miniInfoDao.deleteMiniInfo(miniInfoFormDTO);
miniInfoDao.insertMiniInfo(miniInfoFormDTO);
String primaryId = miniInfoFormDTO.getId();
//todo 功能的开通状况信息插入
@ -451,6 +452,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
businessInfoForm.setPrimaryId(primaryId);
businessInfoList.add(businessInfoForm);
});
businessInfoDao.deleteBusinessInfo(customerId,clientType);
businessInfoDao.insertBusinessInfo(businessInfoList);
//todo 小程序配置的合法域名信息插入
Map miniProgramInfo = (Map) authorizerInfo.get(ModuleConstant.MINI_PROGRAM_INFO);
@ -465,6 +467,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
miniNetworkInfoForm.setPrimaryId(primaryId);
networkInfoList.add(miniNetworkInfoForm);
});
miniNetworkInfoDao.deleteNetworkInfo(customerId,clientType);
miniNetworkInfoDao.insertNetworkInfo(networkInfoList);
//todo 小程序配置的类目信息插入
List<MiniCategoryInfoFormDTO> categoryInfoList = new ArrayList<>();
@ -481,6 +484,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
categoryInfoList.add(categoryInfo);
});
});
miniCategoryInfoDao.deleteCategoryInfo(customerId, clientType);
miniCategoryInfoDao.insertCategoryInfo(categoryInfoList);
}
}else {
@ -501,6 +505,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
businessInfoForm.setPrimaryId(primaryId);
businessInfoList.add(businessInfoForm);
});
businessInfoDao.deleteBusinessInfo(customerId,clientType);
businessInfoDao.insertBusinessInfo(businessInfoList);
}
log.info("保存授权方基本信息结束");

2
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaCustomerServiceImpl.java

@ -210,6 +210,7 @@ public class PaCustomerServiceImpl extends BaseServiceImpl<PaCustomerDao, PaCust
visitedEntity.setWxOpenId(wechatEntity.getWxOpenId());
visitedEntity.setOpenId(wechatEntity.getWxOpenId());
visitedEntity.setPhone(formDTO.getPhone());
visitedEntity.setSource(formDTO.getSource());
if (paUserVisitedDao.insert(visitedEntity) < NumConstant.ONE) {
throw new RenException(PaConstant.SAVE_VISITED_EXCEPTION);
}
@ -240,6 +241,7 @@ public class PaCustomerServiceImpl extends BaseServiceImpl<PaCustomerDao, PaCust
visitedEntity.setWxOpenId(wechatEntity.getWxOpenId());
visitedEntity.setOpenId(wechatEntity.getWxOpenId());
visitedEntity.setPhone(formDTO.getPhone());
visitedEntity.setSource(formDTO.getSource());
if (paUserVisitedDao.insert(visitedEntity) < NumConstant.ONE) {
throw new RenException(PaConstant.SAVE_VISITED_EXCEPTION);
}

2
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java

@ -33,7 +33,7 @@ public interface WxMaCodeConstant {
/**
* 前端地址 授权之后的跳转的地址
*/
String WEB_URL = "https://epmet-cloud.elinkservice.cn/third/mpweb/page/#/info?clientType=";
String WEB_URL = "https://epmet-cloud.elinkservice.cn/third/mpweb/page/%s/#/info?clientType=%s";
/**
* 授权注册页面扫码授权

3
epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.3__thirdUpdate.sql

@ -0,0 +1,3 @@
alter table pa_user add SOURCE varchar(32) comment '数据来源(dev:开发 test:体验 prod:生产)' NOT NULL;
alter table pa_user_visited add SOURCE varchar(32) comment '数据来源(dev:开发 test:体验 prod:生产)' NOT NULL;
alter table pa_customer add SOURCE varchar(32) comment '数据来源(dev:开发 test:体验 prod:生产)' NOT NULL;

11
epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/BusinessInfoDao.xml

@ -24,4 +24,15 @@
)
</foreach>
</insert>
<!-- 功能开通信息删除 -->
<delete id="deleteBusinessInfo">
DELETE
FROM
business_info
WHERE
del_flag = 0
AND customer_id = #{customerId}
AND client_type = #{clientType}
</delete>
</mapper>

3
epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeCustomerDao.xml

@ -38,6 +38,7 @@
LEFT JOIN code_audit_result car ON cc.ID = car.CODE_ID AND car.DEL_FLAG = '0'
WHERE
cc.DEL_FLAG = '0'
AND cc.SOURCE = #{source}
<if test="customerId != null and customerId.trim() != ''">
AND cc.CUSTOMER_ID = #{customerId}
</if>
@ -85,7 +86,7 @@
AND template_id = #{templateId}
</select>
<select id="selectAuditingCodeList" resultType="com.epmet.dto.CodeCustomerDTO">
select * FROM code_customer WHERE DEL_FLAG = '0' AND STATUS = 'auditing'
select * FROM code_customer WHERE DEL_FLAG = '0' AND STATUS = 'auditing' AND SOURCE = #{source}
</select>
<update id="deleteCode">
UPDATE code_customer

2
epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CustomerMpDao.xml

@ -72,7 +72,7 @@
WHERE
cm.del_flag = '0'
AND pc.del_flag = '0'
AND pc.source = '#{source}'
AND pc.source = #{source}
ORDER BY
cm.customer_id ASC,
cm.client ASC

11
epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniCategoryInfoDao.xml

@ -24,4 +24,15 @@
)
</foreach>
</insert>
<!-- 小程序配置的类目信息删除 -->
<delete id="deleteCategoryInfo">
DELETE
FROM
mini_category_info
WHERE
del_flag = 0
AND customer_id = #{customerId}
AND client_type = #{clientType}
</delete>
</mapper>

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

@ -6,7 +6,7 @@
<!-- 插入小程序信息 -->
<insert id="insertMiniInfo">
<selectKey keyProperty="id" order="AFTER" resultType="String">
SELECT LAST_INSERT_ID() AS id
SELECT id AS id from mini_info where del_flag = 0 and customer_id = #{customerId} and client_type = #{clientType} order by created_time desc limit 1
</selectKey>
INSERT INTO mini_info ( ID, CUSTOMER_ID, CLIENT_TYPE, NICK_NAME, HEAD_IMG, SERVICE_TYPE_INFO, VERIFY_TYPE_INFO, USER_NAME,
PRINCIPAL_NAME, SIGNATURE, QRCODE_URL, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME)
@ -32,6 +32,17 @@
)
</insert>
<!-- 删除小程序信息 -->
<delete id="deleteMiniInfo">
DELETE
FROM
mini_info
WHERE
del_flag = 0
AND customer_id = #{customerId}
AND client_type = #{clientType}
</delete>
<!-- 根据原始ID查询 customerId 和 clientType -->
<select id="selectCustomerIdAndClientByToUserName" resultType="com.epmet.dto.result.CustomerIdAndClientResultDTO">
SELECT

11
epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniNetworkInfoDao.xml

@ -24,4 +24,15 @@
)
</foreach>
</insert>
<!-- 小程序配置的合法域名信息删除 -->
<delete id="deleteNetworkInfo">
DELETE
FROM
mini_network_info
WHERE
del_flag = 0
AND customer_id = #{customerId}
AND client_type = #{clientType}
</delete>
</mapper>

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.57
image: 192.168.1.130:10080/epmet-cloud-dev/oper-crm-server:0.3.58
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.57</version>
<version>0.3.58</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>oper-crm</artifactId>

11
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java

@ -414,11 +414,12 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerDao, CustomerEn
}
Object RegisterResult = thirdResult.getData();
JSONObject jsonObject = JSON.parseObject(RegisterResult.toString());
InitCustomerResultDTO initCustomer = ConvertUtils.mapToEntity(jsonObject, InitCustomerResultDTO.class);
PaCustomerDTO paCustomer = initCustomer.getPaCustomer();
PaCustomerAgencyDTO paAgency = initCustomer.getPaAgency();
PaUserDTO paUser = initCustomer.getPaUser();
Map<String,Object> map1 = (Map)jsonObject.get("paCustomer");
PaCustomerDTO paCustomer = ConvertUtils.mapToEntity(map1, PaCustomerDTO.class);
Map<String,Object> map2 = (Map)jsonObject.get("paAgency");
PaCustomerAgencyDTO paAgency = ConvertUtils.mapToEntity(map2, PaCustomerAgencyDTO.class);
Map<String,Object> map3 = (Map)jsonObject.get("paUser");
PaUserDTO paUser = ConvertUtils.mapToEntity(map3, PaUserDTO.class);
//2.校验当前客户是否已初始化,不存在则初始客户信息
CustomerEntity entity = baseDao.selectById(formDTO.getCustomerId());

1
epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.2__addCutomerApp.sql → epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/addCutomerApp.sql

@ -1,3 +1,4 @@
#由于程序启动顺序问题 暂不加入flyway
CREATE TABLE `customer_app` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id',

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

@ -2,7 +2,7 @@ version: "3.7"
services:
resi-mine-server:
container_name: resi-mine-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/resi-mine-server:0.3.32
image: 192.168.1.130:10080/epmet-cloud-dev/resi-mine-server:0.3.33
ports:
- "8094:8094"
network_mode: host # 使用现有网络

2
epmet-module/resi-mine/resi-mine-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.32</version>
<version>0.3.33</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>resi-mine</artifactId>

2
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/controller/MineController.java

@ -65,7 +65,7 @@ public class MineController {
* @return
*/
@PostMapping("generateshortuserid")
Result<ShortUserIdInfoResultDTO> generateShortUserId(TokenDto tokenDto, @RequestBody GenerateShortUserIdFormDTO formDTO) {
Result<ShortUserIdInfoResultDTO> generateShortUserId(@LoginUser TokenDto tokenDto, @RequestBody GenerateShortUserIdFormDTO formDTO) {
String userId = tokenDto.getUserId();
GenerateShortUserIdBizTypeEnum bizTypeEnum = GenerateShortUserIdBizTypeEnum.getEnum(formDTO.getBizType());
if (bizTypeEnum == null) {

116
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiVolunteerAuthenticateFormDTO.java

@ -0,0 +1,116 @@
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;
/**
* 志愿者认证 入参
*
* @Auther: zhangyong
* @Date: 2020-07-23 09:57
*/
@Data
public class ResiVolunteerAuthenticateFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 添加用户操作的内部异常分组
* 出现错误会提示给前端7000错误码返回信息为服务器开小差...
*/
/**
* 添加用户操作的用户可见异常分组
* 该分组用于校验需要返回给前端错误信息提示的列需要继承CustomerClientShowGroup
* 返回错误码为8999提示信息为DTO中具体的列的校验注解message的内容
*/
/**
* 用户id
*/
private String userId;
/**
* 客户id
*/
@NotBlank(message = "客户id不能为空")
private String customerId;
/**
*
*/
@NotBlank(message = "姓不能为空")
private String surname;
/**
*
*/
@NotBlank(message = "名不能为空")
private String name;
/**
* 性别1男2女0未知
*/
@NotBlank(message = "性别不能为空")
private String gender;
/**
* 手机号
*/
@NotBlank(message = "手机号不能为空")
private String mobile;
/**
* 身份证号码
*/
@NotBlank(message = "身份证号码不能为空")
private String idNum;
/**
* 街道
*/
@NotBlank(message = "街道不能为空")
private String street;
/**
* 小区名
*/
@NotBlank(message = "小区名不能为空")
private String district;
/**
* 楼栋单元
*/
@NotBlank(message = "楼栋单元不能为空")
private String buildingAddress;
/**
* 志愿者自我介绍
*/
private String volunteerIntroduce;
/**
* 昵称
*/
@NotBlank(message = "昵称不能为空")
private String nickname;
/**
* 头像
*/
@NotBlank(message = "头像不能为空")
private String avatarUrl;
/**
* 志愿者签名
*/
private String volunteerSignature;
}

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

@ -239,4 +239,14 @@ public interface EpmetUserOpenFeignClient {
**/
@PostMapping("/epmetuser/userbaseinfo/selectuserbaseinfo")
Result<ResiUserBaseInfoResultDTO> selectUserBaseInfo(@RequestBody TokenDto tokenDTO);
/**
* @Description 认证志愿者时保存/修改用户基础信息
* @param param
* @return
* @author wangc
* @date 2020.07.31 09:38
**/
@PostMapping("/epmetuser/userbaseinfo/volunteerbaseinfo")
Result volunteerBaseInfo(@RequestBody ResiVolunteerAuthenticateFormDTO param);
}

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

@ -173,4 +173,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
public Result<ResiUserBaseInfoResultDTO> selectUserBaseInfo(TokenDto tokenDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "selectUserBaseInfo", tokenDTO);
}
@Override
public Result volunteerBaseInfo(ResiVolunteerAuthenticateFormDTO param) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "volunteerBaseInfo", param);
}
}

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

@ -29,6 +29,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.UserBaseInfoDTO;
import com.epmet.dto.form.IssueInitiatorFormDTO;
import com.epmet.dto.form.ResiVolunteerAuthenticateFormDTO;
import com.epmet.dto.result.CustomerUserDetailResultDTO;
import com.epmet.dto.result.ResiUserBaseInfoResultDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
@ -162,4 +163,17 @@ public class UserBaseInfoController {
public Result<ResiUserBaseInfoResultDTO> selectUserBaseInfo(@LoginUser TokenDto tokenDTO){
return userBaseInfoService.selecUserBaseInfoByUserId(tokenDTO.getUserId());
}
/**
* @Description 认证志愿者时保存/修改用户基础信息
* @param param
* @return
* @author wangc
* @date 2020.07.31 09:38
**/
@PostMapping("volunteerbaseinfo")
public Result volunteerBaseInfo(@RequestBody ResiVolunteerAuthenticateFormDTO param){
userBaseInfoService.saveUserBaseInfoWhenAuthVolunteer(param);
return new Result();
}
}

10
epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.UserBaseInfoDTO;
import com.epmet.dto.form.ResiVolunteerAuthenticateFormDTO;
import com.epmet.dto.result.CustomerUserDetailResultDTO;
import com.epmet.dto.result.ResiUserBaseInfoResultDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
@ -142,4 +143,13 @@ public interface UserBaseInfoService extends BaseService<UserBaseInfoEntity> {
* @Date 15:20 2020-07-28
**/
Result<ResiUserBaseInfoResultDTO> selecUserBaseInfoByUserId(String userId);
/**
* @Description 认证志愿者时保存/修改用户基础信息
* @param param
* @return
* @author wangc
* @date 2020.07.31 09:38
**/
void saveUserBaseInfoWhenAuthVolunteer(ResiVolunteerAuthenticateFormDTO param);
}

30
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java

@ -31,6 +31,7 @@ import com.epmet.dao.UserWechatDao;
import com.epmet.dto.UserBaseInfoDTO;
import com.epmet.dto.UserResiInfoDTO;
import com.epmet.dto.UserWechatDTO;
import com.epmet.dto.form.ResiVolunteerAuthenticateFormDTO;
import com.epmet.dto.result.CustomerUserDetailResultDTO;
import com.epmet.dto.result.ResiUserBaseInfoResultDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
@ -45,10 +46,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 用户基础信息
@ -261,4 +259,28 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl<UserBaseInfoDao, Us
public Result<ResiUserBaseInfoResultDTO> selecUserBaseInfoByUserId(String userId) {
return new Result<ResiUserBaseInfoResultDTO>().ok(baseDao.selecUserBaseInfoByUserId(userId));
}
/**
* @Description 认证志愿者时保存/修改用户基础信息
* @param param
* @return
* @author wangc
* @date 2020.07.31 09:38
**/
@Override
public void saveUserBaseInfoWhenAuthVolunteer(ResiVolunteerAuthenticateFormDTO param) {
UserWechatDTO userWechatDTO = new UserWechatDTO();
userWechatDTO.setUserId(param.getUserId());
userWechatDTO.setNickname(StringUtils.isBlank(param.getNickname()) ? ModuleConstant.EMPTY_STR : param.getNickname());
if(StringUtils.isBlank(param.getGender())) param.setGender(NumConstant.ZERO_STR);
userWechatDTO.setSex(Integer.parseInt(param.getGender()));
userWechatDTO.setHeadImgUrl(param.getAvatarUrl());
userWechatDTO.setUpdatedTime(new Date());
userWechatDTO.setUpdatedBy(param.getUserId());
userWechatDao.updateByUserId(userWechatDTO);
UserBaseInfoEntity baseInfo = ConvertUtils.sourceToTarget(param,UserBaseInfoEntity.class);
baseInfo.setHeadImgUrl(param.getAvatarUrl());
insertOrUpdate(baseInfo);
}
}

2
epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml

@ -108,7 +108,7 @@
<if test ='null != nickname and "" != nickname'>nickname = #{nickname},</if>
<if test ='null != headImgUrl and "" != headImgUrl'>head_img_url = #{headImgUrl},</if>
<if test ='null != delFlag and "" != delFlag'>del_flag = #{delFlag},</if>
updated_by = #{updatedBy},
updated_by = #{userId},
updated_time = now()
</set>
WHERE id = #{id}

Loading…
Cancel
Save