Browse Source

heart-work:给分、不给分、重新处理canceled

master
yinzuomei 5 years ago
parent
commit
4458ea0725
  1. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserLogDTO.java
  2. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserRelationDTO.java
  3. 6
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AuditUserFormDTO.java
  4. 30
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/GrantPointsFormDTO.java
  5. 50
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PendingUserResultDTO.java
  6. 45
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserBaseInfo.java
  7. 61
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/GrantPointsController.java
  8. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java
  9. 18
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java
  10. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserLogEntity.java
  11. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserRelationEntity.java
  12. 48
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/GrantPointsService.java
  13. 33
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java
  14. 236
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/GrantPointsServiceImpl.java
  15. 16
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java
  16. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml
  17. 27
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserLogDTO.java

@ -53,7 +53,7 @@ public class ActUserLogDTO implements Serializable {
* 操作类型已报名/待审核auditing
* 审核通过passed
* 审核不通过refused
* 取消报名canceld
* 取消报名canceled
*
*/
private String operationType;

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserRelationDTO.java

@ -17,9 +17,10 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
@ -52,7 +53,7 @@ public class ActUserRelationDTO implements Serializable {
* 当前状态已报名/待审核auditing
审核通过passed
审核不通过refused
取消报名canceld
取消报名canceled
*/
private String status;

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

@ -17,15 +17,15 @@ public class AuditUserFormDTO implements Serializable {
private static final long serialVersionUID = 243279409415285207L;
public interface AddUserInternalGroup {
}
public interface UserShowGroup extends CustomerClientShowGroup {
public interface RefusedUserShowGroup extends CustomerClientShowGroup {
}
/**
* 列表页返回的主键
*/
@NotBlank(message = "主键不能为空", groups = {AddUserInternalGroup.class})
@NotBlank(message = "主键不能为空", groups = {AddUserInternalGroup.class,RefusedUserShowGroup.class})
private String actUserRelationId;
@NotBlank(message = "拒绝理由不能为空", groups = {UserShowGroup.class})
@NotBlank(message = "拒绝理由不能为空", groups = {RefusedUserShowGroup.class})
private String rejectReason;
}

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

@ -0,0 +1,30 @@
package com.epmet.dto.form.work;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 积分发放给分不给分通用入参
*
* @author yinzuomei@elink-cn.com
* @date 2020/7/24 13:10
*/
@Data
public class GrantPointsFormDTO implements Serializable {
private static final long serialVersionUID = 4785107755585941804L;
public interface AddUserInternalGroup {
}
public interface DenyUserShowGroup extends CustomerClientShowGroup {
}
/**
* 积分发放待处理列表返参中的actUserRelationId
*/
@NotBlank(message = "主键不能为空", groups = {AddUserInternalGroup.class,DenyUserShowGroup.class})
private String actUserRelationId;
@NotBlank(message = "理由不能为空", groups = {DenyUserShowGroup.class})
private String denyRewardReason;
}

50
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PendingUserResultDTO.java

@ -0,0 +1,50 @@
package com.epmet.dto.result.work;
import com.epmet.commons.tools.constant.StrConstant;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* 积分发放-待处理列表
*
* @author yinzuomei@elink-cn.com
* @date 2020/7/24 12:20
*/
@Data
public class PendingUserResultDTO implements Serializable {
private static final long serialVersionUID = -5744298386442386198L;
/**
* 活动id
*/
private String actId;
/**
* 活动标题
*/
private String title;
/**
* 积分奖励
*/
private Integer reward;
/**
* 已签到人员列表
*/
private List<UserBaseInfo> signedInList;
/**
* 未签到人员列表
*/
private List<UserBaseInfo> noSignInList;
public PendingUserResultDTO(String actId){
this.actId= actId;
this.title=StrConstant.EPMETY_STR;
this.reward=0;
this.signedInList=new ArrayList<>();
this.noSignInList=new ArrayList<>();
}
}

45
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserBaseInfo.java

@ -0,0 +1,45 @@
package com.epmet.dto.result.work;
import lombok.Data;
import java.io.Serializable;
/**
* 积分发放待处理界面用户基本信息
*
* @author yinzuomei@elink-cn.com
* @date 2020/7/24 12:22
*/
@Data
public class UserBaseInfo implements Serializable {
private static final long serialVersionUID = 4316319460642833716L;
/**
* act_user_relation主键
*/
private String actUserRelationId;
/**
* 用户id
*/
private String userId;
/**
* 姓名
*/
private String realName;
/**
* 微信昵称
*/
private String nickName;
/**
* 头像
*/
private String headImgUrl;
/**
* true: 是志愿者 false : 不是志愿者
*/
private Boolean volunteerFlag;
}

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

@ -1,7 +1,14 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.work.ActIdFormDTO;
import com.epmet.dto.form.work.GrantPointsFormDTO;
import com.epmet.dto.result.work.PendingUserResultDTO;
import com.epmet.service.GrantPointsService;
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;
@ -14,9 +21,61 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("grantpoints")
public class GrantPointsController {
@Autowired
private GrantPointsService grantPointsService;
/**
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.work.PendingUserResultDTO>
* @param formDTO
* @author yinzuomei
* @description 积分发放-待处理列表
* @Date 2020/7/24 12:28
**/
@PostMapping("pendinglist")
public Result queryPendingList(){
public Result<PendingUserResultDTO> queryPendingList(@RequestBody ActIdFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class);
return new Result<PendingUserResultDTO>().ok(grantPointsService.queryPendingList(formDTO.getActId()));
}
/**
* @return com.epmet.commons.tools.utils.Result
* @param formDTO
* @author yinzuomei
* @description 积分发放-不给分
* @Date 2020/7/24 13:14
**/
@PostMapping("deny")
public Result deny(@RequestBody GrantPointsFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, GrantPointsFormDTO.DenyUserShowGroup.class);
grantPointsService.deny(formDTO);
return new Result();
}
/**
* @return com.epmet.commons.tools.utils.Result
* @param formDTO
* @author yinzuomei
* @description 积分发放-给分
* @Date 2020/7/24 13:13
**/
@PostMapping("agree")
public Result agree(@RequestBody GrantPointsFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, GrantPointsFormDTO.AddUserInternalGroup.class);
grantPointsService.agree(formDTO);
return new Result();
}
/**
* @return com.epmet.commons.tools.utils.Result
* @param formDTO
* @author yinzuomei
* @description 积分发放-重新处理
* @Date 2020/7/24 15:16
**/
@PostMapping("reset")
public Result reset(@RequestBody GrantPointsFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, GrantPointsFormDTO.AddUserInternalGroup.class);
grantPointsService.reset(formDTO);
return new Result();
}
}

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

