|
@@ -105,6 +105,10 @@ public class UserService {
|
|
|
private OrderRepo orderRepo;
|
|
private OrderRepo orderRepo;
|
|
|
private AuctionPassRecordRepo auctionPassRecordRepo;
|
|
private AuctionPassRecordRepo auctionPassRecordRepo;
|
|
|
private AssetRepo assetRepo;
|
|
private AssetRepo assetRepo;
|
|
|
|
|
+ private ShowroomRepo showroomRepo;
|
|
|
|
|
+ private ShowCollectionRepo showCollectionRepo;
|
|
|
|
|
+ private ShowroomService showroomService;
|
|
|
|
|
+ private NewsLikeRepo newsLikeRepo;
|
|
|
|
|
|
|
|
public User update(User user) {
|
|
public User update(User user) {
|
|
|
if (!SecurityUtils.hasRole(AuthorityName.ROLE_ADMIN)) {
|
|
if (!SecurityUtils.hasRole(AuthorityName.ROLE_ADMIN)) {
|
|
@@ -579,7 +583,7 @@ public class UserService {
|
|
|
throw new BusinessException("用户不存在或未认证");
|
|
throw new BusinessException("用户不存在或未认证");
|
|
|
}
|
|
}
|
|
|
String realName = identityAuthRepo.findFirstByUserIdAndStatusAndDelFalseOrderByCreatedAtDesc(
|
|
String realName = identityAuthRepo.findFirstByUserIdAndStatusAndDelFalseOrderByCreatedAtDesc(
|
|
|
- user.getId(), AuthStatus.SUCCESS)
|
|
|
|
|
|
|
+ user.getId(), AuthStatus.SUCCESS)
|
|
|
.map(IdentityAuth::getRealName).orElse("").replaceAll(".*(?=.)", "**");
|
|
.map(IdentityAuth::getRealName).orElse("").replaceAll(".*(?=.)", "**");
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("id", user.getId());
|
|
map.put("id", user.getId());
|
|
@@ -592,8 +596,8 @@ public class UserService {
|
|
|
|
|
|
|
|
public Map<String, Object> searchByPhoneAdmin(String phoneStr) {
|
|
public Map<String, Object> searchByPhoneAdmin(String phoneStr) {
|
|
|
List<String> phone = Arrays.stream(phoneStr.replaceAll("\n", " ")
|
|
List<String> phone = Arrays.stream(phoneStr.replaceAll("\n", " ")
|
|
|
- .replaceAll("\r\n", " ")
|
|
|
|
|
- .split(" "))
|
|
|
|
|
|
|
+ .replaceAll("\r\n", " ")
|
|
|
|
|
+ .split(" "))
|
|
|
.map(String::trim)
|
|
.map(String::trim)
|
|
|
.filter(s -> !StringUtils.isEmpty(s))
|
|
.filter(s -> !StringUtils.isEmpty(s))
|
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
@@ -927,6 +931,28 @@ public class UserService {
|
|
|
} else {
|
|
} else {
|
|
|
oasisLoginDTO.setUrl("未公开展示");
|
|
oasisLoginDTO.setUrl("未公开展示");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ Showroom showroom = showroomRepo.findByOasisId(oasisLoginDTO.getOasisId())
|
|
|
|
|
+ .orElseThrow(new BusinessException("无记录 "));
|
|
|
|
|
+ List<ShowCollection> origin = showCollectionRepo.findAllByShowroomIdOrderBySort(showroom.getId());
|
|
|
|
|
+ List<ShowCollection> neo = new ArrayList<>();
|
|
|
|
|
+ if (origin != null) {
|
|
|
|
|
+ origin.forEach(orig -> collectionRepo.findById(orig.getCollectionId())
|
|
|
|
|
+ .ifPresent(collection1 -> {
|
|
|
|
|
+ orig.setStatus(showroomService.getStatus(collection1));
|
|
|
|
|
+ orig.setPrice(collection1.getPrice());
|
|
|
|
|
+ neo.add(orig);
|
|
|
|
|
+ }));
|
|
|
|
|
+ }
|
|
|
|
|
+ showroom.setCollections(neo);
|
|
|
|
|
+ User showRoomUser = SecurityUtils.getAuthenticatedUser();
|
|
|
|
|
+
|
|
|
|
|
+ if (showRoomUser != null && !showRoomUser.isAdmin()) {
|
|
|
|
|
+ List<NewsLike> likes = newsLikeRepo.findByUserIdAndShowroomId(showRoomUser
|
|
|
|
|
+ .getId(), showroom.getId());
|
|
|
|
|
+ showroom.setLiked(CollUtil.isNotEmpty(likes));
|
|
|
|
|
+ }
|
|
|
|
|
+ oasisLoginDTO.setShowroom(showroom);
|
|
|
oasisLoginDTOS.add(oasisLoginDTO);
|
|
oasisLoginDTOS.add(oasisLoginDTO);
|
|
|
});
|
|
});
|
|
|
map.put("oasisInfo", oasisLoginDTOS);
|
|
map.put("oasisInfo", oasisLoginDTOS);
|