From 949b822f3398a60928f002b8bd49be224f6691b0 Mon Sep 17 00:00:00 2001 From: ljl Date: Fri, 17 Nov 2023 17:31:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ms/biz/service/impl/ShopServiceImpl.java | 13 +++++++++++-- .../src/main/java/com/ms/web/controller/Test.java | 7 ++++++- 2 files changed, 17 insertions(+), 3 deletions(-) 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 037768b..ad79b7e 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 @@ -16,6 +16,7 @@ import com.ms.biz.service.DsApiService; import com.ms.biz.service.ShopService; import com.ms.biz.bo.ShopBO; import com.ms.biz.tool.CommonTool; +import com.ms.biz.tool.SecurityTool; import com.ms.dal.entity.Shop; import com.ms.dal.entity.ShopTo1688DsMember; import com.ms.dal.mapper.ShopMapper; @@ -114,13 +115,21 @@ public class ShopServiceImpl implements ShopService { } public void querySupplyPlatformAuth(QuerySupplyPlatformAuthParam param, QuerySupplyPlatformAuthData data) { + Long shopId = param.getShopId(); + if (shopId == null || shopId == 0) { + throw new RuntimeException("店铺ID错误"); + } if (param.getScene() == 1) { data.setAuthorized(true); data.setAuthUrl(""); return; } - Long shopId = param.getShopId(); - ShopBO shop = getShopInfo(shopId); + ShopBO shop = new ShopBO(); + String shopName = SecurityTool.MD5(shopId.toString()); + assert shopName != null; + shopName = shopName.substring(16); + shop.setShopName("店铺-" + shopName); + shop.setShopId(shopId); ShopTo1688DsMember shopTo1688DsMember = shopTo1688DsMemberMapper.getDetailByShopId(shopId); boolean authorized = false; if (shopTo1688DsMember != null && shopTo1688DsMember.getGmtExpire() != null) { diff --git a/ms-web/src/main/java/com/ms/web/controller/Test.java b/ms-web/src/main/java/com/ms/web/controller/Test.java index bee7f4b..c4a1f3f 100644 --- a/ms-web/src/main/java/com/ms/web/controller/Test.java +++ b/ms-web/src/main/java/com/ms/web/controller/Test.java @@ -21,6 +21,7 @@ import com.ms.biz.dto.openspi.response.BatchPayData; import com.ms.biz.dto.openspi.response.QuerySupplyPlatformAuthData; import com.ms.biz.service.*; import com.ms.biz.tool.CommonTool; +import com.ms.biz.tool.SecurityTool; import com.ms.biz.util.DDApi; import com.ms.dal.entity.DsMessageConsumerQueue; import lombok.Data; @@ -111,6 +112,11 @@ public class Test { } public static void main(String[] args) throws ParseException { + Long shopId = 111111111L; + String shopName = SecurityTool.MD5(shopId.toString()); + assert shopName != null; + shopName = shopName.substring(16); + System.out.println("店铺[" + shopName + "]"); Long value = 1L; Date date = new Date(); @@ -120,7 +126,6 @@ public class Test { String d = "{\"orders\":[{\"pur_order_id\":\"7299756498531418412\",\"order_id\":\"6917543139367389081\",\"post_address\":{\"province\":{\"id\":\"11\",\"name\":\"北京市\"},\"city\":{\"id\":\"110000\",\"name\":\"北京市\"},\"town\":{\"id\":\"110108\",\"name\":\"海淀区\"},\"street\":{\"id\":\"110108012\",\"name\":\"海淀街道\"},\"encrypt_detail\":\"MC8EEAjx7GdmeypB6WkV9DrpH9sEGWv8lSI1N1i9SaxcxKw1aW4waq481ueqVRcEAA==\",\"post_tel\":\"MCEEEDyPE4U3H7NDrnVhSgGOPzsEC9mVHEzJYMyY91uJBAA=\",\"post_receiver\":\"MCgEEHlttu0OuRqxJ3AaFAEvpr8EEjMU+9kRHPkU+MiXyD4zIkdVMgQA\"},\"mask_post_address\":{\"province\":{\"id\":\"11\",\"name\":\"北京市\"},\"city\":{\"id\":\"110000\",\"name\":\"北京市\"},\"town\":{\"id\":\"110108\",\"name\":\"海淀区\"},\"street\":{\"id\":\"110108012\",\"name\":\"海淀街道\"},\"detail\":\"互联*******\",\"post_tel\":\"1********00\",\"post_receiver\":\"电*****\"},\"sku_orders\":[{\"pur_sku_order_id\":\"7299756498531451180\",\"sku_order_id\":\"6917543139367389081\",\"cargo_id\":3649687424122130945,\"cargo_sku_id\":3659175936152832,\"product_id\":3649883085652281308,\"sku_id\":3659175955997568,\"num\":1,\"outer_product_id\":\"686872273204\",\"outer_sku_id\":\"4897420288982\"}]}],\"shop_id\":1111502210}"; System.out.println(JSON.parseObject(d)); - QuerySupplyPlatformAuthData data = new QuerySupplyPlatformAuthData(); data.setAuthUrl("abc"); data.setAuthorized(false);