|
@ -14,6 +14,7 @@ import com.epmet.dao.BadgeDao; |
|
|
import com.epmet.dao.ResiUserBadgeDao; |
|
|
import com.epmet.dao.ResiUserBadgeDao; |
|
|
import com.epmet.dao.UserBadgeDao; |
|
|
import com.epmet.dao.UserBadgeDao; |
|
|
import com.epmet.dao.UserRoleDao; |
|
|
import com.epmet.dao.UserRoleDao; |
|
|
|
|
|
import com.epmet.dto.ResiUserBadgeDTO; |
|
|
import com.epmet.dto.UserBadgeCertificateRecordDTO; |
|
|
import com.epmet.dto.UserBadgeCertificateRecordDTO; |
|
|
import com.epmet.dto.form.*; |
|
|
import com.epmet.dto.form.*; |
|
|
import com.epmet.dto.result.*; |
|
|
import com.epmet.dto.result.*; |
|
@ -28,10 +29,7 @@ import org.springframework.stereotype.Service; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.util.CollectionUtils; |
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
import java.util.*; |
|
|
import java.util.Collections; |
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -157,7 +155,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { |
|
|
UserBadgeCertificateRecordDTO form = ConvertUtils.sourceToTarget(certificationAddFormDTO, UserBadgeCertificateRecordDTO.class); |
|
|
UserBadgeCertificateRecordDTO form = ConvertUtils.sourceToTarget(certificationAddFormDTO, UserBadgeCertificateRecordDTO.class); |
|
|
List<String> userIds = new ArrayList<>(); |
|
|
List<String> userIds = new ArrayList<>(); |
|
|
userIds.add(certificationAddFormDTO.getUserId()); |
|
|
userIds.add(certificationAddFormDTO.getUserId()); |
|
|
List<UserBaseInfoResultDTO> userBaseInfoResultDTOS = userBaseInfoService.queryUserBaseInfo(userIds); |
|
|
List<UserBaseInfoResultDTO> userBaseInfoResultDTOS = userBaseInfoService.queryUserBaseInfoFromCache(userIds); |
|
|
if (CollectionUtils.isEmpty(userBaseInfoResultDTOS)){ |
|
|
if (CollectionUtils.isEmpty(userBaseInfoResultDTOS)){ |
|
|
throw new RenException("查询用户基本信息集合为空......"); |
|
|
throw new RenException("查询用户基本信息集合为空......"); |
|
|
} |
|
|
} |
|
@ -310,15 +308,43 @@ public class UserBadgeServiceImpl implements UserBadgeService { |
|
|
* @Description 批量获取用户显示徽章 |
|
|
* @Description 批量获取用户显示徽章 |
|
|
* @param customerId |
|
|
* @param customerId |
|
|
* @param userIds |
|
|
* @param userIds |
|
|
* @return java.util.Map<java.lang.String,java.util.List< com.epmet.dto.result.UserBadgeInfoResultDTO>> |
|
|
* @return java.util.Map<java.lang.String, java.util.List < com.epmet.dto.result.UserBadgeInfoResultDTO>> |
|
|
* @author wangc |
|
|
* @author wangc |
|
|
* @date 2020.11.10 15:12 |
|
|
* @date 2020.11.10 15:12 |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public Map<String, List<UserBadgeInfoResultDTO>> getBatchUserSortedBadge(String customerId, List<String> userIds) { |
|
|
public Map<String, List<UserBadgeInfoResultDTO>> getBatchUserSortedBadge(String customerId, List<String> userIds) { |
|
|
List<UserBadgeInfoResultDTO> badges = userBadgeDao.selectBatchUserSortedBadge(customerId,userIds); |
|
|
List<UserBadgeInfoResultDTO> badges = userBadgeDao.selectBatchUserSortedBadge(customerId, userIds); |
|
|
if(CollectionUtils.isEmpty(badges)) return Collections.EMPTY_MAP; |
|
|
if (CollectionUtils.isEmpty(badges)) return Collections.EMPTY_MAP; |
|
|
return badges.stream().collect(Collectors.groupingBy(UserBadgeInfoResultDTO :: getUserId)); |
|
|
return badges.stream().collect(Collectors.groupingBy(UserBadgeInfoResultDTO::getUserId)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* desc: 添加用户党员徽章记录 |
|
|
|
|
|
* |
|
|
|
|
|
* @param tokenDto |
|
|
|
|
|
* @param formDTO |
|
|
|
|
|
* @return java.lang.Boolean |
|
|
|
|
|
* @author LiuJanJun |
|
|
|
|
|
* @date 2020/11/18 10:32 上午 |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public Boolean addUserPartyBadgeRecord(TokenDto tokenDto, AddUserPartyBadgeFormDTO formDTO) { |
|
|
|
|
|
String badgeId = badgeDao.getPartyBadgeId(tokenDto.getCustomerId()); |
|
|
|
|
|
ResiUserBadgeDTO resiUserBadgeDTO = new ResiUserBadgeDTO(); |
|
|
|
|
|
resiUserBadgeDTO.setCustomerId(tokenDto.getCustomerId()); |
|
|
|
|
|
resiUserBadgeDTO.setBadgeId(badgeId); |
|
|
|
|
|
UserBaseInfoResultDTO userInfo = userBaseInfoService.queryUserBaseInfoFromCache(formDTO.getUserId()); |
|
|
|
|
|
if (userInfo == null) { |
|
|
|
|
|
log.error("获取用户信息失败"); |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
resiUserBadgeDTO.setGridId(userInfo.getRegisteredGridId()); |
|
|
|
|
|
resiUserBadgeDTO.setUserId(formDTO.getUserId()); |
|
|
|
|
|
resiUserBadgeDTO.setIsOpened(NumConstant.ONE); |
|
|
|
|
|
resiUserBadgeDTO.setCertificationAutidStatus(BadgeConstant.APPROVED); |
|
|
|
|
|
resiUserBadgeDao.insertResiUserBadge(Arrays.asList(resiUserBadgeDTO)); |
|
|
|
|
|
return true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|