Browse Source

Merge remote-tracking branch 'origin/dev_new_article' into dev_new_article

feature/evaluate
sunyuchao 3 years ago
parent
commit
808444fc39
  1. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AuditUserFormDTO.java
  2. 21
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/FinishActFormDTO.java
  3. 6
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/GrantPointsFormDTO.java
  4. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPageResDTO.java
  5. 108
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActUserResDTO.java
  6. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/GrantPointsController.java
  7. 12
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java
  8. 34
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java
  9. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java
  10. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java
  11. 24
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/GrantPointsServiceImpl.java
  12. 34
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
  13. 49
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java
  14. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AuditUserFormDTO.java

@ -3,6 +3,7 @@ package com.epmet.dto.form.work;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data; import lombok.Data;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import java.io.Serializable; import java.io.Serializable;
@ -12,6 +13,7 @@ import java.io.Serializable;
* @author yinzuomei@elink-cn.com * @author yinzuomei@elink-cn.com
* @date 2020/7/23 17:28 * @date 2020/7/23 17:28
*/ */
@Valid
@Data @Data
public class AuditUserFormDTO implements Serializable { public class AuditUserFormDTO implements Serializable {
private static final long serialVersionUID = 243279409415285207L; private static final long serialVersionUID = 243279409415285207L;
@ -28,4 +30,7 @@ public class AuditUserFormDTO implements Serializable {
@NotBlank(message = "拒绝理由不能为空", groups = {RefusedUserShowGroup.class}) @NotBlank(message = "拒绝理由不能为空", groups = {RefusedUserShowGroup.class})
private String rejectReason; private String rejectReason;
@NotBlank(message = "type不能为空【通过:pass;拒绝:refused】", groups = {AddUserInternalGroup.class})
private String type;
} }

21
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/FinishActFormDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.form.work;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
* @Description
* @Author yzm
* @Date 2022/6/30 19:22
*/
@Data
public class FinishActFormDTO extends SaveActualTimeFormDTO implements Serializable {
private static final long serialVersionUID = -4352058593501077516L;
@NotNull(message = "分值不能为空",groups =AddUserInternalGroup.class )
private Integer reward;
private List<GrantPointsFormDTO> userList;
}

6
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/GrantPointsFormDTO.java

@ -4,6 +4,7 @@ import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable; import java.io.Serializable;
/** /**
@ -27,4 +28,9 @@ public class GrantPointsFormDTO implements Serializable {
@NotBlank(message = "理由不能为空", groups = {DenyUserShowGroup.class}) @NotBlank(message = "理由不能为空", groups = {DenyUserShowGroup.class})
private String denyRewardReason; private String denyRewardReason;
/**
* true:给分false不给分
*/
@NotNull(message = "请选择是否给分", groups = DenyUserShowGroup.class)
private Boolean grantPoint;
} }

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPageResDTO.java

@ -89,5 +89,10 @@ public class ActPageResDTO implements Serializable {
* 1已经总结0未总结 * 1已经总结0未总结
*/ */
private Boolean summaryFlag; private Boolean summaryFlag;
/**
* 活动积分
*/
private Integer reward;
} }

108
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActUserResDTO.java

@ -0,0 +1,108 @@
package com.epmet.dto.result.work;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Description
* @Author yzm
* @Date 2022/6/30 17:58
*/
@Data
public class ActUserResDTO implements Serializable {
private static final long serialVersionUID = 7621004224467504031L;
/**
* 主键
*/
private String actUserRelationId;
/**
* 活动id
*/
private String actId;
/**
* 用户id
*/
private String userId;
/**
* 姓名
*/
private String realName;
/**
* 昵称
*/
private String nickName;
/**
* 联系方式
*/
private String mobile;
/**
* 身份证号
*/
private String idNum;
/**
* 报名时间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;
/**
* 实际参加活动个数
*/
private Integer signInActNum;
/**
* 报名活动个数
*/
private Integer signUpActNum;
/**
* 获得积分活动个数
*/
private Integer obtainPointsActNum;
/**
* 已处理: handled; 默认"",重新处理时reward_flag置为空字符串
*/
private String processFlag;
/**
* 已签到:signed_in; 默认""
*/
private String signInFlag;
/**
* 已给分agree, 不给分deny 默认""
*/
private String rewardFlag;
/**
* 当前状态已报名/待审核auditing
审核通过passed
审核不通过refused
取消报名canceled
*/
private String status;
public ActUserResDTO(){
this.signInActNum=0;
this.signUpActNum=0;
this.obtainPointsActNum=0;
}
}

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

