|
@ -65,6 +65,8 @@ public class UserBadgeServiceImpl implements UserBadgeService { |
|
|
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|
|
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private BadgeCertificationConfigDao badgeCertificationConfigDao; |
|
|
private BadgeCertificationConfigDao badgeCertificationConfigDao; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private UserBadgeCertificateRecordDao userBadgeCertificateRecordDao; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @Description 查询已经点亮的徽章 |
|
|
* @Description 查询已经点亮的徽章 |
|
@ -84,6 +86,8 @@ public class UserBadgeServiceImpl implements UserBadgeService { |
|
|
if (CollectionUtils.isEmpty(userBadgeListResultDTOS)){ |
|
|
if (CollectionUtils.isEmpty(userBadgeListResultDTOS)){ |
|
|
return redisUserBadgeList.stream().sorted(Comparator.comparing(UserBadgeListResultDTO::getSort)).collect(Collectors.toList()); |
|
|
return redisUserBadgeList.stream().sorted(Comparator.comparing(UserBadgeListResultDTO::getSort)).collect(Collectors.toList()); |
|
|
} |
|
|
} |
|
|
|
|
|
List<UserBadgeListResultDTO> result = new ArrayList<>(); |
|
|
|
|
|
result.addAll(userBadgeListResultDTOS); |
|
|
redisUserBadgeList.forEach(u -> { |
|
|
redisUserBadgeList.forEach(u -> { |
|
|
userBadgeListResultDTOS.forEach(badge -> { |
|
|
userBadgeListResultDTOS.forEach(badge -> { |
|
|
if (u.getBadgeId().equals(badge.getBadgeId())){ |
|
|
if (u.getBadgeId().equals(badge.getBadgeId())){ |
|
@ -93,7 +97,13 @@ public class UserBadgeServiceImpl implements UserBadgeService { |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
return redisUserBadgeList.stream().sorted(Comparator.comparing(UserBadgeListResultDTO::getStatus,Comparator.reverseOrder()).thenComparing(UserBadgeListResultDTO::getUpdatedTime,Comparator.reverseOrder()).thenComparing(UserBadgeListResultDTO::getSort)).collect(Collectors.toList()); |
|
|
Map<Boolean, List<UserBadgeListResultDTO>> collect = redisUserBadgeList.stream().collect(Collectors.groupingBy(UserBadgeListResultDTO::getStatus)); |
|
|
|
|
|
List<UserBadgeListResultDTO> noIsLight = collect.get(false); |
|
|
|
|
|
if (CollectionUtils.isEmpty(noIsLight)){ |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
result.addAll(noIsLight.stream().sorted(Comparator.comparing(UserBadgeListResultDTO::getSort)).collect(Collectors.toList())); |
|
|
|
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -233,6 +243,10 @@ public class UserBadgeServiceImpl implements UserBadgeService { |
|
|
@Override |
|
|
@Override |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public Result authBadgeRecord(CertificationAddFormDTO certificationAddFormDTO) { |
|
|
public Result authBadgeRecord(CertificationAddFormDTO certificationAddFormDTO) { |
|
|
|
|
|
Integer recordCount = userBadgeCertificateRecordDao.selectIsExist(certificationAddFormDTO.getBadgeId(), certificationAddFormDTO.getUserId()); |
|
|
|
|
|
if (recordCount>NumConstant.ZERO){ |
|
|
|
|
|
throw new RenException("不允许重复提交审核"); |
|
|
|
|
|
} |
|
|
log.info(JSON.toJSONString(certificationAddFormDTO)); |
|
|
log.info(JSON.toJSONString(certificationAddFormDTO)); |
|
|
AuthFieldFormDTO authFieldFormDTO = new AuthFieldFormDTO(); |
|
|
AuthFieldFormDTO authFieldFormDTO = new AuthFieldFormDTO(); |
|
|
authFieldFormDTO.setCustomerId(certificationAddFormDTO.getCustomerId()); |
|
|
authFieldFormDTO.setCustomerId(certificationAddFormDTO.getCustomerId()); |
|
|