|
|
@@ -1,13 +1,17 @@
|
|
|
package shop.alien.store.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import io.swagger.annotations.*;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
import shop.alien.entity.result.R;
|
|
|
+import shop.alien.entity.store.LifeUser;
|
|
|
import shop.alien.entity.store.StoreAliPayLog;
|
|
|
+import shop.alien.entity.store.StoreInfo;
|
|
|
+import shop.alien.entity.store.StoreUser;
|
|
|
import shop.alien.store.service.AliService;
|
|
|
import shop.alien.store.service.LifeUserService;
|
|
|
import shop.alien.store.service.StoreInfoService;
|
|
|
@@ -22,6 +26,9 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Objects;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @author ssk
|
|
|
@@ -73,36 +80,36 @@ public class AliController {
|
|
|
@GetMapping("/getIdInfo")
|
|
|
public R getIdInfo(@RequestParam("name") String name, @RequestParam("idCard") String idCard, @RequestParam("appType") Integer appType) {
|
|
|
log.info("AliController.getIdInfo?name={}&idCard={}", name, idCard);
|
|
|
-// int size = 0;
|
|
|
-// if (appType == 0) {
|
|
|
-// //根据身份查询未注销的用户
|
|
|
-// size = lifeUserService
|
|
|
-// .list(new LambdaQueryWrapper<LifeUser>()
|
|
|
-// .eq(LifeUser::getIdCard, idCard)
|
|
|
-// .eq(LifeUser::getRealName, name)
|
|
|
-// .eq(LifeUser::getLogoutFlag, 0))
|
|
|
-// .size();
|
|
|
-// } else {
|
|
|
-// //根据身份查询已入住或审核中的商家
|
|
|
-// List<StoreUser> storeUserList = storeUserService
|
|
|
-// .list(new LambdaQueryWrapper<StoreUser>()
|
|
|
-// .eq(StoreUser::getIdCard, idCard)
|
|
|
-// .eq(StoreUser::getName, name));
|
|
|
-// List<Integer> storeIds = storeUserList.stream()
|
|
|
-// .map(StoreUser::getStoreId)
|
|
|
-// .filter(Objects::nonNull)
|
|
|
-// .collect(Collectors.toList());
|
|
|
-// if (!storeIds.isEmpty()) {
|
|
|
-// size = storeInfoService
|
|
|
-// .list(new LambdaQueryWrapper<StoreInfo>()
|
|
|
-// .in(StoreInfo::getId, storeIds)
|
|
|
-// .notIn(StoreInfo::getStoreApplicationStatus, 2))
|
|
|
-// .size();
|
|
|
-// }
|
|
|
-// }
|
|
|
-// if (size > 0) {
|
|
|
-// return R.fail("该身份证已实名认证过");
|
|
|
-// }
|
|
|
+ int size = 0;
|
|
|
+ if (appType == 0) {
|
|
|
+ //根据身份查询未注销的用户
|
|
|
+ size = lifeUserService
|
|
|
+ .list(new LambdaQueryWrapper<LifeUser>()
|
|
|
+ .eq(LifeUser::getIdCard, idCard)
|
|
|
+ .eq(LifeUser::getRealName, name)
|
|
|
+ .eq(LifeUser::getLogoutFlag, 0))
|
|
|
+ .size();
|
|
|
+ } else {
|
|
|
+ //根据身份查询已入住或审核中的商家
|
|
|
+ List<StoreUser> storeUserList = storeUserService
|
|
|
+ .list(new LambdaQueryWrapper<StoreUser>()
|
|
|
+ .eq(StoreUser::getIdCard, idCard)
|
|
|
+ .eq(StoreUser::getName, name));
|
|
|
+ List<Integer> storeIds = storeUserList.stream()
|
|
|
+ .map(StoreUser::getStoreId)
|
|
|
+ .filter(Objects::nonNull)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ if (!storeIds.isEmpty()) {
|
|
|
+ size = storeInfoService
|
|
|
+ .list(new LambdaQueryWrapper<StoreInfo>()
|
|
|
+ .in(StoreInfo::getId, storeIds)
|
|
|
+ .notIn(StoreInfo::getStoreApplicationStatus, 2))
|
|
|
+ .size();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (size > 0) {
|
|
|
+ return R.fail("该身份证已实名认证过");
|
|
|
+ }
|
|
|
if (aliPayConfig.getIdInfo(name, idCard)) {
|
|
|
return R.success("身份验证成功");
|
|
|
}
|