|
@@ -10,10 +10,11 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
import shop.alien.entity.result.R;
|
|
import shop.alien.entity.result.R;
|
|
|
import shop.alien.entity.store.LifeUser;
|
|
import shop.alien.entity.store.LifeUser;
|
|
|
import shop.alien.entity.store.StoreAliPayLog;
|
|
import shop.alien.entity.store.StoreAliPayLog;
|
|
|
|
|
+import shop.alien.entity.store.StoreInfo;
|
|
|
import shop.alien.entity.store.StoreUser;
|
|
import shop.alien.entity.store.StoreUser;
|
|
|
-import shop.alien.store.config.BaseRedisService;
|
|
|
|
|
import shop.alien.store.service.AliService;
|
|
import shop.alien.store.service.AliService;
|
|
|
import shop.alien.store.service.LifeUserService;
|
|
import shop.alien.store.service.LifeUserService;
|
|
|
|
|
+import shop.alien.store.service.StoreInfoService;
|
|
|
import shop.alien.store.service.StoreUserService;
|
|
import shop.alien.store.service.StoreUserService;
|
|
|
import shop.alien.store.util.ali.AliApi;
|
|
import shop.alien.store.util.ali.AliApi;
|
|
|
import shop.alien.store.util.ali.AliSms;
|
|
import shop.alien.store.util.ali.AliSms;
|
|
@@ -26,6 +27,8 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.Objects;
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @author ssk
|
|
* @author ssk
|
|
@@ -57,6 +60,8 @@ public class AliController {
|
|
|
|
|
|
|
|
private final LifeUserService lifeUserService;
|
|
private final LifeUserService lifeUserService;
|
|
|
|
|
|
|
|
|
|
+ private final StoreInfoService storeInfoService;
|
|
|
|
|
+
|
|
|
@ApiOperation("阿里回调")
|
|
@ApiOperation("阿里回调")
|
|
|
@ApiOperationSupport(order = 1)
|
|
@ApiOperationSupport(order = 1)
|
|
|
@GetMapping("/notify")
|
|
@GetMapping("/notify")
|
|
@@ -75,11 +80,32 @@ public class AliController {
|
|
|
@GetMapping("/getIdInfo")
|
|
@GetMapping("/getIdInfo")
|
|
|
public R getIdInfo(@RequestParam("name") String name, @RequestParam("idCard") String idCard, @RequestParam("appType") Integer appType) {
|
|
public R getIdInfo(@RequestParam("name") String name, @RequestParam("idCard") String idCard, @RequestParam("appType") Integer appType) {
|
|
|
log.info("AliController.getIdInfo?name={}&idCard={}", name, idCard);
|
|
log.info("AliController.getIdInfo?name={}&idCard={}", name, idCard);
|
|
|
- int size;
|
|
|
|
|
|
|
+ int size = 0;
|
|
|
if (appType == 0) {
|
|
if (appType == 0) {
|
|
|
- size = lifeUserService.list(new LambdaQueryWrapper<LifeUser>().eq(LifeUser::getIdCard, idCard).eq(LifeUser::getRealName, name)).size();
|
|
|
|
|
|
|
+ //根据身份查询未注销的用户
|
|
|
|
|
+ size = lifeUserService
|
|
|
|
|
+ .list(new LambdaQueryWrapper<LifeUser>()
|
|
|
|
|
+ .eq(LifeUser::getIdCard, idCard)
|
|
|
|
|
+ .eq(LifeUser::getRealName, name)
|
|
|
|
|
+ .eq(LifeUser::getLogoutFlag, 0))
|
|
|
|
|
+ .size();
|
|
|
} else {
|
|
} else {
|
|
|
- size = storeUserService.list(new LambdaQueryWrapper<StoreUser>().eq(StoreUser::getIdCard, idCard).eq(StoreUser::getName, name)).size();
|
|
|
|
|
|
|
+ //根据身份查询已入住或审核中的商家
|
|
|
|
|
+ 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) {
|
|
if (size > 0) {
|
|
|
return R.fail("该身份证已实名认证过");
|
|
return R.fail("该身份证已实名认证过");
|