@ -141,7 +141,7 @@ public class WorkActUserController {
**/
@PostMapping("auditrefuse")
public Result auditrefuse(@RequestBody AuditUserFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, AuditUserFormDTO.UserShowGroup.class,AuditUserFormDTO.AddUserInternalGroup.class);
ValidatorUtils.validateEntity(formDTO, AuditUserFormDTO.RefusedUserShowGroup.class);
workActUserService.auditRefuse(formDTO);
return new Result();
}

18
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java

@ -118,4 +118,22 @@ public interface ActUserRelationDao extends BaseDao<ActUserRelationEntity> {
* @Date 2020/7/23 16:46
**/
List<UserHistoricalActInfoDTO> selectAllByUserId(String userId);
/**
* @return java.util.List<com.epmet.dto.ActUserRelationDTO>
* @param actId
* @author yinzuomei
* @description 查询待处理的记录
* @Date 2020/7/24 13:02
**/
List<ActUserRelationDTO> selectInProgress(String actId);
/**
* @return java.util.List<java.lang.String>
* @param actId
* @author yinzuomei
* @description 查询待处理的人员id集合
* @Date 2020/7/24 13:02
**/
List<String> selectInProgressUserIds(String actId);
}

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserLogEntity.java

@ -49,7 +49,7 @@ public class ActUserLogEntity extends BaseEpmetEntity {
* 操作类型已报名/待审核auditing
* 审核通过passed
* 审核不通过refused
* 取消报名canceld
* 取消报名canceled
*
*/
private String operationType;

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserRelationEntity.java

@ -52,7 +52,7 @@ public class ActUserRelationEntity extends BaseEpmetEntity {
* 当前状态已报名/待审核auditing
审核通过passed
审核不通过refused
取消报名canceld
取消报名canceled
*/
private String status;

48
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/GrantPointsService.java

@ -0,0 +1,48 @@
package com.epmet.service;
import com.epmet.dto.form.work.GrantPointsFormDTO;
import com.epmet.dto.result.work.PendingUserResultDTO;
/**
* 描述一下
*
* @author yinzuomei@elink-cn.com
* @date 2020/7/24 12:26
*/
public interface GrantPointsService {
/**
* @return com.epmet.dto.result.work.PendingUserResultDTO
* @param actId
* @author yinzuomei
* @description 积分发放-待处理列表
* @Date 2020/7/24 12:28
**/
PendingUserResultDTO queryPendingList(String actId);
/**
* @return void
* @param formDTO
* @author yinzuomei
* @description 积分发放-给分
* @Date 2020/7/24 13:34
**/
void agree(GrantPointsFormDTO formDTO);
/**
* @return void
* @param formDTO
* @author yinzuomei
* @description 积分发放-不给分
* @Date 2020/7/24 15:03
**/
void deny(GrantPointsFormDTO formDTO);
/**
* @return void
* @param formDTO
* @author yinzuomei
* @description 积分发放-重新处理
* @Date 2020/7/24 15:16
**/
void reset(GrantPointsFormDTO formDTO);
}

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

@ -1,6 +1,10 @@
package com.epmet.service;
import com.epmet.dto.form.work.*;
import com.epmet.dto.form.work.AactUserDetailFormDTO;
import com.epmet.dto.form.work.ActIdFormDTO;
import com.epmet.dto.form.work.AuditUserFormDTO;
import com.epmet.dto.form.work.UserHistoricalActFormDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.dto.result.work.*;
import java.util.List;
@ -110,4 +114,31 @@ public interface WorkActUserService {
* @Date 2020/7/24 10:54
**/
List<CanceledUserResultDTO> queryCanceledUserList(ActIdFormDTO formDTO);
/**
* @return com.epmet.dto.result.UserBaseInfoResultDTO
* @param userId
* @author yinzuomei
* @description 根据用户id获取用户基本信息
* @Date 2020/7/24 12:47
**/
UserBaseInfoResultDTO queryUserBaseInfo(String userId);
/**
* @return java.util.List<com.epmet.dto.result.UserBaseInfoResultDTO>
* @param userIdList
* @author yinzuomei
* @description 传入用户id集合返回用户的基本信息包含微信基本信息
* @Date 2020/7/24 12:47
**/
List<UserBaseInfoResultDTO> queryUserBaseInfoList(List<String> userIdList);
/**
* @return java.lang.Boolean
* @param userId
* @author yinzuomei
* @description 根据用户id判断是否志愿者
* @Date 2020/7/24 12:52
**/
Boolean getVolunteerFlag(String userId);
}

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

@ -0,0 +1,236 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.constant.ActConstant;
import com.epmet.dao.ActUserRelationDao;
import com.epmet.dto.ActInfoDTO;
import com.epmet.dto.ActPointLogDTO;
import com.epmet.dto.ActUserRelationDTO;
import com.epmet.dto.form.work.GrantPointsFormDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.dto.result.work.PendingUserResultDTO;
import com.epmet.dto.result.work.UserBaseInfo;
import com.epmet.service.*;
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;
/**
* 积分发放
*
* @author yinzuomei@elink-cn.com
* @date 2020/7/24 12:27
*/
@Service
public class GrantPointsServiceImpl implements GrantPointsService {
private Logger logger = LogManager.getLogger(GrantPointsServiceImpl.class);
@Autowired
private ActInfoService actInfoService;
@Autowired
private ActUserRelationDao actUserRelationDao;
@Autowired
private WorkActUserService workActUserService;
@Autowired
private ActUserRelationService actUserRelationService;
@Autowired
private ActPointLogService actPointLogService;
@Autowired
private LoginUserUtil loginUserUtil;
/**
* @param actId
* @return com.epmet.dto.result.work.PendingUserResultDTO
* @author yinzuomei
* @description 积分发放-待处理列表
* @Date 2020/7/24 12:28
**/
@Override
public PendingUserResultDTO queryPendingList(String actId) {
PendingUserResultDTO pendingUserResultDTO = new PendingUserResultDTO(actId);
ActInfoDTO actInfoDTO = actInfoService.get(actId);
if (null == actInfoDTO) {
return pendingUserResultDTO;
}
pendingUserResultDTO.setActId(actId);
pendingUserResultDTO.setReward(actInfoDTO.getReward());
pendingUserResultDTO.setTitle(actInfoDTO.getTitle());
//已签到人员列表
List<UserBaseInfo> signedInList = new ArrayList<>();
//未签到人员列表
List<UserBaseInfo> noSignInList = new ArrayList<>();
List<ActUserRelationDTO> signedActUserList = actUserRelationDao.selectInProgress(actId);
List<String> userIdList = actUserRelationDao.selectInProgressUserIds(actId);
List<UserBaseInfoResultDTO> userInfoList = workActUserService.queryUserBaseInfoList(userIdList);
for (ActUserRelationDTO actUserRelation : signedActUserList) {
UserBaseInfo userBaseInfo = new UserBaseInfo();
userBaseInfo.setActUserRelationId(actUserRelation.getId());
userBaseInfo.setUserId(actUserRelation.getUserId());
userBaseInfo.setVolunteerFlag(workActUserService.getVolunteerFlag(actUserRelation.getUserId()));
for (UserBaseInfoResultDTO userBaseInfoResultDTO : userInfoList) {
if (actUserRelation.getUserId().equals(userBaseInfoResultDTO.getUserId())) {
userBaseInfo.setRealName(userBaseInfoResultDTO.getRealName());
userBaseInfo.setNickName(userBaseInfoResultDTO.getNickname());
userBaseInfo.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl());
break;
}
}
if (ActConstant.ACT_USER_STATUS_SIGNED_IN.equals(actUserRelation.getSignInFlag())) {
//已签到
signedInList.add(userBaseInfo);
} else {
//未签到
noSignInList.add(userBaseInfo);
}
}
pendingUserResultDTO.setNoSignInList(noSignInList);
pendingUserResultDTO.setSignedInList(signedInList);
return pendingUserResultDTO;
}
/**
* @param formDTO
* @return void
* @author yinzuomei
* @description 积分发放-给分
* @Date 2020/7/24 13:34
**/
@Override
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())){
logger.info("积分发放-给分act_user_relation already handled,actUserRelationId="+formDTO.getActUserRelationId());
return;
}
//查取分值
ActInfoDTO actInfoDTO=actInfoService.get(actUserRelationDTO.getActId());
if (null == actInfoDTO || ActConstant.ACT_STATUS_FINISHED.equals(actInfoDTO.getActStatus())) {
logger.warn("积分发放-给分act_info is null or act_info is finished");
return;
}
if(!loginUserUtil.getLoginUserId().equals(actInfoDTO.getCreatedBy())){
throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode());
}
//更新act_user_relation改为已处理,给分
actUserRelationDTO.setProcessFlag(ActConstant.HANDLED);
actUserRelationDTO.setRewardFlag(ActConstant.ACT_USER_STATUS_AGREE);
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(actInfoDTO.getReward());
actPointLogDTO.setOperateType(ActConstant.ACT_USER_STATUS_AGREE);
actPointLogDTO.setRemark(StrConstant.EPMETY_STR);
/**
* 1有效0无效只有在活动真正结束后才是1
* true有效 false无效
*/
actPointLogDTO.setEffectFlag(false);
actPointLogService.save(actPointLogDTO);
}
/**
* @param formDTO
* @return void
* @author yinzuomei
* @description 积分发放-不给分
* @Date 2020/7/24 15:03
**/
@Override
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())){
logger.info("积分发放-不给分act_user_relation already handled,actUserRelationId="+formDTO.getActUserRelationId());
return;
}
//查取分值
ActInfoDTO actInfoDTO=actInfoService.get(actUserRelationDTO.getActId());
if (null == actInfoDTO || ActConstant.ACT_STATUS_FINISHED.equals(actInfoDTO.getActStatus())) {
logger.warn("积分发放-不给分act_info is null or act_info is finished");
return;
}
if(!loginUserUtil.getLoginUserId().equals(actInfoDTO.getCreatedBy())){
throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode());
}
//更新act_user_relation改为已处理,给分
actUserRelationDTO.setProcessFlag(ActConstant.HANDLED);
actUserRelationDTO.setRewardFlag(ActConstant.ACT_USER_STATUS_DENY);
actUserRelationDTO.setDenyRewardReason(formDTO.getDenyRewardReason());
actUserRelationService.update(actUserRelationDTO);
//增加一条act_point_log
ActPointLogDTO actPointLogDTO=new ActPointLogDTO();
actPointLogDTO.setActId(actUserRelationDTO.getActId());
actPointLogDTO.setUserId(actUserRelationDTO.getUserId());
actPointLogDTO.setPoints(actInfoDTO.getReward());
actPointLogDTO.setOperateType(ActConstant.ACT_USER_STATUS_DENY);
actPointLogDTO.setRemark(formDTO.getDenyRewardReason());
/**
* 1有效0无效只有在活动真正结束后才是1
* true有效 false无效
*/
actPointLogDTO.setEffectFlag(false);
actPointLogService.save(actPointLogDTO);
}
/**
* @param formDTO
* @return void
* @author yinzuomei
* @description 积分发放-重新处理
* @Date 2020/7/24 15:16
**/
@Override
public void reset(GrantPointsFormDTO formDTO) {
ActUserRelationDTO actUserRelationDTO=actUserRelationService.get(formDTO.getActUserRelationId());
if(null==actUserRelationDTO){
logger.warn("积分发放-重新处理act_user_relation is null,actUserRelationId="+formDTO.getActUserRelationId());
return;
}
//查取分值
ActInfoDTO actInfoDTO=actInfoService.get(actUserRelationDTO.getActId());
if (null == actInfoDTO || ActConstant.ACT_STATUS_FINISHED.equals(actInfoDTO.getActStatus())) {
logger.warn("积分发放-重新处理act_info is null or act_info is finished");
return;
}
if(!loginUserUtil.getLoginUserId().equals(actInfoDTO.getCreatedBy())){
throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode());
}
//更新act_user_relation改为未处理 初始状态
actUserRelationDTO.setProcessFlag(StrConstant.EPMETY_STR);
actUserRelationDTO.setRewardFlag(StrConstant.EPMETY_STR);
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(actInfoDTO.getReward());
actPointLogDTO.setOperateType(ActConstant.RESET);
actPointLogDTO.setRemark(StrConstant.EPMETY_STR);
/**
* 1有效0无效只有在活动真正结束后才是1
* true有效 false无效
*/
actPointLogDTO.setEffectFlag(false);
actPointLogService.save(actPointLogDTO);
}
}

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

