Browse Source

heart-work:已结束人员

master
yinzuomei 5 years ago
parent
commit
185c7efca4
  1. 62
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledUserResultDTO.java
  2. 82
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/JoinedUserResultDTO.java
  3. 26
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java
  4. 23
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java
  5. 18
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java
  6. 72
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java
  7. 49
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml
  8. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml

62
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledUserResultDTO.java

@ -0,0 +1,62 @@
package com.epmet.dto.result.work;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 已结束-已取消报名人员列表 返参DTO
*
* @author yinzuomei@elink-cn.com
* @date 2020/7/24 10:51
*/
@Data
public class CanceledUserResultDTO implements Serializable {
private static final long serialVersionUID = 5261680369821817096L;
/**
* 主键
*/
private String actUserRelationId;
/**
* 活动id
*/
private String actId;
/**
* 用户id
*/
private String userId;
/**
* 姓名
*/
private String realName;
/**
* 昵称
*/
private String nickName;
/**
* 头像
*/
private String headImgUrl;
/**
* true: 是志愿者 false : 不是志愿者
*/
private Boolean volunteerFlag;
/**
* 取消时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date cancelTime;
/**
* 取消原因
*/
private String cancelReason;
}

82
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/JoinedUserResultDTO.java

@ -0,0 +1,82 @@
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;
import java.util.Date;
/**
* 已结束-已参加人员列表 返参DTO
*
* @author yinzuomei@elink-cn.com
* @date 2020/7/24 9:54
*/
@Data
public class JoinedUserResultDTO implements Serializable {
private static final long serialVersionUID = 3120376299314043862L;
/**
* 主键
*/
private String actUserRelationId;
/**
* 活动id
*/
private String actId;
/**
* 用户id
*/
private String userId;
/**
* 姓名
*/
private String realName;
/**
* 昵称
*/
private String nickName;
/**
* 头像
*/
private String headImgUrl;
/**
* true已签到 false未签到
*/
private Boolean signInFlag;
/**
* true: 是志愿者 false : 不是志愿者
*/
private Boolean volunteerFlag;
/**
* 报名时间yyyy-MM-dd HH:mm
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date signUpTime;
/**
* 积分说明接口直接返回积分+5 或者 积分+0
*/
private String pointsDes;
/**
* 活动奖励积分
*/
@JsonIgnore
private Integer reward;
/**
* 已给分agree, 不给分deny 默认""
*/
@JsonIgnore
private String rewardFlag;
}

26
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java

@ -148,4 +148,30 @@ public class WorkActUserController {
workActUserService.auditRefuse(formDTO);
return new Result();
}
/**
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.work.JoinedUserResultDTO>>
* @param formDTO
* @author yinzuomei
* @description 已结束-已参加人员列表
* @Date 2020/7/24 10:17
**/
@PostMapping("joinuserlist")
public Result<List<JoinedUserResultDTO>> queryJoinUserList(@RequestBody AuditingActUserFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, AuditingActUserFormDTO.AddUserInternalGroup.class);
return new Result<List<JoinedUserResultDTO>>().ok(workActUserService.queryJoinUserList(formDTO));
}
/**
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.work.CanceledUserResultDTO>>
* @param formDTO
* @author yinzuomei
* @description 已结束-已取消报名人员列表
* @Date 2020/7/24 10:53
**/
@PostMapping("canceleduserlist")
public Result<List<CanceledUserResultDTO>> queryCanceledUserList(@RequestBody AuditingActUserFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, AuditingActUserFormDTO.AddUserInternalGroup.class);
return new Result<List<CanceledUserResultDTO>>().ok(workActUserService.queryCanceledUserList(formDTO));
}
}

23
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java

