|
|
@@ -75,40 +75,41 @@ import java.util.stream.Collectors;
|
|
|
@Slf4j
|
|
|
@AllArgsConstructor
|
|
|
public class UserService {
|
|
|
- private UserRepo userRepo;
|
|
|
- private WxMaService wxMaService;
|
|
|
- private WxMpService wxMpService;
|
|
|
- private SmsService smsService;
|
|
|
- private StorageService storageService;
|
|
|
- private JwtTokenUtil jwtTokenUtil;
|
|
|
- private FollowService followService;
|
|
|
- private FollowRepo followRepo;
|
|
|
- private IdentityAuthRepo identityAuthRepo;
|
|
|
- private SysConfigService sysConfigService;
|
|
|
- private UserBankCardRepo userBankCardRepo;
|
|
|
- private InviteRepo inviteRepo;
|
|
|
- private CacheService cacheService;
|
|
|
- private CollectionRepo collectionRepo;
|
|
|
- private AdapayMerchantService adapayMerchantService;
|
|
|
- private RocketMQTemplate rocketMQTemplate;
|
|
|
- private GeneralProperties generalProperties;
|
|
|
+ private UserRepo userRepo;
|
|
|
+ private WxMaService wxMaService;
|
|
|
+ private WxMpService wxMpService;
|
|
|
+ private SmsService smsService;
|
|
|
+ private StorageService storageService;
|
|
|
+ private JwtTokenUtil jwtTokenUtil;
|
|
|
+ private FollowService followService;
|
|
|
+ private FollowRepo followRepo;
|
|
|
+ private IdentityAuthRepo identityAuthRepo;
|
|
|
+ private SysConfigService sysConfigService;
|
|
|
+ private UserBankCardRepo userBankCardRepo;
|
|
|
+ private InviteRepo inviteRepo;
|
|
|
+ private CacheService cacheService;
|
|
|
+ private CollectionRepo collectionRepo;
|
|
|
+ private AdapayMerchantService adapayMerchantService;
|
|
|
+ private RocketMQTemplate rocketMQTemplate;
|
|
|
+ private GeneralProperties generalProperties;
|
|
|
private RedisTemplate<String, Object> redisTemplate;
|
|
|
- private PasswordEncoder passwordEncoder;
|
|
|
- private WeakPassRepo weakPassRepo;
|
|
|
- private UserBalanceRepo userBalanceRepo;
|
|
|
- private ContentAuditService contentAuditService;
|
|
|
- private HeatInfoRepo heatInfoRepo;
|
|
|
- private ShowroomRepo showroomRepo;
|
|
|
- private TradingAccountRepo tradingAccountRepo;
|
|
|
- private AlipayClient alipayClient;
|
|
|
- private SnowflakeIdWorker snowflakeIdWorker;
|
|
|
- private FaceAuthRepo faceAuthRepo;
|
|
|
- private AuctionPassRecordRepo auctionPassRecordRepo;
|
|
|
- private AssetRepo assetRepo;
|
|
|
- private ShowCollectionRepo showCollectionRepo;
|
|
|
- private ShowroomService showroomService;
|
|
|
- private NewsLikeRepo newsLikeRepo;
|
|
|
- private RockRecordRepo rockRecordRepo;
|
|
|
+ private PasswordEncoder passwordEncoder;
|
|
|
+ private WeakPassRepo weakPassRepo;
|
|
|
+ private UserBalanceRepo userBalanceRepo;
|
|
|
+ private ContentAuditService contentAuditService;
|
|
|
+ private HeatInfoRepo heatInfoRepo;
|
|
|
+ private ShowroomRepo showroomRepo;
|
|
|
+ private TradingAccountRepo tradingAccountRepo;
|
|
|
+ private AlipayClient alipayClient;
|
|
|
+ private SnowflakeIdWorker snowflakeIdWorker;
|
|
|
+ private FaceAuthRepo faceAuthRepo;
|
|
|
+ private AuctionPassRecordRepo auctionPassRecordRepo;
|
|
|
+ private AssetRepo assetRepo;
|
|
|
+ private ShowCollectionRepo showCollectionRepo;
|
|
|
+ private ShowroomService showroomService;
|
|
|
+ private NewsLikeRepo newsLikeRepo;
|
|
|
+ private RockRecordRepo rockRecordRepo;
|
|
|
+ private AirDropService airDropService;
|
|
|
|
|
|
|
|
|
public User update(User user) {
|
|
|
@@ -279,6 +280,7 @@ public class UserService {
|
|
|
if (StringUtils.isBlank(name)) {
|
|
|
name = "0x" + RandomStringUtils.randomAlphabetic(8);
|
|
|
}
|
|
|
+ Long airDropCollectionId = collectionId;
|
|
|
Invite invite = null;
|
|
|
if (StringUtils.isNotBlank(inviteCode)) {
|
|
|
invite = inviteRepo.findFirstByCode(inviteCode).orElse(null);
|
|
|
@@ -318,18 +320,18 @@ public class UserService {
|
|
|
}
|
|
|
}
|
|
|
User user = create(UserRegister.builder()
|
|
|
- .username(name)
|
|
|
- .nickname(name)
|
|
|
- .password(password)
|
|
|
- .avatar(Constants.DEFAULT_AVATAR)
|
|
|
- .phone(phone)
|
|
|
- .invitorPhone(Optional.ofNullable(invite).map(Invite::getPhone).orElse(null))
|
|
|
- .invitorName(Optional.ofNullable(invite).map(Invite::getName).orElse(null))
|
|
|
- .inviteCode(Optional.ofNullable(invite).map(Invite::getCode).orElse(null))
|
|
|
- .collectionInvitor(invitor)
|
|
|
- .collectionId(collectionId)
|
|
|
- .inviteType(inviteType)
|
|
|
- .build());
|
|
|
+ .username(name)
|
|
|
+ .nickname(name)
|
|
|
+ .password(password)
|
|
|
+ .avatar(Constants.DEFAULT_AVATAR)
|
|
|
+ .phone(phone)
|
|
|
+ .invitorPhone(Optional.ofNullable(invite).map(Invite::getPhone).orElse(null))
|
|
|
+ .invitorName(Optional.ofNullable(invite).map(Invite::getName).orElse(null))
|
|
|
+ .inviteCode(Optional.ofNullable(invite).map(Invite::getCode).orElse(null))
|
|
|
+ .collectionInvitor(invitor)
|
|
|
+ .collectionId(collectionId)
|
|
|
+ .inviteType(inviteType)
|
|
|
+ .build());
|
|
|
if (invite != null) {
|
|
|
inviteRepo.increaseNum(invite.getId());
|
|
|
}
|
|
|
@@ -338,13 +340,31 @@ public class UserService {
|
|
|
//通过展厅的注册数量
|
|
|
int weight = sysConfigService.getInt("heat_register_weight");
|
|
|
heatInfoRepo.save(HeatInfo.builder()
|
|
|
- .showroomId(showroomId)
|
|
|
- .userId(user.getId())
|
|
|
- .type(HeatType.REGISTER)
|
|
|
- .value(weight)
|
|
|
- .build());
|
|
|
+ .showroomId(showroomId)
|
|
|
+ .userId(user.getId())
|
|
|
+ .type(HeatType.REGISTER)
|
|
|
+ .value(weight)
|
|
|
+ .build());
|
|
|
showroomRepo.addHeatAndRegister(showroomId, weight, 1);
|
|
|
}
|
|
|
+ //如果collectionId是设定的且invitor为空
|
|
|
+ if (airDropCollectionId != null) {
|
|
|
+ long MMC_collection_id = sysConfigService.getInt("MMC_collection_id");
|
|
|
+ if (airDropCollectionId == MMC_collection_id) {
|
|
|
+ airDropService.create(AirDrop.builder()
|
|
|
+ .name("MMC注册空投奖励空投")
|
|
|
+ .remark(user.getId().toString())
|
|
|
+ .type(AirDropType.asset)
|
|
|
+ .userIds(Collections.singletonList(user.getId()))
|
|
|
+ .collectionId(airDropCollectionId)
|
|
|
+ .targets(Collections
|
|
|
+ .singletonList(new DropTarget(user.getId(), user
|
|
|
+ .getPhone(), user.getNickname(), 1)))
|
|
|
+ .auto(true)
|
|
|
+ .companyId(1L)
|
|
|
+ .build());
|
|
|
+ }
|
|
|
+ }
|
|
|
return user;
|
|
|
}
|
|
|
|
|
|
@@ -379,12 +399,12 @@ public class UserService {
|
|
|
if (user == null) {
|
|
|
String name = "0x" + RandomStringUtils.randomAlphabetic(8);
|
|
|
user = create(UserRegister.builder()
|
|
|
- .authorities(Collections.singleton(Authority.get(AuthorityName.ROLE_USER)))
|
|
|
- .username(name)
|
|
|
- .nickname(name)
|
|
|
- .avatar(Constants.DEFAULT_AVATAR)
|
|
|
- .phone(phone)
|
|
|
- .build());
|
|
|
+ .authorities(Collections.singleton(Authority.get(AuthorityName.ROLE_USER)))
|
|
|
+ .username(name)
|
|
|
+ .nickname(name)
|
|
|
+ .avatar(Constants.DEFAULT_AVATAR)
|
|
|
+ .phone(phone)
|
|
|
+ .build());
|
|
|
}
|
|
|
return user;
|
|
|
}
|
|
|
@@ -427,18 +447,18 @@ public class UserService {
|
|
|
if (user == null) {
|
|
|
String name = "0x" + RandomStringUtils.randomAlphabetic(8);
|
|
|
user = User.builder()
|
|
|
- .username(name)
|
|
|
- .nickname(name)
|
|
|
- .avatar(wxMpUser.getHeadImgUrl())
|
|
|
- .sex(wxMpUser.getSexDesc())
|
|
|
- .country(wxMpUser.getCountry())
|
|
|
- .province(wxMpUser.getProvince())
|
|
|
- .city(wxMpUser.getCity())
|
|
|
- .openId(wxMpUser.getOpenId())
|
|
|
- .language(wxMpUser.getLanguage())
|
|
|
- .authorities(Collections.singleton(Authority.get(AuthorityName.ROLE_USER)))
|
|
|
- .authStatus(AuthStatus.NOT_AUTH)
|
|
|
- .build();
|
|
|
+ .username(name)
|
|
|
+ .nickname(name)
|
|
|
+ .avatar(wxMpUser.getHeadImgUrl())
|
|
|
+ .sex(wxMpUser.getSexDesc())
|
|
|
+ .country(wxMpUser.getCountry())
|
|
|
+ .province(wxMpUser.getProvince())
|
|
|
+ .city(wxMpUser.getCity())
|
|
|
+ .openId(wxMpUser.getOpenId())
|
|
|
+ .language(wxMpUser.getLanguage())
|
|
|
+ .authorities(Collections.singleton(Authority.get(AuthorityName.ROLE_USER)))
|
|
|
+ .authStatus(AuthStatus.NOT_AUTH)
|
|
|
+ .build();
|
|
|
save(user);
|
|
|
}
|
|
|
return user;
|
|
|
@@ -461,13 +481,13 @@ public class UserService {
|
|
|
}
|
|
|
String name = "0x" + RandomStringUtils.randomAlphabetic(8);
|
|
|
userInfo = User.builder()
|
|
|
- .username(name)
|
|
|
- .nickname(name)
|
|
|
- .openId(openId)
|
|
|
- .avatar(Constants.DEFAULT_AVATAR)
|
|
|
- .authorities(Collections.singleton(Authority.get(AuthorityName.ROLE_USER)))
|
|
|
- .authStatus(AuthStatus.NOT_AUTH)
|
|
|
- .build();
|
|
|
+ .username(name)
|
|
|
+ .nickname(name)
|
|
|
+ .openId(openId)
|
|
|
+ .avatar(Constants.DEFAULT_AVATAR)
|
|
|
+ .authorities(Collections.singleton(Authority.get(AuthorityName.ROLE_USER)))
|
|
|
+ .authStatus(AuthStatus.NOT_AUTH)
|
|
|
+ .build();
|
|
|
userInfo = save(userInfo);
|
|
|
return userInfo;
|
|
|
} catch (WxErrorException e) {
|
|
|
@@ -501,16 +521,16 @@ public class UserService {
|
|
|
if (user == null) {
|
|
|
|
|
|
user = User.builder()
|
|
|
- .username(UUID.randomUUID().toString())
|
|
|
- .nickname(wxUserInfo.getNickName())
|
|
|
- .openId(wxUserInfo.getOpenId())
|
|
|
- .avatar(avatarUrl)
|
|
|
- .sex(wxUserInfo.getGender())
|
|
|
- .country(wxUserInfo.getCountry())
|
|
|
- .province(wxUserInfo.getProvince())
|
|
|
- .city(wxUserInfo.getCity())
|
|
|
- .authorities(Collections.singleton(Authority.builder().name("ROLE_USER").build()))
|
|
|
- .build();
|
|
|
+ .username(UUID.randomUUID().toString())
|
|
|
+ .nickname(wxUserInfo.getNickName())
|
|
|
+ .openId(wxUserInfo.getOpenId())
|
|
|
+ .avatar(avatarUrl)
|
|
|
+ .sex(wxUserInfo.getGender())
|
|
|
+ .country(wxUserInfo.getCountry())
|
|
|
+ .province(wxUserInfo.getProvince())
|
|
|
+ .city(wxUserInfo.getCity())
|
|
|
+ .authorities(Collections.singleton(Authority.builder().name("ROLE_USER").build()))
|
|
|
+ .build();
|
|
|
user = save(user);
|
|
|
|
|
|
} else {
|
|
|
@@ -657,8 +677,8 @@ public class UserService {
|
|
|
throw new BusinessException("用户不存在或未认证");
|
|
|
}
|
|
|
String realName = identityAuthRepo.findFirstByUserIdAndStatusAndDelFalseOrderByCreatedAtDesc(
|
|
|
- user.getId(), AuthStatus.SUCCESS)
|
|
|
- .map(IdentityAuth::getRealName).orElse("").replaceAll(".*(?=.)", "**");
|
|
|
+ user.getId(), AuthStatus.SUCCESS)
|
|
|
+ .map(IdentityAuth::getRealName).orElse("").replaceAll(".*(?=.)", "**");
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("id", user.getId());
|
|
|
map.put("avatar", user.getAvatar());
|
|
|
@@ -670,16 +690,16 @@ public class UserService {
|
|
|
|
|
|
public Map<String, Object> searchByPhoneAdmin(String phoneStr) {
|
|
|
List<String> phone = Arrays.stream(phoneStr.replaceAll("\n", " ")
|
|
|
- .replaceAll("\r\n", " ")
|
|
|
- .split(" "))
|
|
|
- .map(String::trim)
|
|
|
- .filter(s -> !StringUtils.isEmpty(s))
|
|
|
- .collect(Collectors.toList());
|
|
|
+ .replaceAll("\r\n", " ")
|
|
|
+ .split(" "))
|
|
|
+ .map(String::trim)
|
|
|
+ .filter(s -> !StringUtils.isEmpty(s))
|
|
|
+ .collect(Collectors.toList());
|
|
|
List<User> users = userRepo.findByPhoneInAndDelFalse(phone);
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("users", users);
|
|
|
List<String> notFound = phone.stream().filter(p -> users.stream().noneMatch(u -> p.equals(u.getPhone())))
|
|
|
- .collect(Collectors.toList());
|
|
|
+ .collect(Collectors.toList());
|
|
|
map.put("notFound", notFound);
|
|
|
return map;
|
|
|
}
|
|
|
@@ -715,16 +735,16 @@ public class UserService {
|
|
|
user.setSettleAccountId("1");
|
|
|
save(user);
|
|
|
userBankCardRepo.save(UserBankCard.builder()
|
|
|
- .bank(bankValidate.getBank())
|
|
|
- .bankName(bankValidate.getBankName())
|
|
|
- .bankNo(bankNo)
|
|
|
- .cardType(bankValidate.getCardType())
|
|
|
- .cardTypeDesc(bankValidate.getCardTypeDesc())
|
|
|
- .userId(userId)
|
|
|
- .phone(phone)
|
|
|
- .realName(identityAuth.getRealName())
|
|
|
- .idNo(identityAuth.getIdNo())
|
|
|
- .build());
|
|
|
+ .bank(bankValidate.getBank())
|
|
|
+ .bankName(bankValidate.getBankName())
|
|
|
+ .bankNo(bankNo)
|
|
|
+ .cardType(bankValidate.getCardType())
|
|
|
+ .cardTypeDesc(bankValidate.getCardTypeDesc())
|
|
|
+ .userId(userId)
|
|
|
+ .phone(phone)
|
|
|
+ .realName(identityAuth.getRealName())
|
|
|
+ .idNo(identityAuth.getIdNo())
|
|
|
+ .build());
|
|
|
|
|
|
userBalanceRepo.unlock(userId);
|
|
|
}
|
|
|
@@ -761,10 +781,10 @@ public class UserService {
|
|
|
List<String> err = new ArrayList<>();
|
|
|
List<String> success = new ArrayList<>();
|
|
|
Arrays.stream(phones.replaceAll(",", " ")
|
|
|
- .replaceAll(",", " ")
|
|
|
- .replaceAll("\n", " ")
|
|
|
- .replaceAll("\r\n", " ")
|
|
|
- .split(" ")).forEach(phone -> {
|
|
|
+ .replaceAll(",", " ")
|
|
|
+ .replaceAll("\n", " ")
|
|
|
+ .replaceAll("\r\n", " ")
|
|
|
+ .split(" ")).forEach(phone -> {
|
|
|
|
|
|
if (userRepo.findByPhoneAndDelFalse(phone).isPresent()) {
|
|
|
exist.add(phone);
|
|
|
@@ -775,13 +795,14 @@ public class UserService {
|
|
|
try {
|
|
|
String name = "0x" + RandomStringUtils.randomAlphabetic(8);
|
|
|
User user = create(UserRegister.builder()
|
|
|
- .authorities(Collections.singleton(Authority.get(AuthorityName.ROLE_USER)))
|
|
|
- .username(name)
|
|
|
- .nickname(name)
|
|
|
- .password(defaultPassword)
|
|
|
- .avatar(Constants.DEFAULT_AVATAR)
|
|
|
- .phone(phone)
|
|
|
- .build());
|
|
|
+ .authorities(Collections
|
|
|
+ .singleton(Authority.get(AuthorityName.ROLE_USER)))
|
|
|
+ .username(name)
|
|
|
+ .nickname(name)
|
|
|
+ .password(defaultPassword)
|
|
|
+ .avatar(Constants.DEFAULT_AVATAR)
|
|
|
+ .phone(phone)
|
|
|
+ .build());
|
|
|
success.add(phone);
|
|
|
} catch (Exception e) {
|
|
|
log.error("注册失败", e);
|
|
|
@@ -837,7 +858,7 @@ public class UserService {
|
|
|
.findFirstByUserIdAndStatusAndDelFalseOrderByCreatedAtDesc(user.getId(), AuthStatus.SUCCESS)
|
|
|
.orElseThrow(new BusinessException("用户未认证"));
|
|
|
UserBankCard userBankCard = userBankCardRepo.findByUserId(user.getId()).stream().findAny()
|
|
|
- .orElseThrow(new BusinessException("未绑卡"));
|
|
|
+ .orElseThrow(new BusinessException("未绑卡"));
|
|
|
adapayMerchantService.createMemberForAll(
|
|
|
user.getId().toString(), Optional.ofNullable(userBankCard.getPhone()).orElse(user.getPhone()),
|
|
|
identityAuth.getRealName(), identityAuth.getIdNo());
|
|
|
@@ -870,10 +891,10 @@ public class UserService {
|
|
|
List<Minter> minters = new ArrayList<>();
|
|
|
origins.forEach(user -> {
|
|
|
Minter minter = Minter.builder()
|
|
|
- .id(user.getId())
|
|
|
- .name(user.getNickname())
|
|
|
- .avatar(user.getAvatar())
|
|
|
- .build();
|
|
|
+ .id(user.getId())
|
|
|
+ .name(user.getNickname())
|
|
|
+ .avatar(user.getAvatar())
|
|
|
+ .build();
|
|
|
minters.add(minter);
|
|
|
});
|
|
|
return new PageImpl<>(minters, users.getPageable(), users.getTotalElements());
|
|
|
@@ -921,7 +942,7 @@ public class UserService {
|
|
|
redisTemplate.opsForValue().get(RedisKeys.INVITOR_LIST + collectionId);
|
|
|
List<InvitorDTO> dtos;
|
|
|
dtos = JSONObject.parseArray((String) redisTemplate.opsForValue()
|
|
|
- .get(RedisKeys.INVITOR_LIST + collectionId), InvitorDTO.class);
|
|
|
+ .get(RedisKeys.INVITOR_LIST + collectionId), InvitorDTO.class);
|
|
|
if (dtos == null) {
|
|
|
dtos = new ArrayList<>();
|
|
|
List<Object[]> objects = userRepo.customSearch(collectionId);
|
|
|
@@ -930,8 +951,8 @@ public class UserService {
|
|
|
dtos.add(invitorDTO);
|
|
|
}
|
|
|
redisTemplate.opsForValue()
|
|
|
- .set(RedisKeys.INVITOR_LIST + collectionId, JSONObject.toJSONString(dtos), Duration
|
|
|
- .ofSeconds(60 * 10));
|
|
|
+ .set(RedisKeys.INVITOR_LIST + collectionId, JSONObject.toJSONString(dtos), Duration
|
|
|
+ .ofSeconds(60 * 10));
|
|
|
}
|
|
|
return dtos;
|
|
|
}
|
|
|
@@ -943,8 +964,8 @@ public class UserService {
|
|
|
// }
|
|
|
List<InvitorDTO> invitorDTOS = findInviteOrderByCount(collectionId);
|
|
|
InvitorDTO dto = invitorDTOS.stream()
|
|
|
- .filter(invitorDTO -> invitorDTO.getUserId().equals(BigInteger.valueOf(userId)))
|
|
|
- .findFirst().orElse(null);
|
|
|
+ .filter(invitorDTO -> invitorDTO.getUserId().equals(BigInteger.valueOf(userId)))
|
|
|
+ .findFirst().orElse(null);
|
|
|
if (dto != null) {
|
|
|
result.setIndex(invitorDTOS.indexOf(dto) + 1);
|
|
|
result.setUserId(BigInteger.valueOf(userId));
|
|
|
@@ -1013,7 +1034,7 @@ public class UserService {
|
|
|
}
|
|
|
User user = userRepo.findByPhoneAndDelFalse(phone).orElseThrow(new BusinessException("账号或密码错误"));
|
|
|
TradingAccount tradingAccount = tradingAccountRepo.findById(user.getId())
|
|
|
- .orElseThrow(new BusinessException("账号或密码错误"));
|
|
|
+ .orElseThrow(new BusinessException("账号或密码错误"));
|
|
|
|
|
|
if (StringUtils.isEmpty(user.getPassword())) {
|
|
|
throw new BusinessException("账号或密码错误");
|
|
|
@@ -1036,7 +1057,7 @@ public class UserService {
|
|
|
public Object myTrading(Long id) {
|
|
|
User user = userRepo.findById(id).orElseThrow(new BusinessException("账号或密码错误"));
|
|
|
TradingAccount tradingAccount = tradingAccountRepo.findById(user.getId())
|
|
|
- .orElseThrow(new BusinessException("账号或密码错误"));
|
|
|
+ .orElseThrow(new BusinessException("账号或密码错误"));
|
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("user", user);
|
|
|
@@ -1066,12 +1087,12 @@ public class UserService {
|
|
|
if (response.isSuccess()) {
|
|
|
String certifyId = response.getCertifyId();
|
|
|
faceAuthRepo.save(FaceAuth.builder()
|
|
|
- .id(id)
|
|
|
- .userId(userId)
|
|
|
- .name(name)
|
|
|
- .idNo(no)
|
|
|
- .certifyId(certifyId)
|
|
|
- .build());
|
|
|
+ .id(id)
|
|
|
+ .userId(userId)
|
|
|
+ .name(name)
|
|
|
+ .idNo(no)
|
|
|
+ .certifyId(certifyId)
|
|
|
+ .build());
|
|
|
return certifyId;
|
|
|
}
|
|
|
throw new BusinessException(response.getMsg());
|
|
|
@@ -1098,12 +1119,12 @@ public class UserService {
|
|
|
if (user == null) {
|
|
|
String name = "0x" + RandomStringUtils.randomAlphabetic(8);
|
|
|
user = create(UserRegister.builder()
|
|
|
- .authorities(Collections.singleton(Authority.get(AuthorityName.ROLE_USER)))
|
|
|
- .username(name)
|
|
|
- .nickname(name)
|
|
|
- .avatar(Constants.DEFAULT_AVATAR)
|
|
|
- .phone(phone)
|
|
|
- .build());
|
|
|
+ .authorities(Collections.singleton(Authority.get(AuthorityName.ROLE_USER)))
|
|
|
+ .username(name)
|
|
|
+ .nickname(name)
|
|
|
+ .avatar(Constants.DEFAULT_AVATAR)
|
|
|
+ .phone(phone)
|
|
|
+ .build());
|
|
|
}
|
|
|
return user;
|
|
|
}
|
|
|
@@ -1138,11 +1159,11 @@ public class UserService {
|
|
|
User user = userRepo.findById(faceAuth.getUserId()).orElse(null);
|
|
|
if (user != null) {
|
|
|
IdentityAuth identityAuth = identityAuthRepo.save(IdentityAuth.builder()
|
|
|
- .userId(user.getId())
|
|
|
- .idNo(faceAuth.getIdNo())
|
|
|
- .realName(faceAuth.getName())
|
|
|
- .status(AuthStatus.SUCCESS)
|
|
|
- .build());
|
|
|
+ .userId(user.getId())
|
|
|
+ .idNo(faceAuth.getIdNo())
|
|
|
+ .realName(faceAuth.getName())
|
|
|
+ .status(AuthStatus.SUCCESS)
|
|
|
+ .build());
|
|
|
identityAuthRepo.deleteDuplicated(user.getId(), identityAuth.getId());
|
|
|
user.setAuthStatus(AuthStatus.SUCCESS);
|
|
|
user.setAuthId(identityAuth.getId());
|
|
|
@@ -1176,16 +1197,16 @@ public class UserService {
|
|
|
}
|
|
|
|
|
|
Showroom showroom = showroomRepo.findByOasisId(oasisLoginDTO.getOasisId())
|
|
|
- .orElseThrow(new BusinessException("无记录 "));
|
|
|
+ .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);
|
|
|
- }));
|
|
|
+ .ifPresent(collection1 -> {
|
|
|
+ orig.setStatus(showroomService.getStatus(collection1));
|
|
|
+ orig.setPrice(collection1.getPrice());
|
|
|
+ neo.add(orig);
|
|
|
+ }));
|
|
|
}
|
|
|
showroom.setCollections(neo);
|
|
|
User showRoomUser = SecurityUtils.getAuthenticatedUser();
|