@ -54,6 +54,7 @@ public class GrantPointsController {
**/ **/
@PostMapping("deny") @PostMapping("deny")
public Result deny(@RequestBody GrantPointsFormDTO formDTO){ public Result deny(@RequestBody GrantPointsFormDTO formDTO){
formDTO.setGrantPoint(false);
ValidatorUtils.validateEntity(formDTO, GrantPointsFormDTO.DenyUserShowGroup.class); ValidatorUtils.validateEntity(formDTO, GrantPointsFormDTO.DenyUserShowGroup.class);
grantPointsService.deny(formDTO); grantPointsService.deny(formDTO);
return new Result(); return new Result();
@ -68,6 +69,7 @@ public class GrantPointsController {
**/ **/
@PostMapping("agree") @PostMapping("agree")
public Result agree(@RequestBody GrantPointsFormDTO formDTO){ public Result agree(@RequestBody GrantPointsFormDTO formDTO){
formDTO.setGrantPoint(true);
ValidatorUtils.validateEntity(formDTO, GrantPointsFormDTO.AddUserInternalGroup.class); ValidatorUtils.validateEntity(formDTO, GrantPointsFormDTO.AddUserInternalGroup.class);
grantPointsService.agree(formDTO); grantPointsService.agree(formDTO);
return new Result(); return new Result();

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

@ -328,4 +328,16 @@ public class WorkActController {
public Result<ActDetailResultDTO> queryActDetail(@LoginUser TokenDto tokenDto, @RequestBody ActIdFormDTO formDTO) { public Result<ActDetailResultDTO> queryActDetail(@LoginUser TokenDto tokenDto, @RequestBody ActIdFormDTO formDTO) {
return new Result<ActDetailResultDTO>().ok(workActService.queryActDetail(formDTO.getActId(), tokenDto.getUserId())); return new Result<ActDetailResultDTO>().ok(workActService.queryActDetail(formDTO.getActId(), tokenDto.getUserId()));
} }
/**
* 数字社区结束活动
* @param formDTO
* @return
*/
@PostMapping("finish")
public Result finish(@RequestBody FinishActFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO,SaveActualTimeFormDTO.AddUserInternalGroup.class,SaveActualTimeFormDTO.UserShowGroup.class);
workActService.finish(formDTO);
return new Result();
}
} }

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

@ -1,7 +1,9 @@
package com.epmet.controller; package com.epmet.controller;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.ActConstant;
import com.epmet.dto.form.work.AactUserDetailFormDTO; import com.epmet.dto.form.work.AactUserDetailFormDTO;
import com.epmet.dto.form.work.ActIdFormDTO; import com.epmet.dto.form.work.ActIdFormDTO;
import com.epmet.dto.form.work.AuditUserFormDTO; import com.epmet.dto.form.work.AuditUserFormDTO;
@ -130,6 +132,7 @@ public class WorkActUserController {
**/ **/
@PostMapping("auditpass") @PostMapping("auditpass")
public Result auditPass(@RequestBody AuditUserFormDTO formDTO){ public Result auditPass(@RequestBody AuditUserFormDTO formDTO){
formDTO.setType(ActConstant.ACT_USER_STATUS_PASSED);
ValidatorUtils.validateEntity(formDTO, AuditUserFormDTO.AddUserInternalGroup.class); ValidatorUtils.validateEntity(formDTO, AuditUserFormDTO.AddUserInternalGroup.class);
workActUserService.auditPass(formDTO.getActUserRelationId()); workActUserService.auditPass(formDTO.getActUserRelationId());
return new Result(); return new Result();
@ -144,6 +147,7 @@ public class WorkActUserController {
**/ **/
@PostMapping("auditrefuse") @PostMapping("auditrefuse")
public Result auditrefuse(@RequestBody AuditUserFormDTO formDTO){ public Result auditrefuse(@RequestBody AuditUserFormDTO formDTO){
formDTO.setType(ActConstant.ACT_USER_STATUS_REFUSED);
ValidatorUtils.validateEntity(formDTO, AuditUserFormDTO.RefusedUserShowGroup.class); ValidatorUtils.validateEntity(formDTO, AuditUserFormDTO.RefusedUserShowGroup.class);
workActUserService.auditRefuse(formDTO); workActUserService.auditRefuse(formDTO);
return new Result(); return new Result();
@ -174,4 +178,34 @@ public class WorkActUserController {
ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class);
return new Result<List<CanceledUserResultDTO>>().ok(workActUserService.queryCanceledUserList(formDTO)); return new Result<List<CanceledUserResultDTO>>().ok(workActUserService.queryCanceledUserList(formDTO));
} }
/**
* 数字社区查看人员列表报名审核查看人员活动结束发放积分页面人员列表
* @param formDTO
* @return
*/
@PostMapping("userlist")
public Result<PageData<ActUserResDTO>> queryUserList(@RequestBody ActIdFormDTO formDTO){
return new Result<PageData<ActUserResDTO>>().ok(workActUserService.queryUserList(formDTO.getActId()));
}
/**
* 批量审核通过拒绝调用原来的接口
* @param formDTOList
* @return
*/
@PostMapping("audit-user")
public Result auditUser(@RequestBody List<AuditUserFormDTO> formDTOList) {
ValidatorUtils.validateEntity(formDTOList);
for (AuditUserFormDTO formDTO : formDTOList) {
if (ActConstant.ACT_USER_STATUS_REFUSED.equals(formDTO.getType())) {
workActUserService.auditRefuse(formDTO);
} else if (ActConstant.ACT_USER_STATUS_PASSED.equals(formDTO.getType())) {
workActUserService.auditPass(formDTO.getActUserRelationId());
}
}
return new Result();
}
} }

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

@ -164,4 +164,10 @@ public interface WorkActService {
* @return * @return
*/ */
ActDetailResultDTO queryActDetail(String actId, String userId); ActDetailResultDTO queryActDetail(String actId, String userId);
/**
*
* @param formDTO
*/
void finish(FinishActFormDTO formDTO);
} }

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

@ -1,5 +1,6 @@
package com.epmet.service; package com.epmet.service;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.form.work.AactUserDetailFormDTO; import com.epmet.dto.form.work.AactUserDetailFormDTO;
import com.epmet.dto.form.work.ActIdFormDTO; import com.epmet.dto.form.work.ActIdFormDTO;
import com.epmet.dto.form.work.AuditUserFormDTO; import com.epmet.dto.form.work.AuditUserFormDTO;
@ -141,4 +142,11 @@ public interface WorkActUserService {
* @Date 2020/7/24 12:52 * @Date 2020/7/24 12:52
**/ **/
Boolean getVolunteerFlag(String userId); Boolean getVolunteerFlag(String userId);
/**
* 数字社区查看人员列表报名审核查看人员活动结束发放积分页面人员列表
* @param actId
* @return
*/
PageData<ActUserResDTO> queryUserList(String actId);
} }

24
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/GrantPointsServiceImpl.java

@ -1,5 +1,6 @@
package com.epmet.service.impl; package com.epmet.service.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
@ -108,19 +109,14 @@ public class GrantPointsServiceImpl implements GrantPointsService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void agree(GrantPointsFormDTO formDTO) { public void agree(GrantPointsFormDTO formDTO) {
//是否是待处理 //是否是待处理
ActUserRelationDTO actUserRelationDTO=actUserRelationService.get(formDTO.getActUserRelationId());
if(null==actUserRelationDTO){
logger.warn("积分发放-给分act_user_relation is null,actUserRelationId="+formDTO.getActUserRelationId());
return;
}
//如果是已处理直接返回 //如果是已处理直接返回
if(ActConstant.HANDLED.equals(actUserRelationDTO.getProcessFlag())){ ActUserRelationDTO actUserRelationDTO=actUserRelationService.get(formDTO.getActUserRelationId());
logger.info("积分发放-给分act_user_relation already handled,actUserRelationId="+formDTO.getActUserRelationId()); if (null == actUserRelationDTO || ActConstant.HANDLED.equals(actUserRelationDTO.getProcessFlag())) {
return; return;
} }
//查取分值 //查取分值
ActInfoDTO actInfoDTO=actInfoService.get(actUserRelationDTO.getActId()); ActInfoDTO actInfoDTO=actInfoService.get(actUserRelationDTO.getActId());
if (null == actInfoDTO || ActConstant.ACT_STATUS_FINISHED.equals(actInfoDTO.getActStatus())) { if (null == actInfoDTO || ActConstant.ACT_STATUS_FINISHED.equals(actInfoDTO.getActStatus())|| NumConstant.ZERO==actInfoDTO.getReward()) {
logger.warn("积分发放-给分act_info is null or act_info is finished"); logger.warn("积分发放-给分act_info is null or act_info is finished");
return; return;
} }
@ -152,20 +148,14 @@ public class GrantPointsServiceImpl implements GrantPointsService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void deny(GrantPointsFormDTO formDTO) { public void deny(GrantPointsFormDTO formDTO) {
//是否是待处理
ActUserRelationDTO actUserRelationDTO=actUserRelationService.get(formDTO.getActUserRelationId());
if(null==actUserRelationDTO){
logger.warn("积分发放-不给分act_user_relation is null,actUserRelationId="+formDTO.getActUserRelationId());
return;
}
//如果是已处理直接返回 //如果是已处理直接返回
if(ActConstant.HANDLED.equals(actUserRelationDTO.getProcessFlag())){ ActUserRelationDTO actUserRelationDTO=actUserRelationService.get(formDTO.getActUserRelationId());
logger.info("积分发放-不给分act_user_relation already handled,actUserRelationId="+formDTO.getActUserRelationId()); if (null == actUserRelationDTO || ActConstant.HANDLED.equals(actUserRelationDTO.getProcessFlag())) {
return; return;
} }
//查取分值 //查取分值
ActInfoDTO actInfoDTO=actInfoService.get(actUserRelationDTO.getActId()); ActInfoDTO actInfoDTO=actInfoService.get(actUserRelationDTO.getActId());
if (null == actInfoDTO || ActConstant.ACT_STATUS_FINISHED.equals(actInfoDTO.getActStatus())) { if (null == actInfoDTO || ActConstant.ACT_STATUS_FINISHED.equals(actInfoDTO.getActStatus())|| NumConstant.ZERO==actInfoDTO.getReward()) {
logger.warn("积分发放-不给分act_info is null or act_info is finished"); logger.warn("积分发放-不给分act_info is null or act_info is finished");
return; return;
} }

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

@ -113,7 +113,8 @@ public class WorkActServiceImpl implements WorkActService {
private IcActivityUnitRelationService icActivityUnitRelationService; private IcActivityUnitRelationService icActivityUnitRelationService;
@Resource @Resource
private IcActivityServiceRelationService icActivityServiceRelationService; private IcActivityServiceRelationService icActivityServiceRelationService;
@Autowired
private ActPointLogService actPointLogService;
/** /**
* @author yinzuomei * @author yinzuomei
@ -1716,4 +1717,35 @@ public class WorkActServiceImpl implements WorkActService {
} }
return resultDTO; return resultDTO;
} }
/**
* @param formDTO
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void finish(FinishActFormDTO formDTO) {
// 1、保存活动实际开始、结束时间
saveActualTime(formDTO);
// 2、积分大于0的->发放积分
if (formDTO.getReward() > NumConstant.ZERO) {
for (GrantPointsFormDTO grantPointsFormDTO : formDTO.getUserList()) {
ActUserRelationDTO actUserRelationDTO = actUserRelationService.get(grantPointsFormDTO.getActUserRelationId());
// 更新act_user_relation改为已处理,给分
actUserRelationDTO.setProcessFlag(ActConstant.HANDLED);
actUserRelationDTO.setRewardFlag(grantPointsFormDTO.getGrantPoint() ? ActConstant.ACT_USER_STATUS_AGREE : ActConstant.ACT_USER_STATUS_DENY);
actUserRelationDTO.setDenyRewardReason(StrConstant.EPMETY_STR);
actUserRelationService.update(actUserRelationDTO);
// 增加一条act_point_log
ActPointLogDTO actPointLogDTO = new ActPointLogDTO();
actPointLogDTO.setActId(actUserRelationDTO.getActId());
actPointLogDTO.setUserId(actUserRelationDTO.getUserId());
actPointLogDTO.setPoints(formDTO.getReward());
actPointLogDTO.setOperateType(grantPointsFormDTO.getGrantPoint() ? ActConstant.ACT_USER_STATUS_AGREE : ActConstant.ACT_USER_STATUS_DENY);
actPointLogDTO.setRemark(grantPointsFormDTO.getGrantPoint() ? StrConstant.EPMETY_STR : grantPointsFormDTO.getDenyRewardReason());
actPointLogService.save(actPointLogDTO);
}
}
// 3、结束活动
finishAct(formDTO.getActId());
}
} }

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

@ -6,7 +6,9 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.ActConstant; import com.epmet.constant.ActConstant;
import com.epmet.constant.ActMessageConstant; import com.epmet.constant.ActMessageConstant;
@ -36,6 +38,7 @@ import com.epmet.service.ActInfoService;
import com.epmet.service.ActUserRelationService; import com.epmet.service.ActUserRelationService;
import com.epmet.service.HeartUserInfoService; import com.epmet.service.HeartUserInfoService;
import com.epmet.service.WorkActUserService; import com.epmet.service.WorkActUserService;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -46,6 +49,8 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/** /**
* 工作端活动人员相关api * 工作端活动人员相关api
@ -775,4 +780,48 @@ public class WorkActUserServiceImpl implements WorkActUserService {
} }
return resultUserList.getData().get(0); return resultUserList.getData().get(0);
} }
/**
* 数字社区查看人员列表报名审核查看人员活动结束发放积分页面人员列表
*
* @param actId
* @return
*/
@Override
public PageData<ActUserResDTO> queryUserList(String actId) {
List<ActUserResDTO> list = new ArrayList<>();
// 活动相关人员
List<ActUserRelationDTO> actUserRelationDTOList = actUserRelationService.getUserList(actId, StrConstant.EPMETY_STR);
if (null == actUserRelationDTOList || actUserRelationDTOList.size() == 0) {
return new PageData<>(list, NumConstant.ZERO);
}
// 查询人员id集合
Set<String> userIdList = actUserRelationDTOList.stream().map(ActUserRelationDTO::getUserId).collect(Collectors.toSet());
// 查询出用户基本信息
List<UserBaseInfoResultDTO> userInfoList = this.queryUserBaseInfoList(new ArrayList<>(userIdList));
for (ActUserRelationDTO actUserRelationDTO : actUserRelationDTOList) {
ActUserResDTO resultDTO = ConvertUtils.sourceToTarget(actUserRelationDTO,ActUserResDTO.class);
resultDTO.setActUserRelationId(actUserRelationDTO.getId());
resultDTO.setSignUpTime(actUserRelationDTO.getCreatedTime());
// true: 是志愿者 false : 不是志愿者
resultDTO.setVolunteerFlag(getVolunteerFlag(actUserRelationDTO.getUserId()));
// 赋值基本信息
for (UserBaseInfoResultDTO userBaseInfoResultDTO : userInfoList) {
if (actUserRelationDTO.getUserId().equals(userBaseInfoResultDTO.getUserId())) {
resultDTO.setRealName(StringUtils.isNotBlank(userBaseInfoResultDTO.getRealName()) ? userBaseInfoResultDTO.getRealName() : StrConstant.EPMETY_STR);
resultDTO.setNickName(StringUtils.isNotBlank(userBaseInfoResultDTO.getNickname()) ? userBaseInfoResultDTO.getNickname() : StrConstant.EPMETY_STR);
resultDTO.setMobile(StringUtils.isNotBlank(userBaseInfoResultDTO.getMobile()) ? userBaseInfoResultDTO.getMobile() : StrConstant.EPMETY_STR);
resultDTO.setIdNum(StringUtils.isNotBlank(userBaseInfoResultDTO.getIdNum()) ? userBaseInfoResultDTO.getIdNum() : StrConstant.EPMETY_STR);
break;
}
}
HistoricalActInfo historicalActInfo = this.getHistoricalActInfo(resultDTO.getUserId(), actId);
resultDTO.setSignInActNum(historicalActInfo.getSignInActNum());
resultDTO.setSignUpActNum(historicalActInfo.getSignUpActNum());
resultDTO.setObtainPointsActNum(historicalActInfo.getObtainPointsActNum());
list.add(resultDTO);
}
PageInfo<ActUserResDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal());
}
} }

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

@ -828,7 +828,8 @@
AND aur.DEL_FLAG = '0' AND aur.DEL_FLAG = '0'
AND ( aur.`STATUS` = 'auditing' OR aur.`STATUS` = 'passed' ) AND ( aur.`STATUS` = 'auditing' OR aur.`STATUS` = 'passed' )
) AS signedUp, ) AS signedUp,
ai.SUMMARY_FLAG as summaryFlag ai.SUMMARY_FLAG as summaryFlag,
ai.REWARD as reward,
FROM FROM
act_info ai act_info ai
WHERE WHERE

Loading…
Cancel
Save