@ -24,10 +24,7 @@ import com.epmet.dto.form.resi.ResiActDetailFormDTO;
import com.epmet.dto.form.resi.ResiLatestActFormDTO;
import com.epmet.dto.form.resi.ResiMyActFormDTO;
import com.epmet.dto.result.resi.*;
import com.epmet.dto.result.work.ActSignUpStatResultDTO;
import com.epmet.dto.result.work.CanceledActResultDTO;
import com.epmet.dto.result.work.FinishedActResultDTO;
import com.epmet.dto.result.work.InProgressActResultDTO;
import com.epmet.dto.result.work.*;
import com.epmet.entity.ActInfoEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -255,4 +252,22 @@ public interface ActInfoDao extends BaseDao<ActInfoEntity> {
* @Date 2020/7/23 23:21
**/
List<FinishedActResultDTO> selectFinishedList(String customerId);
/**
* @return java.util.List<com.epmet.dto.result.work.JoinedUserResultDTO>
* @param actId
* @author yinzuomei
* @description 已结束-已参加人员列表
* @Date 2020/7/24 10:18
**/
List<JoinedUserResultDTO> queryJoinUserList(String actId);
/**
* @return java.util.List<com.epmet.dto.result.work.JoinedUserResultDTO>
* @param actId
* @author yinzuomei
* @description 已结束-已取消报名人员列表
* @Date 2020/7/24 10:55
**/
List<CanceledUserResultDTO> queryCanceledUserList(String actId);
}

18
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java

@ -95,4 +95,22 @@ public interface WorkActUserService {
* @Date 2020/7/23 18:14
**/
void auditRefuse(AuditUserFormDTO formDTO);
/**
* @return java.util.List<com.epmet.dto.result.work.JoinedUserResultDTO>
* @param formDTO
* @author yinzuomei
* @description 已结束-已参加人员列表
* @Date 2020/7/24 10:17
**/
List<JoinedUserResultDTO> queryJoinUserList(AuditingActUserFormDTO formDTO);
/**
* @return java.util.List<com.epmet.dto.result.work.CanceledUserResultDTO>
* @param formDTO
* @author yinzuomei
* @description 已结束-已取消报名人员列表
* @Date 2020/7/24 10:54
**/
List<CanceledUserResultDTO> queryCanceledUserList(AuditingActUserFormDTO formDTO);
}

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

