Browse Source

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

dev_shibei_match
sunyuchao 5 years ago
parent
commit
cf23addc6c
  1. 4
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 27
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActRegistrationResultDTO.java
  3. 86
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiVolunteerInfoResultDTO.java
  4. 23
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserHistoricalActInfoDTO.java
  5. 2
      epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml
  6. 2
      epmet-module/epmet-heart/epmet-heart-server/pom.xml
  7. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java
  8. 23
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java
  9. 11
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java
  10. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java
  11. 10
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java
  12. 46
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java
  13. 26
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java
  14. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java
  15. 24
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml
  16. 10
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml
  17. 18
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  18. 6
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  19. 2
      epmet-user/epmet-user-server/deploy/docker-compose-dev.yml
  20. 2
      epmet-user/epmet-user-server/pom.xml
  21. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java
  22. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java

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

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

27
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActRegistrationResultDTO.java

@ -1,27 +0,0 @@
package com.epmet.dto.result.resi;
import lombok.Data;
import java.io.Serializable;
/**
* 活动报名 - 返回值
*
* @Auther: zhangyong
* @Date: 2020-07-28 16:22
*/
@Data
public class ResiActRegistrationResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 异常编码
*/
private Integer flag;
/**
* 提示信息
*/
private String tip;
}

86
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiVolunteerInfoResultDTO.java

@ -0,0 +1,86 @@
package com.epmet.dto.result.resi;
import lombok.Data;
import java.io.Serializable;
/**
* 志愿者信息+用户基础信息 返回值
* @Auther: zhangyong
* @Date: 2020-07-28 14:40
*/
@Data
public class ResiVolunteerInfoResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 用户id
*/
private String userId;
/**
* 手机号(注册手机号)
*/
private String mobile;
/**
* 姓氏
*/
private String surname;
/**
*
*/
private String name;
/**
* 姓名
*/
private String realName;
/**
* 身份证号
*/
private String idNum;
/**
* 性别1男2女0未知
*/
private String gender;
/**
* 街道
*/
private String street;
/**
* 小区名称
*/
private String district;
/**
* 楼栋单元
*/
private String buildingAddress;
/**
* 昵称(目前来源于微信昵称后续系统可支持用户有昵称)
*/
private String nickname;
/**
* 头像目前来源于微信后续系统顾客支持上传头像
*/
private String headImgUrl;
/**
* 志愿者签名
*/
private String volunteerSignature;
/**
* 志愿者自我介绍
*/
private String volunteerIntroduce;
}

23
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserHistoricalActInfoDTO.java

@ -53,4 +53,27 @@ public class UserHistoricalActInfoDTO implements Serializable {
* 已处理: handled; 默认"",重新处理时reward_flag置为空字符串
*/
private String processFlag;
// 新增以下参数
/**
* 活动状态
已发布/报名中published
已取消canceled;
已结束finished
*/
private String actStatus;
/**
* 当前状态已报名/待审核auditing
审核通过passed
审核不通过refused
取消报名canceled
*/
private String userActStatus;
/**
* true已签到false未签到
*/
private Boolean signInFlag;
}

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.13
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-heart-server:0.0.14
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.13</version>
<version>0.0.14</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

