|
|
@ -1,10 +1,15 @@ |
|
|
|
package com.epmet.service.impl; |
|
|
|
|
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.constant.ActConstant; |
|
|
|
import com.epmet.dao.ActInfoDao; |
|
|
|
import com.epmet.dao.ActUserLogDao; |
|
|
|
import com.epmet.dao.ActUserRelationDao; |
|
|
|
import com.epmet.dto.ActUserLogDTO; |
|
|
|
import com.epmet.dto.ActUserRelationDTO; |
|
|
|
import com.epmet.dto.HeartUserInfoDTO; |
|
|
|
import com.epmet.dto.form.work.AactUserDetailFormDTO; |
|
|
|
import com.epmet.dto.form.work.AuditingActUserFormDTO; |
|
|
|
import com.epmet.dto.result.UserBaseInfoResultDTO; |
|
|
|
import com.epmet.dto.result.work.*; |
|
|
@ -37,6 +42,10 @@ public class WorkActUserServiceImpl implements WorkActUserService { |
|
|
|
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|
|
|
@Autowired |
|
|
|
private ActInfoDao actInfoDao; |
|
|
|
@Autowired |
|
|
|
private ActUserLogDao actUserLogDao; |
|
|
|
@Autowired |
|
|
|
private ActUserRelationDao actUserRelationDao; |
|
|
|
/** |
|
|
|
* @param formDTO |
|
|
|
* @return java.util.List<com.epmet.dto.result.work.AuditingActUserResultDTO> |
|
|
@ -56,7 +65,7 @@ public class WorkActUserServiceImpl implements WorkActUserService { |
|
|
|
//查询出待审核的人员id集合
|
|
|
|
List<String> userIdList=actUserRelationService.getUserIdList(formDTO.getActId(), ActConstant.ACT_USER_STATUS_AUDITING); |
|
|
|
//根据待审核的人员集合,查询出用户基本信息
|
|
|
|
List<UserBaseInfoResultDTO> userInfoList=this.queryUserBaseInfo(userIdList); |
|
|
|
List<UserBaseInfoResultDTO> userInfoList=this.queryUserBaseInfoList(userIdList); |
|
|
|
for(ActUserRelationDTO actUserRelationDTO:actUserRelationDTOList){ |
|
|
|
AuditingActUserResultDTO auditingDTO=new AuditingActUserResultDTO(); |
|
|
|
auditingDTO.setActUserRelationId(actUserRelationDTO.getId()); |
|
|
@ -98,7 +107,7 @@ public class WorkActUserServiceImpl implements WorkActUserService { |
|
|
|
//查询已通过审核的人员id集合
|
|
|
|
List<String> userIdList=actUserRelationService.getUserIdList(formDTO.getActId(), ActConstant.ACT_USER_STATUS_PASSED); |
|
|
|
//根据已通过的人员集合,查询出用户基本信息
|
|
|
|
List<UserBaseInfoResultDTO> userInfoList=this.queryUserBaseInfo(userIdList); |
|
|
|
List<UserBaseInfoResultDTO> userInfoList=this.queryUserBaseInfoList(userIdList); |
|
|
|
for(ActUserRelationDTO actUserRelationDTO:actUserRelationDTOList){ |
|
|
|
PassedActUserResultDTO passedDTO=new PassedActUserResultDTO(); |
|
|
|
passedDTO.setActUserRelationId(actUserRelationDTO.getId()); |
|
|
@ -141,7 +150,7 @@ public class WorkActUserServiceImpl implements WorkActUserService { |
|
|
|
//查询已拒绝审核的人员id集合
|
|
|
|
List<String> userIdList=actUserRelationService.getUserIdList(formDTO.getActId(), ActConstant.ACT_USER_STATUS_REFUSED); |
|
|
|
//根据已拒绝的人员集合,查询出用户基本信息
|
|
|
|
List<UserBaseInfoResultDTO> userInfoList=this.queryUserBaseInfo(userIdList); |
|
|
|
List<UserBaseInfoResultDTO> userInfoList=this.queryUserBaseInfoList(userIdList); |
|
|
|
for(ActUserRelationDTO actUserRelationDTO:actUserRelationDTOList){ |
|
|
|
RejectedActUserResultDTO rejectedDTO=new RejectedActUserResultDTO(); |
|
|
|
rejectedDTO.setActUserRelationId(actUserRelationDTO.getId()); |
|
|
@ -185,7 +194,7 @@ public class WorkActUserServiceImpl implements WorkActUserService { |
|
|
|
//查询已取消审核的人员id集合
|
|
|
|
List<String> userIdList=actUserRelationService.getUserIdList(formDTO.getActId(), ActConstant.ACT_USER_STATUS_CANCELD); |
|
|
|
//根据已取消的人员集合,查询出用户基本信息
|
|
|
|
List<UserBaseInfoResultDTO> userInfoList=this.queryUserBaseInfo(userIdList); |
|
|
|
List<UserBaseInfoResultDTO> userInfoList=this.queryUserBaseInfoList(userIdList); |
|
|
|
for(ActUserRelationDTO actUserRelationDTO:actUserRelationDTOList){ |
|
|
|
CanceledActUserResultDTO cancelDTO=new CanceledActUserResultDTO(); |
|
|
|
cancelDTO.setActUserRelationId(actUserRelationDTO.getId()); |
|
|
@ -241,6 +250,89 @@ public class WorkActUserServiceImpl implements WorkActUserService { |
|
|
|
return actInfo; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param formDTO |
|
|
|
* @return com.epmet.dto.result.work.AuditingUserDetailResultDTO |
|
|
|
* @author yinzuomei |
|
|
|
* @description 报名审核-待审核人员详情 |
|
|
|
* @Date 2020/7/22 22:44 |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
public AuditingUserDetailResultDTO queryAuditingUserDetail(AactUserDetailFormDTO formDTO) { |
|
|
|
ActUserRelationDTO actUserRelationDTO=actUserRelationService.get(formDTO.getActUserRelationId()); |
|
|
|
UserBaseInfoResultDTO userBaseInfo=queryUserBaseInfo(actUserRelationDTO.getUserId()); |
|
|
|
AuditingUserDetailResultDTO resultDTO=new AuditingUserDetailResultDTO(); |
|
|
|
//基本信息赋值
|
|
|
|
resultDTO.setActId(actUserRelationDTO.getActId()); |
|
|
|
resultDTO.setUserId(actUserRelationDTO.getUserId()); |
|
|
|
resultDTO.setRealName(userBaseInfo.getRealName()); |
|
|
|
resultDTO.setGender(userBaseInfo.getGender()); |
|
|
|
resultDTO.setMobile(userBaseInfo.getMobile()); |
|
|
|
resultDTO.setIdNum(userBaseInfo.getIdNum()); |
|
|
|
resultDTO.setAddress(userBaseInfo.getStreet()+userBaseInfo.getDistrict()+userBaseInfo.getBuildingAddress()); |
|
|
|
resultDTO.setSignUpTime(actUserRelationDTO.getCreatedTime()); |
|
|
|
/** |
|
|
|
* 当前状态(已报名/待审核auditing, |
|
|
|
审核通过passed, |
|
|
|
审核不通过refused |
|
|
|
取消报名canceld, |
|
|
|
) |
|
|
|
*/ |
|
|
|
resultDTO.setStatus(actUserRelationDTO.getStatus()); |
|
|
|
HistoricalActInfo historicalActInfo=this.getHistoricalActInfo(actUserRelationDTO.getUserId()); |
|
|
|
resultDTO.setHistoricalActInfo(historicalActInfo); |
|
|
|
if(ActConstant.ACT_USER_STATUS_AUDITING.equals(resultDTO.getStatus())){ |
|
|
|
//被拒绝过,才赋值
|
|
|
|
Integer refusedCount=actUserLogDao.selectRefusedCount(actUserRelationDTO.getActId(),actUserRelationDTO.getUserId()); |
|
|
|
if(null!=refusedCount&&refusedCount>0){ |
|
|
|
ActUserLogDTO latestRefused=actUserLogDao.selectLatestRefused(actUserRelationDTO.getActId(),actUserRelationDTO.getUserId()); |
|
|
|
HistoricalAuditResult historicalAuditResult=new HistoricalAuditResult(); |
|
|
|
historicalAuditResult.setLatestAuditTime(latestRefused.getCreatedTime()); |
|
|
|
historicalAuditResult.setLatestRefusedReason(latestRefused.getReason()); |
|
|
|
historicalAuditResult.setRefusedCountDesc(String.format("已拒绝%s次",refusedCount)); |
|
|
|
resultDTO.setHistoricalAuditResult(historicalAuditResult); |
|
|
|
} |
|
|
|
}else if(ActConstant.ACT_USER_STATUS_PASSED.equals(resultDTO.getStatus())||ActConstant.ACT_USER_STATUS_REFUSED.equals(resultDTO.getStatus())){ |
|
|
|
AuditResult auditResult=new AuditResult(); |
|
|
|
auditResult.setAuditTime(actUserRelationDTO.getAuditTime()); |
|
|
|
auditResult.setRefusedReason(actUserRelationDTO.getFailureReason()); |
|
|
|
resultDTO.setAuditResult(auditResult); |
|
|
|
}else if(ActConstant.ACT_USER_STATUS_CANCELD.equals(resultDTO.getStatus())){ |
|
|
|
CancelResult cancelResult=new CancelResult(); |
|
|
|
cancelResult.setCancelReason(actUserRelationDTO.getCancelReason()); |
|
|
|
cancelResult.setCancelTime(actUserRelationDTO.getCancelTime()); |
|
|
|
resultDTO.setCancelResult(cancelResult); |
|
|
|
} |
|
|
|
return resultDTO; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return com.epmet.dto.result.work.HistoricalActInfo |
|
|
|
* @param userId |
|
|
|
* @author yinzuomei |
|
|
|
* @description 用户历史活动情况 |
|
|
|
* @Date 2020/7/23 15:56 |
|
|
|
**/ |
|
|
|
private HistoricalActInfo getHistoricalActInfo(String userId) { |
|
|
|
HistoricalActInfo historicalActInfo=new HistoricalActInfo(); |
|
|
|
/** |
|
|
|
* 实际参加活动个数(已经签到的) |
|
|
|
*/ |
|
|
|
Integer signInActNum=actUserRelationDao.countSignInActNum(userId); |
|
|
|
historicalActInfo.setSignInActNum(signInActNum); |
|
|
|
/** |
|
|
|
* 报名活动个数(act_user_realation) |
|
|
|
*/ |
|
|
|
Integer signUpActNum=actUserRelationDao.countSignUpActNum(userId); |
|
|
|
historicalActInfo.setSignUpActNum(signUpActNum); |
|
|
|
/** |
|
|
|
* 获得积分活动个数 |
|
|
|
*/ |
|
|
|
Integer obtainPointsActNum=actUserRelationDao.countObtainPointsActNum(userId); |
|
|
|
historicalActInfo.setObtainPointsActNum(obtainPointsActNum); |
|
|
|
return historicalActInfo; |
|
|
|
} |
|
|
|
|
|
|
|
private Boolean getVolunteerFlag(String userId) { |
|
|
|
HeartUserInfoDTO heartUserInfoDTO=heartUserInfoService.getByUserId(userId); |
|
|
|
//true: 是志愿者 false : 不是志愿者
|
|
|
@ -257,7 +349,7 @@ public class WorkActUserServiceImpl implements WorkActUserService { |
|
|
|
* @description 传入用户id集合,返回用户的基本信息(包含微信基本信息) |
|
|
|
* @Date 2020/7/22 10:38 |
|
|
|
**/ |
|
|
|
private List<UserBaseInfoResultDTO> queryUserBaseInfo(List<String> userIdList) { |
|
|
|
private List<UserBaseInfoResultDTO> queryUserBaseInfoList(List<String> userIdList) { |
|
|
|
List<UserBaseInfoResultDTO> userInfoList=new ArrayList<>(); |
|
|
|
if(null==userIdList||userIdList.size()==0){ |
|
|
|
return userInfoList; |
|
|
@ -271,4 +363,22 @@ public class WorkActUserServiceImpl implements WorkActUserService { |
|
|
|
} |
|
|
|
return userInfoList; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return com.epmet.dto.result.UserBaseInfoResultDTO |
|
|
|
* @param userId |
|
|
|
* @author yinzuomei |
|
|
|
* @description 根据用户id获取用户基本信息 |
|
|
|
* @Date 2020/7/23 12:52 |
|
|
|
**/ |
|
|
|
private UserBaseInfoResultDTO queryUserBaseInfo(String userId) { |
|
|
|
List<String> userIdList = new ArrayList<>(); |
|
|
|
userIdList.add(userId); |
|
|
|
//调用epemet_user服务获取用户的基本信息
|
|
|
|
Result<List<UserBaseInfoResultDTO>> resultUserList = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList); |
|
|
|
if (!resultUserList.success() || resultUserList.getData().size() < 1 || null == resultUserList.getData().get(0)) { |
|
|
|
throw new RenException("查询用户基本信息失败"); |
|
|
|
} |
|
|
|
return resultUserList.getData().get(0); |
|
|
|
} |
|
|
|
} |
|
|
|