forked from rongchao/epmet-cloud-rizhao
33 changed files with 776 additions and 27 deletions
@ -0,0 +1,23 @@ |
|||||
|
package com.epmet.dto.form.work; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 报名审核-待审核列表入参 |
||||
|
* |
||||
|
* @author yinzuomei@elink-cn.com |
||||
|
* @date 2020/7/21 22:12 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AuditingActUserFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 3811387419859675753L; |
||||
|
public interface AddUserInternalGroup {} |
||||
|
/** |
||||
|
* 活动id |
||||
|
*/ |
||||
|
@NotBlank(message = "活动id不能为空", groups = { AddUserInternalGroup.class }) |
||||
|
private String actId; |
||||
|
} |
@ -0,0 +1,55 @@ |
|||||
|
package com.epmet.dto.result.work; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 报名审核-待审核列表返参 |
||||
|
* |
||||
|
* @author yinzuomei@elink-cn.com |
||||
|
* @date 2020/7/21 22:14 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AuditingActUserResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 5567556309702585031L; |
||||
|
|
||||
|
/** |
||||
|
* 活动id |
||||
|
*/ |
||||
|
private String actId; |
||||
|
|
||||
|
/** |
||||
|
* 用户id |
||||
|
*/ |
||||
|
private String userId; |
||||
|
|
||||
|
/** |
||||
|
* 姓名 |
||||
|
*/ |
||||
|
private String realName; |
||||
|
|
||||
|
/** |
||||
|
* 微信昵称 |
||||
|
*/ |
||||
|
private String nickName; |
||||
|
|
||||
|
/** |
||||
|
* 头像 |
||||
|
*/ |
||||
|
private String headImgUrl; |
||||
|
|
||||
|
/** |
||||
|
* 报名时间yyyy-MM-dd HH:mm:ss |
||||
|
*/ |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||
|
private Date signUpTime; |
||||
|
|
||||
|
/** |
||||
|
* true: 是志愿者 false : 不是志愿者 |
||||
|
*/ |
||||
|
private Boolean volunteerFlag; |
||||
|
|
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
package com.epmet.service; |
||||
|
|
||||
|
import com.epmet.dto.form.work.AuditingActUserFormDTO; |
||||
|
import com.epmet.dto.result.work.AuditingActUserResultDTO; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 工作端:活动人员相关api |
||||
|
* |
||||
|
* @author yinzuomei@elink-cn.com |
||||
|
* @date 2020/7/21 22:23 |
||||
|
*/ |
||||
|
public interface WorkActUserService { |
||||
|
/** |
||||
|
* @return java.util.List<com.epmet.dto.result.work.AuditingActUserResultDTO> |
||||
|
* @param formDTO |
||||
|
* @author yinzuomei |
||||
|
* @description 报名审核-待审核列表 |
||||
|
* @Date 2020/7/21 22:25 |
||||
|
**/ |
||||
|
List<AuditingActUserResultDTO> getAuditingList(AuditingActUserFormDTO formDTO); |
||||
|
} |
@ -0,0 +1,110 @@ |
|||||
|
package com.epmet.service.impl; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.dto.ActUserRelationDTO; |
||||
|
import com.epmet.dto.HeartUserInfoDTO; |
||||
|
import com.epmet.dto.form.work.AuditingActUserFormDTO; |
||||
|
import com.epmet.dto.result.UserBaseInfoResultDTO; |
||||
|
import com.epmet.dto.result.work.AuditingActUserResultDTO; |
||||
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
||||
|
import com.epmet.service.ActUserRelationService; |
||||
|
import com.epmet.service.HeartUserInfoService; |
||||
|
import com.epmet.service.WorkActUserService; |
||||
|
import org.apache.logging.log4j.LogManager; |
||||
|
import org.apache.logging.log4j.Logger; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 工作端:活动人员相关api |
||||
|
* |
||||
|
* @author yinzuomei@elink-cn.com |
||||
|
* @date 2020/7/21 22:23 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class WorkActUserServiceImpl implements WorkActUserService { |
||||
|
private Logger logger = LogManager.getLogger(WorkActUserServiceImpl.class); |
||||
|
@Autowired |
||||
|
private ActUserRelationService actUserRelationService; |
||||
|
@Autowired |
||||
|
private HeartUserInfoService heartUserInfoService; |
||||
|
@Autowired |
||||
|
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
||||
|
|
||||
|
/** |
||||
|
* @param formDTO |
||||
|
* @return java.util.List<com.epmet.dto.result.work.AuditingActUserResultDTO> |
||||
|
* @author yinzuomei |
||||
|
* @description 报名审核-待审核列表 |
||||
|
* @Date 2020/7/21 22:25 |
||||
|
**/ |
||||
|
@Override |
||||
|
public List<AuditingActUserResultDTO> getAuditingList(AuditingActUserFormDTO formDTO) { |
||||
|
List<AuditingActUserResultDTO> list=new ArrayList<>(); |
||||
|
//查询出待审核的人员列表
|
||||
|
List<ActUserRelationDTO> actUserRelationDTOList=actUserRelationService.getAuditingUserList(formDTO.getActId()); |
||||
|
if(null==actUserRelationDTOList||actUserRelationDTOList.size()==0){ |
||||
|
logger.info(String.format("当前活动%s没有待审核的报名人员",formDTO.getActId())); |
||||
|
return list; |
||||
|
} |
||||
|
//查询出待审核的人员id集合
|
||||
|
List<String> userIdList=actUserRelationService.getAuditingUserIds(formDTO.getActId()); |
||||
|
//根据待审核的人员结合,查询出用户基本信息
|
||||
|
List<UserBaseInfoResultDTO> userInfoList=this.queryUserBaseInfo(userIdList); |
||||
|
//调用epemet_user服务获取用户的基本信息
|
||||
|
for(ActUserRelationDTO actUserRelationDTO:actUserRelationDTOList){ |
||||
|
AuditingActUserResultDTO resultDTO=new AuditingActUserResultDTO(); |
||||
|
resultDTO.setActId(formDTO.getActId()); |
||||
|
resultDTO.setUserId(actUserRelationDTO.getUserId()); |
||||
|
resultDTO.setSignUpTime(actUserRelationDTO.getCreatedTime()); |
||||
|
//微信基本信息先默认为空字符串
|
||||
|
resultDTO.setRealName(NumConstant.EMPTY_STR); |
||||
|
resultDTO.setNickName(NumConstant.EMPTY_STR); |
||||
|
resultDTO.setHeadImgUrl(NumConstant.EMPTY_STR); |
||||
|
|
||||
|
HeartUserInfoDTO heartUserInfoDTO=heartUserInfoService.getByUserId(actUserRelationDTO.getUserId()); |
||||
|
//true: 是志愿者 false : 不是志愿者
|
||||
|
if(null!=heartUserInfoDTO){ |
||||
|
resultDTO.setVolunteerFlag(heartUserInfoDTO.getVolunteerFlag()); |
||||
|
}else{ |
||||
|
resultDTO.setVolunteerFlag(false); |
||||
|
} |
||||
|
//赋值基本信息
|
||||
|
for(UserBaseInfoResultDTO userBaseInfoResultDTO:userInfoList){ |
||||
|
if(actUserRelationDTO.getUserId().equals(userBaseInfoResultDTO.getUserId())){ |
||||
|
resultDTO.setRealName(userBaseInfoResultDTO.getRealName()); |
||||
|
resultDTO.setNickName(userBaseInfoResultDTO.getNickname()); |
||||
|
resultDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
list.add(resultDTO); |
||||
|
} |
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @return java.util.List<com.epmet.dto.result.UserBaseInfoResultDTO> |
||||
|
* @param userIdList |
||||
|
* @author yinzuomei |
||||
|
* @description 传入用户id集合,返回用户的基本信息(包含微信基本信息) |
||||
|
* @Date 2020/7/22 10:38 |
||||
|
**/ |
||||
|
private List<UserBaseInfoResultDTO> queryUserBaseInfo(List<String> userIdList) { |
||||
|
List<UserBaseInfoResultDTO> userInfoList=new ArrayList<>(); |
||||
|
if(null==userIdList||userIdList.size()==0){ |
||||
|
return userInfoList; |
||||
|
} |
||||
|
Result<List<UserBaseInfoResultDTO>> resultUserList =epmetUserOpenFeignClient.queryUserBaseInfo(userIdList); |
||||
|
if(resultUserList.success()&&resultUserList.getData().size()>0){ |
||||
|
return resultUserList.getData(); |
||||
|
}else{ |
||||
|
logger.warn("查询用户基本信息接口返回失败"); |
||||
|
} |
||||
|
return userInfoList; |
||||
|
} |
||||
|
} |
@ -0,0 +1,80 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 用户基本信息-居民录入的基本信息 |
||||
|
* |
||||
|
* @author yinzuomei@elink-cn.com |
||||
|
* @date 2020/7/22 9:26 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class UserBaseInfoResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 3124057264557384333L; |
||||
|
/** |
||||
|
* 用户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 UserWechatResultDTO userWechatResultDTO; |
||||
|
} |
@ -0,0 +1,71 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 用户基本信息-微信信息 |
||||
|
* |
||||
|
* @author yinzuomei@elink-cn.com |
||||
|
* @date 2020/7/22 9:27 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class UserWechatResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 5770079291635923923L; |
||||
|
|
||||
|
/** |
||||
|
* 用户ID |
||||
|
* */ |
||||
|
private String userId; |
||||
|
|
||||
|
/** |
||||
|
* 微信openId |
||||
|
*/ |
||||
|
private String wxOpenId; |
||||
|
|
||||
|
/** |
||||
|
* 微信unionId |
||||
|
*/ |
||||
|
private String unionId; |
||||
|
|
||||
|
/** |
||||
|
* 手机号 |
||||
|
*/ |
||||
|
private String mobile; |
||||
|
|
||||
|
/** |
||||
|
* 昵称 |
||||
|
*/ |
||||
|
private String nickname; |
||||
|
|
||||
|
/** |
||||
|
* 性别:0.未知 1.男性2女性 |
||||
|
*/ |
||||
|
private Integer sex; |
||||
|
|
||||
|
/** |
||||
|
* 头像 |
||||
|
*/ |
||||
|
private String headImgUrl; |
||||
|
|
||||
|
/** |
||||
|
* 国家 |
||||
|
*/ |
||||
|
private String country; |
||||
|
|
||||
|
/** |
||||
|
* 省份 |
||||
|
*/ |
||||
|
private String province; |
||||
|
|
||||
|
/** |
||||
|
* 城市 |
||||
|
*/ |
||||
|
private String city; |
||||
|
|
||||
|
/** |
||||
|
* 语言 |
||||
|
*/ |
||||
|
private String language; |
||||
|
} |
Loading…
Reference in new issue