@ -294,12 +294,12 @@ public class ResiActListController {
*
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.resi.ResiActRegistrationResultDTO>
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 16:26 2020-07-28
**/
@PostMapping("registration")
public Result<ResiActRegistrationResultDTO> registration(@LoginUser TokenDto tokenDto, @RequestBody ResiActRegistrationFormDTO formDTO) {
public Result registration(@LoginUser TokenDto tokenDto, @RequestBody ResiActRegistrationFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ResiActRegistrationFormDTO.AddUserInternalGroup.class);
return actUserRelationService.registration(tokenDto, formDTO);
}

23
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java

@ -23,6 +23,8 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.resi.ResiActUserCancelSignUpFormDTO;
import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO;
import com.epmet.dto.result.ResiUserBaseInfoResultDTO;
import com.epmet.dto.result.resi.ResiVolunteerInfoResultDTO;
import com.epmet.service.VolunteerInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -44,9 +46,30 @@ public class ResiVolunteerController {
@Autowired
private VolunteerInfoService volunteerInfoService;
/**
* 志愿者认证
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 13:59 2020-07-30
**/
@PostMapping("authenticate")
public Result authenticate(@LoginUser TokenDto tokenDto, @RequestBody ResiVolunteerAuthenticateFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ResiVolunteerAuthenticateFormDTO.AddUserInternalGroup.class, ResiVolunteerAuthenticateFormDTO.AddUserShowGroup.class);
return volunteerInfoService.authenticate(tokenDto, formDTO);
}
/**
* 志愿者认证界面获取用户基础信息+志愿者信息
*
* @param tokenDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.resi.ResiVolunteerInfoResultDTO>
* @Author zhangyong
* @Date 15:20 2020-07-28
**/
@PostMapping("selectvolunteerinfo")
public Result<ResiVolunteerInfoResultDTO> selectVolunteerInfo(@LoginUser TokenDto tokenDTO){
return volunteerInfoService.selectVolunteerInfoByUserId(tokenDTO);
}
}

11
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java

@ -18,6 +18,7 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.VolunteerInfoDTO;
import com.epmet.entity.VolunteerInfoEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -52,4 +53,14 @@ public interface VolunteerInfoDao extends BaseDao<VolunteerInfoEntity> {
* @Date 15:05 2020-07-23
**/
void updateVolunteerInfoByUserId(VolunteerInfoEntity entity);
/**
* 根据用户id查询志愿者信息
*
* @param userId
* @return java.lang.String
* @Author zhangyong
* @Date 14:33 2020-07-23l
**/
VolunteerInfoDTO selectVolunteerInfoByUserId(@Param("userId") String userId);
}

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java

@ -24,7 +24,6 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.ActUserRelationDTO;
import com.epmet.dto.form.resi.ResiActRegistrationFormDTO;
import com.epmet.dto.form.resi.ResiActUserCancelSignUpFormDTO;
import com.epmet.dto.result.resi.ResiActRegistrationResultDTO;
import com.epmet.entity.ActUserRelationEntity;
import org.apache.ibatis.annotations.Param;
@ -146,9 +145,9 @@ public interface ActUserRelationService extends BaseService<ActUserRelationEntit
*
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.Map<java.lang.Integer,java.lang.String>>
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 15:54 2020-07-28
**/
Result<ResiActRegistrationResultDTO> registration(TokenDto tokenDto, ResiActRegistrationFormDTO formDTO);
Result registration(TokenDto tokenDto, ResiActRegistrationFormDTO formDTO);
}

10
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java

@ -23,6 +23,7 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.VolunteerInfoDTO;
import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO;
import com.epmet.dto.result.resi.ResiVolunteerInfoResultDTO;
import com.epmet.entity.VolunteerInfoEntity;
import java.util.List;
@ -47,4 +48,13 @@ public interface VolunteerInfoService extends BaseService<VolunteerInfoEntity> {
**/
Result authenticate(TokenDto tokenDto, ResiVolunteerAuthenticateFormDTO formDTO);
/**
* 志愿者认证界面获取用户基础信息+志愿者信息
*
* @param tokenDto
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.resi.ResiVolunteerInfoResultDTO>
* @Author zhangyong
* @Date 14:05 2020-07-30
**/
Result<ResiVolunteerInfoResultDTO> selectVolunteerInfoByUserId(TokenDto tokenDto);
}

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

