|
@@ -38,12 +38,17 @@ import org.springframework.web.bind.annotation.*;
|
38
|
38
|
|
39
|
39
|
import javax.annotation.Resource;
|
40
|
40
|
import javax.servlet.http.HttpServletRequest;
|
|
41
|
+import java.lang.reflect.Array;
|
41
|
42
|
import java.time.LocalDateTime;
|
42
|
43
|
import java.util.HashMap;
|
43
|
44
|
import java.util.List;
|
44
|
45
|
import java.util.Map;
|
45
|
46
|
import java.util.concurrent.ExecutorService;
|
46
|
47
|
import java.util.concurrent.Executors;
|
|
48
|
+import java.util.stream.Collector;
|
|
49
|
+import java.util.stream.Collectors;
|
|
50
|
+
|
|
51
|
+import static com.sun.jmx.snmp.ThreadContext.contains;
|
47
|
52
|
|
48
|
53
|
@RestController
|
49
|
54
|
@RequestMapping("/api/wx")
|
|
@@ -247,17 +252,12 @@ public class MiniAppController extends BaseController {
|
247
|
252
|
if (!StringUtils.isEmpty(from) && !StringUtils.isEmpty(recommender) && !StringUtils.isEmpty(targetId)) {
|
248
|
253
|
taSharePersonFromService.createBy(taPerson, from, recommender, targetId);
|
249
|
254
|
}
|
250
|
|
- QueryWrapper<TaUserVerify> taUserVerifyQueryWrapper = new QueryWrapper<>();
|
251
|
|
- taUserVerifyQueryWrapper.eq("person_id",taPerson.getPersonId());
|
252
|
|
- taUserVerifyQueryWrapper.eq("verify_status","1");
|
253
|
|
- List<TaUserVerify> taUserVerifies = taUserVerifyService.list(taUserVerifyQueryWrapper);
|
254
|
|
-
|
255
|
255
|
|
256
|
256
|
Map<String, Object> result = new HashMap<>();
|
257
|
257
|
result.put("person", taPerson);
|
258
|
258
|
result.put("sessionKey", session.getSessionKey());
|
259
|
259
|
result.put("token", token);
|
260
|
|
- result.put("verifyStatus", taUserVerifies.size() > 0);
|
|
260
|
+ result.put("verifyStatus", getVerifyStatus(taPerson));
|
261
|
261
|
if (null != sceneParams) {
|
262
|
262
|
result.put("scene", sceneParams);
|
263
|
263
|
}
|
|
@@ -395,20 +395,38 @@ public class MiniAppController extends BaseController {
|
395
|
395
|
Map<String, Object> extraInfo = taPersonService.getExtraInfo(person.getPersonId());
|
396
|
396
|
person.setPassword(null);
|
397
|
397
|
|
398
|
|
- QueryWrapper<TaUserVerify> taUserVerifyQueryWrapper = new QueryWrapper<>();
|
399
|
|
- taUserVerifyQueryWrapper.eq("person_id",person.getPersonId());
|
400
|
|
- taUserVerifyQueryWrapper.eq("verify_status","1");
|
401
|
|
- List<TaUserVerify> taUserVerifies = taUserVerifyService.list(taUserVerifyQueryWrapper);
|
|
398
|
+ // 获取用户认证状态
|
|
399
|
+ String verifyStatus = getVerifyStatus(person);
|
402
|
400
|
|
403
|
401
|
Map<String, Object> result = new HashMap<>();
|
404
|
402
|
result.put("person", person);
|
405
|
403
|
result.put("extraInfo", extraInfo);
|
406
|
404
|
result.put("miniApp", miniapp);
|
407
|
|
- result.put("verifyStatus", taUserVerifies.size() > 0);
|
|
405
|
+ result.put("verifyStatus", verifyStatus);
|
408
|
406
|
|
409
|
407
|
return ResponseBean.success(result);
|
410
|
408
|
}
|
411
|
409
|
|
|
410
|
+ private String getVerifyStatus(TaPerson person) {
|
|
411
|
+ QueryWrapper<TaUserVerify> taUserVerifyQueryWrapper = new QueryWrapper<>();
|
|
412
|
+ taUserVerifyQueryWrapper.eq("person_id",person.getPersonId());
|
|
413
|
+ List<TaUserVerify> taUserVerifies = taUserVerifyService.list(taUserVerifyQueryWrapper);
|
|
414
|
+ // 未认证
|
|
415
|
+ String verifyStatus = "not_certified";
|
|
416
|
+ List<String> verifyList = taUserVerifies.stream().map(TaUserVerify::getVerifyStatus).collect(Collectors.toList());
|
|
417
|
+ if (verifyList.contains("1")){
|
|
418
|
+ // 已认证
|
|
419
|
+ verifyStatus = "certified";
|
|
420
|
+ }else if (verifyList.contains("2")){
|
|
421
|
+ // 认证未通过
|
|
422
|
+ verifyStatus = "certification_failed";
|
|
423
|
+ }else if (verifyList.contains("0")){
|
|
424
|
+ // 认证中
|
|
425
|
+ verifyStatus = "certification_in_progress";
|
|
426
|
+ }
|
|
427
|
+ return verifyStatus;
|
|
428
|
+ }
|
|
429
|
+
|
412
|
430
|
/**
|
413
|
431
|
* 获取用户绑定手机号信息
|
414
|
432
|
*/
|