@ -434,6 +434,78 @@ public class WorkActUserServiceImpl implements WorkActUserService {
this.saveUserMessage(actUserRelationEntity,ActConstant.ACT_USER_STATUS_REFUSED,actInfo);
}
/**
* @param formDTO
* @return java.util.List<com.epmet.dto.result.work.JoinedUserResultDTO>
* @author yinzuomei
* @description 已结束-已参加人员列表
* @Date 2020/7/24 10:17
**/
@Override
public List<JoinedUserResultDTO> queryJoinUserList(AuditingActUserFormDTO formDTO) {
List<JoinedUserResultDTO> list=actInfoDao.queryJoinUserList(formDTO.getActId());
if(null!=list&&list.size()>0){
//查询已通过审核的人员id集合
List<String> userIdList=actUserRelationService.getUserIdList(formDTO.getActId(), ActConstant.ACT_USER_STATUS_PASSED);
//根据已通过的人员集合,查询出用户基本信息
List<UserBaseInfoResultDTO> userInfoList=this.queryUserBaseInfoList(userIdList);
for(JoinedUserResultDTO joinedUserResultDTO:list){
//积分描述赋值
if(ActConstant.ACT_USER_STATUS_AGREE.equals(joinedUserResultDTO.getRewardFlag())){
joinedUserResultDTO.setPointsDes(String.format("积分+%s",joinedUserResultDTO.getReward()));
}else if(ActConstant.ACT_USER_STATUS_DENY.equals(joinedUserResultDTO.getRewardFlag())){
joinedUserResultDTO.setPointsDes("积分+0");
}
//志愿者标识赋值
joinedUserResultDTO.setVolunteerFlag(this.getVolunteerFlag(joinedUserResultDTO.getUserId()));
//基础信息赋值
for(UserBaseInfoResultDTO userBaseInfo:userInfoList){
if(joinedUserResultDTO.getUserId().equals(userBaseInfo.getUserId())){
joinedUserResultDTO.setRealName(userBaseInfo.getRealName());
joinedUserResultDTO.setNickName(userBaseInfo.getNickname());
joinedUserResultDTO.setHeadImgUrl(userBaseInfo.getHeadImgUrl());
break;
}
}
}
}
return list;
}
/**
* @param formDTO
* @return java.util.List<com.epmet.dto.result.work.CanceledUserResultDTO>
* @author yinzuomei
* @description 已结束-已取消报名人员列表
* @Date 2020/7/24 10:54
**/
@Override
public List<CanceledUserResultDTO> queryCanceledUserList(AuditingActUserFormDTO formDTO) {
List<CanceledUserResultDTO> list=actInfoDao.queryCanceledUserList(formDTO.getActId());
if(null!=list&&list.size()>0){
//查询已取消报名的人员id集合
List<String> userIdList=actUserRelationService.getUserIdList(formDTO.getActId(), ActConstant.ACT_USER_STATUS_CANCELD);
//根据已取消报名的人员集合,查询出用户基本信息
List<UserBaseInfoResultDTO> userInfoList=this.queryUserBaseInfoList(userIdList);
for(CanceledUserResultDTO canceledUserResultDTO:list){
//志愿者标识赋值
canceledUserResultDTO.setVolunteerFlag(this.getVolunteerFlag(canceledUserResultDTO.getUserId()));
//基础信息赋值
for(UserBaseInfoResultDTO userBaseInfo:userInfoList){
if(canceledUserResultDTO.getUserId().equals(userBaseInfo.getUserId())){
canceledUserResultDTO.setRealName(userBaseInfo.getRealName());
canceledUserResultDTO.setNickName(userBaseInfo.getNickname());
canceledUserResultDTO.setHeadImgUrl(userBaseInfo.getHeadImgUrl());
break;
}
}
}
}
return list;
}
/**
* @param actUserRelationEntity
* @param type

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

@ -528,4 +528,53 @@
ORDER BY
ai.ACTUAL_END_TIME DESC
</select>
<!-- 已结束-已参加人员列表 -->
<select id="queryJoinUserList" parameterType="java.lang.String" resultType="com.epmet.dto.result.work.JoinedUserResultDTO">
SELECT
aur.id as actUserRelationId,
aur.ACT_ID ,
aur.USER_ID ,
aur.SIGN_IN_FLAG,
aur.CREATED_TIME as signUpTime,
ai.REWARD,
aur.REWARD_FLAG,
"" as realName,
"" as nickName,
"" as headImgUrl,
"" as pointsDes
FROM
act_user_relation aur
left join act_info ai
on(aur.ACT_ID=ai.id
and ai.DEL_FLAG='0')
WHERE
aur.DEL_FLAG = '0'
AND aur.`STATUS` = 'passed'
AND aur.ACT_ID =#{actId}
order by aur.CREATED_TIME asc
</select>
<!-- 已结束-已取消报名人员列表 -->
<select id="queryCanceledUserList" resultType="com.epmet.dto.result.work.CanceledUserResultDTO" parameterType="java.lang.String">
SELECT
aur.id as actUserRelationId,
aur.ACT_ID ,
aur.USER_ID ,
aur.CANCEL_TIME,
aur.CANCEL_REASON,
"" as realName,
"" as nickName,
"" as headImgUrl
FROM
act_user_relation aur
left join act_info ai
on(aur.ACT_ID=ai.id
and ai.DEL_FLAG='0')
WHERE
aur.DEL_FLAG = '0'
AND aur.`STATUS` = 'canceld'
AND aur.ACT_ID =#{actId}
order by aur.CANCEL_TIME desc
</select>
</mapper>

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

@ -33,7 +33,9 @@
act_user_relation aur
WHERE
aur.DEL_FLAG = '0'
<if test="status != null and status.trim() != ''">
AND aur.`STATUS` = #{status}
</if>
AND aur.ACT_ID = #{actId}
order by aur.CREATED_TIME desc
</select>
@ -46,7 +48,9 @@
act_user_relation aur
WHERE
aur.DEL_FLAG = '0'
<if test="status != null and status.trim() != ''">
AND aur.`STATUS` =#{status}
</if>
AND aur.ACT_ID = #{actId}
order by aur.CREATED_TIME desc
</select>
@ -58,7 +62,9 @@
act_user_relation aur
WHERE
aur.DEL_FLAG = '0'
<if test="status != null and status.trim() != ''">
AND aur.`STATUS` =#{status}
</if>
AND aur.ACT_ID = #{actId}
</select>

Loading…
Cancel
Save