@ -39,7 +39,6 @@ import com.epmet.dto.ActUserRelationDTO;
import com.epmet.dto.form.resi.ResiActRegistrationFormDTO;
import com.epmet.dto.form.resi.ResiActUserCancelSignUpFormDTO;
import com.epmet.dto.result.UserRoleResultDTO;
import com.epmet.dto.result.resi.ResiActRegistrationResultDTO;
import com.epmet.entity.ActUserLogEntity;
import com.epmet.entity.ActUserRelationEntity;
import com.epmet.entity.HeartUserInfoEntity;
@ -48,6 +47,7 @@ import com.epmet.redis.ActUserRelationRedis;
import com.epmet.service.ActInfoService;
import com.epmet.service.ActUserLogService;
import com.epmet.service.ActUserRelationService;
import com.epmet.utils.ModuleConstant;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@ -195,46 +195,40 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
@Override
@Transactional(rollbackFor = Exception.class)
public Result<ResiActRegistrationResultDTO> registration(TokenDto tokenDto, ResiActRegistrationFormDTO formDTO) {
public Result registration(TokenDto tokenDto, ResiActRegistrationFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId());
boolean satisfy = false;
ResiActRegistrationResultDTO resultDTO = new ResiActRegistrationResultDTO();
// 查询活动信息
ActInfoDTO actInfoDTO = actInfoService.get(formDTO.getActId());
// >0 当前用户是志愿者
Integer volunteerFlag = volunteerInfoDao.queryVolunteerFlagByUserId(formDTO.getUserId());
if (actInfoDTO.getVolunteerLimit()){
// 活动只能志愿者参加, 当前用户是否满足条件
satisfy = this.volunteerParticipationAct(volunteerFlag);
if (!satisfy){
logger.info(EpmetErrorCode.NON_CERTIFIED_VOLUNTEER.getMsg());
resultDTO.setFlag(EpmetErrorCode.NON_CERTIFIED_VOLUNTEER.getCode());
resultDTO.setTip(EpmetErrorCode.NON_CERTIFIED_VOLUNTEER.getMsg());
return new Result<ResiActRegistrationResultDTO>().ok(resultDTO);
}
if (NumConstant.ZERO < volunteerFlag){
// 志愿者身份,可参加所有活动
satisfy = true;
} else {
// 活动不限制志愿者身份,但要求是 居民身份, 当前用户是否满足条件
satisfy = this.resiParticipationAct(formDTO.getUserId());
if (!satisfy){
logger.info(EpmetErrorCode.CANNOT_AUDIT_WARM.getMsg());
resultDTO.setFlag(EpmetErrorCode.CANNOT_AUDIT_WARM.getCode());
resultDTO.setTip(EpmetErrorCode.CANNOT_AUDIT_WARM.getMsg());
return new Result<ResiActRegistrationResultDTO>().ok(resultDTO);
// 如果用户不是志愿者,则需判断,当前活动 非志愿者是非可报名
if (actInfoDTO.getVolunteerLimit()){
// 活动只能志愿者参加, 当前用户是否满足条件
satisfy = this.volunteerParticipationAct(volunteerFlag);
} else {
// 活动不限制志愿者身份,但要求是 居民身份, 当前用户是否满足条件
satisfy = this.resiParticipationAct(formDTO.getUserId());
}
}
if (satisfy){
// 开始报名
boolean actTimeConflict = this.actStartSignUp(actInfoDTO, formDTO, volunteerFlag);
if (!actTimeConflict){
logger.info(EpmetErrorCode.ACT_TIME_CONFLICT.getMsg());
resultDTO.setFlag(EpmetErrorCode.ACT_TIME_CONFLICT.getCode());
resultDTO.setTip(EpmetErrorCode.ACT_TIME_CONFLICT.getMsg());
return new Result<ResiActRegistrationResultDTO>().ok(resultDTO);
logger.info(EpmetErrorCode.ACT_TIME_CONFLICT);
throw new RenException(EpmetErrorCode.ACT_TIME_CONFLICT.getCode());
}
} else {
// 不满足,提示用户去认证志愿者
logger.info(EpmetErrorCode.NON_CERTIFIED_VOLUNTEER);
throw new RenException(EpmetErrorCode.NON_CERTIFIED_VOLUNTEER.getCode());
}
resultDTO.setFlag(EpmetErrorCode.ACT_REGISTRATION_SUCCESS.getCode());
resultDTO.setTip(EpmetErrorCode.ACT_REGISTRATION_SUCCESS.getMsg());
return new Result<ResiActRegistrationResultDTO>().ok(resultDTO);
return new Result();
}
/**

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

@ -24,6 +24,7 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO;
import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
@ -31,8 +32,11 @@ import com.epmet.commons.tools.utils.SendMqMsgUtils;
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.resi.ResiVolunteerAuthenticateFormDTO;
import com.epmet.dto.result.ResiUserBaseInfoResultDTO;
import com.epmet.dto.result.resi.ResiVolunteerInfoResultDTO;
import com.epmet.entity.VolunteerInfoEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.redis.VolunteerInfoRedis;
@ -134,4 +138,26 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
wxUserInfoFormDTO.setGender(formDTO.getGender());
return wxUserInfoFormDTO;
}
@Override
public Result<ResiVolunteerInfoResultDTO> selectVolunteerInfoByUserId(TokenDto tokenDto) {
ResiVolunteerInfoResultDTO resultDTO = new ResiVolunteerInfoResultDTO();
// 获取用户基本信息
Result<ResiUserBaseInfoResultDTO> userBaseInfo = epmetUserOpenFeignClient.selectUserBaseInfo(tokenDto);
if (userBaseInfo.success()){
resultDTO = ConvertUtils.sourceToTarget(userBaseInfo.getData(), ResiVolunteerInfoResultDTO.class);
// 判断是不是志愿者
Integer volunteerFlag = baseDao.queryVolunteerFlagByUserId(tokenDto.getUserId());
if (volunteerFlag > NumConstant.ZERO){
// 获取志愿者信息
VolunteerInfoDTO dto = baseDao.selectVolunteerInfoByUserId(tokenDto.getUserId());
resultDTO.setVolunteerIntroduce(dto.getVolunteerIntroduce());
resultDTO.setVolunteerSignature(dto.getVolunteerSignature());
}
} else {
logger.error("获取用户基本信息失败");
throw new RenException("获取用户基本信息失败!");
}
return new Result<ResiVolunteerInfoResultDTO>().ok(resultDTO);
}
}

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

@ -359,7 +359,11 @@ public class WorkActUserServiceImpl implements WorkActUserService {
resultDTO.setSignUpActNum(historicalActInfo.getSignUpActNum());
resultDTO.setObtainPointsActNum(historicalActInfo.getObtainPointsActNum());
//历史活动列表
resultDTO.setActInfoList(actUserRelationDao.selectAllByUserId(formDTO.getUserId()));
List<UserHistoricalActInfoDTO> actInfoList=actUserRelationDao.selectAllByUserId(formDTO.getUserId());
for(UserHistoricalActInfoDTO userHistoricalActInfoDTO:actInfoList){
}
resultDTO.setActInfoList(actInfoList);
return resultDTO;
}

24
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml

@ -138,7 +138,7 @@
<!-- 根据userId,查询参与活动记录 -->
<select id="selectAllByUserId" resultType="com.epmet.dto.result.work.UserHistoricalActInfoDTO" parameterType="java.lang.String">
SELECT
SELECT
acr.ACT_ID AS actId,
ACR.USER_ID AS userId,
ai.TITLE AS title,
@ -148,17 +148,27 @@
acr.REWARD_FLAG AS rewardFlag,
acr.DENY_REWARD_REASON AS denyRewardReason,
acr.PROCESS_FLAG AS processFlag,
(select CREATED_TIME
from act_sign_in_rec ar
where ar.ACT_ID=acr.ACT_ID
and ar.USER_ID=acr.USER_ID
order by ar.CREATED_TIME asc limit 1) as signInTime
(
SELECT
CREATED_TIME
FROM
act_sign_in_rec ar
WHERE
ar.ACT_ID = acr.ACT_ID
AND ar.USER_ID = acr.USER_ID
ORDER BY
ar.CREATED_TIME ASC
LIMIT 1
) AS signInTime,
ai.ACT_STATUS AS actStatus,
acr.STATUS AS userActStatus,
( CASE acr.SIGN_IN_FLAG WHEN 'signed_in' THEN 1 ELSE 0 END ) AS signInFlag
FROM
act_user_relation acr
LEFT JOIN act_info ai ON ( acr.ACT_ID = ai.id )
WHERE
acr.DEL_FLAG = '0'
AND acr.USER_ID = #{userId}
AND acr.USER_ID =#{userId}
ORDER BY
acr.CREATED_TIME DESC
</select>

10
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml

@ -44,4 +44,14 @@
WHERE DEL_FLAG = '0'
AND USER_ID = #{userId}
</update>
<select id="selectVolunteerInfoByUserId" parameterType="java.lang.String" resultType="com.epmet.dto.VolunteerInfoDTO">
SELECT
CUSTOMER_ID customerId,
VOLUNTEER_INTRODUCE volunteerIntroduce,
VOLUNTEER_SIGNATURE volunteerSignature
FROM volunteer_info
WHERE DEL_FLAG = '0'
AND USER_ID = #{userId}
</select>
</mapper>

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

@ -1,6 +1,8 @@
package com.epmet.feign;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.GovStaffRoleDTO;
@ -11,10 +13,7 @@ import com.epmet.dto.result.*;
import com.epmet.feign.fallback.EpmetUserOpenFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -229,4 +228,15 @@ public interface EpmetUserOpenFeignClient {
**/
@GetMapping(value = "epmetuser/customerstaff/getCustsomerStaffByIdAndPhone")
Result<List<CustomerStaffDTO>> getCustsomerStaffByIdAndPhone(@RequestBody ThirdCustomerStaffFormDTO formDTO);
/**
* 获取用户基础信息
*
* @param tokenDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.ResiUserBaseInfoResultDTO>
* @Author zhangyong
* @Date 14:10 2020-07-30
**/
@PostMapping("/epmetuser/userbaseinfo/selectuserbaseinfo")
Result<ResiUserBaseInfoResultDTO> selectUserBaseInfo(@RequestBody TokenDto tokenDTO);
}

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

@ -1,6 +1,7 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerStaffDTO;
@ -167,4 +168,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
public Result<List<CustomerStaffDTO>> getCustsomerStaffByIdAndPhone(ThirdCustomerStaffFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustsomerStaffByIdAndPhone", formDTO);
}
@Override
public Result<ResiUserBaseInfoResultDTO> selectUserBaseInfo(TokenDto tokenDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "selectUserBaseInfo", tokenDTO);
}
}

