|
@@ -3,6 +3,7 @@ package com.izouma.nineth.service;
|
|
|
import cn.binarywang.wx.miniapp.api.WxMaService;
|
|
import cn.binarywang.wx.miniapp.api.WxMaService;
|
|
|
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
|
|
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
|
|
|
import cn.binarywang.wx.miniapp.bean.WxMaUserInfo;
|
|
import cn.binarywang.wx.miniapp.bean.WxMaUserInfo;
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.fasterxml.jackson.core.sym.NameN;
|
|
import com.fasterxml.jackson.core.sym.NameN;
|
|
|
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
|
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
|
@@ -50,6 +51,7 @@ import org.springframework.data.domain.Sort;
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
|
|
import org.springframework.security.crypto.password.PasswordEncoder;
|
|
import org.springframework.security.crypto.password.PasswordEncoder;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -62,6 +64,8 @@ import java.math.BigDecimal;
|
|
|
import java.math.BigInteger;
|
|
import java.math.BigInteger;
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.time.Duration;
|
|
import java.time.Duration;
|
|
|
|
|
+import java.time.LocalDate;
|
|
|
|
|
+import java.time.LocalTime;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
import java.util.regex.Pattern;
|
|
import java.util.regex.Pattern;
|
|
@@ -94,6 +98,7 @@ public class UserService {
|
|
|
private WeakPassRepo weakPassRepo;
|
|
private WeakPassRepo weakPassRepo;
|
|
|
private UserBalanceRepo userBalanceRepo;
|
|
private UserBalanceRepo userBalanceRepo;
|
|
|
private ContentAuditService contentAuditService;
|
|
private ContentAuditService contentAuditService;
|
|
|
|
|
+ private AuctionPassRecordRepo auctionPassRecordRepo;
|
|
|
|
|
|
|
|
public User update(User user) {
|
|
public User update(User user) {
|
|
|
if (!SecurityUtils.hasRole(AuthorityName.ROLE_ADMIN)) {
|
|
if (!SecurityUtils.hasRole(AuthorityName.ROLE_ADMIN)) {
|
|
@@ -577,7 +582,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());
|
|
@@ -590,8 +595,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());
|
|
@@ -881,4 +886,17 @@ public class UserService {
|
|
|
result.setCount(BigInteger.valueOf(invitedUserDTOS.size()));
|
|
result.setCount(BigInteger.valueOf(invitedUserDTOS.size()));
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 流拍5次直接删号处罚
|
|
|
|
|
+ */
|
|
|
|
|
+ @Scheduled(cron = "0 0/10 * * * ?")
|
|
|
|
|
+ public void delUser() {
|
|
|
|
|
+ List<Long> userIds = auctionPassRecordRepo.checkUserId();
|
|
|
|
|
+ if (CollUtil.isNotEmpty(userIds)) {
|
|
|
|
|
+ log.info("流拍处罚:{}", userIds);
|
|
|
|
|
+ userRepo.softDeleteIn(userIds);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|