@ -560,7 +560,15 @@ public class WorkActUserServiceImpl implements WorkActUserService {
return historicalActInfo;
}
private Boolean getVolunteerFlag(String userId) {
/**
* @return java.lang.Boolean
* @param userId
* @author yinzuomei
* @description 根据用户id判断是否志愿者
* @Date 2020/7/24 12:51
**/
@Override
public Boolean getVolunteerFlag(String userId) {
HeartUserInfoDTO heartUserInfoDTO=heartUserInfoService.getByUserId(userId);
//true: 是志愿者 false : 不是志愿者
if(null!=heartUserInfoDTO){
@ -576,7 +584,8 @@ public class WorkActUserServiceImpl implements WorkActUserService {
* @description 传入用户id集合返回用户的基本信息包含微信基本信息
* @Date 2020/7/22 10:38
**/
private List<UserBaseInfoResultDTO> queryUserBaseInfoList(List<String> userIdList) {
@Override
public List<UserBaseInfoResultDTO> queryUserBaseInfoList(List<String> userIdList) {
List<UserBaseInfoResultDTO> userInfoList=new ArrayList<>();
if(null==userIdList||userIdList.size()==0){
return userInfoList;
@ -598,7 +607,8 @@ public class WorkActUserServiceImpl implements WorkActUserService {
* @description 根据用户id获取用户基本信息
* @Date 2020/7/23 12:52
**/
private UserBaseInfoResultDTO queryUserBaseInfo(String userId) {
@Override
public UserBaseInfoResultDTO queryUserBaseInfo(String userId) {
List<String> userIdList = new ArrayList<>();
userIdList.add(userId);
//调用epemet_user服务获取用户的基本信息

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

@ -573,7 +573,7 @@
and ai.DEL_FLAG='0')
WHERE
aur.DEL_FLAG = '0'
AND aur.`STATUS` = 'canceld'
AND aur.`STATUS` = 'canceled'
AND aur.ACT_ID =#{actId}
order by aur.CANCEL_TIME desc
</select>

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

@ -162,4 +162,31 @@
ORDER BY
acr.CREATED_TIME DESC
</select>
<!-- 查询待处理的记录 -->
<select id="selectInProgress" resultType="com.epmet.dto.ActUserRelationDTO" parameterType="java.lang.String">
SELECT
aur.ID,
aur.ACT_ID,
aur.USER_ID,
aur.SIGN_IN_FLAG
FROM
act_user_relation aur
WHERE
aur.DEL_FLAG = '0'
AND aur.PROCESS_FLAG != 'handled'
AND aur.ACT_ID = #{actId}
</select>
<!-- 查询待处理的人员id集合 -->
<select id="selectInProgressUserIds" resultType="java.lang.String" parameterType="java.lang.String">
SELECT
distinct aur.USER_ID
FROM
act_user_relation aur
WHERE
aur.DEL_FLAG = '0'
AND aur.PROCESS_FLAG != 'handled'
AND aur.ACT_ID = #{actId}
</select>
</mapper>

Loading…
Cancel
Save