2
epmet-user/epmet-user-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-user-server:
container_name: epmet-user-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.92
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.93
ports:
- "8087:8087"
network_mode: host # 不会创建新的网络

2
epmet-user/epmet-user-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.92</version>
<version>0.3.93</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-user</artifactId>

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

@ -158,8 +158,8 @@ public class UserBaseInfoController {
* @Author zhangyong
* @Date 15:20 2020-07-28
**/
@PostMapping("selecuserbaseinfo")
public Result<ResiUserBaseInfoResultDTO> selecUserBaseInfo(@LoginUser TokenDto tokenDTO){
@PostMapping("selectuserbaseinfo")
public Result<ResiUserBaseInfoResultDTO> selectUserBaseInfo(@LoginUser TokenDto tokenDTO){
return userBaseInfoService.selecUserBaseInfoByUserId(tokenDTO.getUserId());
}
}

4
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java

@ -150,8 +150,9 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl<UserResiInfoDao, Us
/**
* 居民注册信息提交
*
* @param userResiInfoDTO
* @Author sun
* @Author sunUserRoleServiceImpl
*/
@Override
public Result submit(UserResiInfoDTO userResiInfoDTO) {
@ -253,6 +254,7 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl<UserResiInfoDao, Us
UserRoleDTO userRole = new UserRoleDTO();
userRole.setUserId(userResiInfoDTO.getUserId());
userRole.setRoleKey(UserConstant.ROLE_RESI);
userRole.setApp(userResiInfoDTO.getApp());
userRoleService.saveUserRole(userRole);
}

Loading…
Cancel
Save