From b08e4b553bc1b1eec0d8ad8c52577c88cb590544 Mon Sep 17 00:00:00 2001 From: ljl Date: Mon, 13 Nov 2023 13:58:18 +0800 Subject: [PATCH] yh --- .../response/CheckDsAppAuthExpireResponseDTO.java | 3 +++ .../com/ms/biz/service/impl/ShopServiceImpl.java | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ms-api/src/main/java/com/ms/api/dto/dsapi/response/CheckDsAppAuthExpireResponseDTO.java b/ms-api/src/main/java/com/ms/api/dto/dsapi/response/CheckDsAppAuthExpireResponseDTO.java index e9c2531..6e38749 100644 --- a/ms-api/src/main/java/com/ms/api/dto/dsapi/response/CheckDsAppAuthExpireResponseDTO.java +++ b/ms-api/src/main/java/com/ms/api/dto/dsapi/response/CheckDsAppAuthExpireResponseDTO.java @@ -2,7 +2,10 @@ package com.ms.api.dto.dsapi.response; import lombok.Data; +import java.util.Map; + @Data public class CheckDsAppAuthExpireResponseDTO extends CommonResponseDTO { private String memberAuthUrl; + private Map userIdAndCheckRetMap; } \ No newline at end of file diff --git a/ms-biz/src/main/java/com/ms/biz/service/impl/ShopServiceImpl.java b/ms-biz/src/main/java/com/ms/biz/service/impl/ShopServiceImpl.java index eaafe2e..a8a0820 100644 --- a/ms-biz/src/main/java/com/ms/biz/service/impl/ShopServiceImpl.java +++ b/ms-biz/src/main/java/com/ms/biz/service/impl/ShopServiceImpl.java @@ -3,9 +3,12 @@ package com.ms.biz.service.impl; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Map; import cn.hutool.core.util.ObjectUtil; import com.doudian.open.core.AccessToken; +import com.ms.api.dto.dsapi.response.CheckDsAppAuthExpireResponseDTO; +import com.ms.api.dto.dsapi.response.CommonResponseDTO; import com.ms.api.dto.dsapi.response.GetPlatformAuthUrlResponseDTO; import com.ms.biz.dto.openspi.request.QuerySupplyPlatformAuthParam; import com.ms.biz.dto.openspi.response.QuerySupplyPlatformAuthData; @@ -111,8 +114,9 @@ public class ShopServiceImpl implements ShopService { } public void querySupplyPlatformAuth(QuerySupplyPlatformAuthParam param, QuerySupplyPlatformAuthData data) { - ShopBO shop = getShopInfo(param.getShopId()); - ShopTo1688DsMember shopTo1688DsMember = shopTo1688DsMemberMapper.getDetailByShopId(param.getShopId()); + Long shopId = param.getShopId(); + ShopBO shop = getShopInfo(shopId); + ShopTo1688DsMember shopTo1688DsMember = shopTo1688DsMemberMapper.getDetailByShopId(shopId); boolean authorized = false; if (shopTo1688DsMember != null && shopTo1688DsMember.getGmtExpire() != null) { Date gmtExpire = CommonTool.parseDate(shopTo1688DsMember.getGmtExpire()); @@ -120,6 +124,13 @@ public class ShopServiceImpl implements ShopService { authorized = true; } } + + CheckDsAppAuthExpireResponseDTO responseDTO = dsApiService.checkDsAppAuthExpire(shopId, "", ""); + CommonResponseDTO res = responseDTO.getUserIdAndCheckRetMap().get(shopId); + if (!res.isSuccess()) { + authorized = false; + } + GetPlatformAuthUrlResponseDTO response = dsApiService.getPlatformAuthUrl(shop); if (response.isSuccess()) { data.setAuthorized(authorized);