From f335937d3e672ac89de424f562be18ffe432cd0b Mon Sep 17 00:00:00 2001 From: Jack <46790855@qq.com> Date: Mon, 28 Apr 2025 11:40:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E6=8B=89=E5=8D=A1?= =?UTF-8?q?=E6=8B=89=20=E5=88=86=E8=B4=A6=E6=8E=A5=E5=8F=A3bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/modules/merch/ShopMerchEntry.java | 3 ++ .../LklTkAdminController.java} | 4 +- .../{ => mobile}/LakalaController.java | 2 +- .../controller/mobile/LklTkController.java | 40 +++++++++++++++++++ .../lakala/service/impl/LklTkServiceImpl.java | 29 +++++++++++--- .../store/service/ShopMerchEntryService.java | 9 +++++ .../impl/ShopMerchEntryServiceImpl.java | 13 +++++- 7 files changed, 90 insertions(+), 10 deletions(-) rename mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/{LklTkController.java => admin/LklTkAdminController.java} (92%) rename mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/{ => mobile}/LakalaController.java (98%) create mode 100644 mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/mobile/LklTkController.java diff --git a/mall-common/src/main/java/com/suisung/mall/common/modules/merch/ShopMerchEntry.java b/mall-common/src/main/java/com/suisung/mall/common/modules/merch/ShopMerchEntry.java index 15376d3d..3737c076 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/modules/merch/ShopMerchEntry.java +++ b/mall-common/src/main/java/com/suisung/mall/common/modules/merch/ShopMerchEntry.java @@ -210,6 +210,9 @@ public class ShopMerchEntry implements Serializable { @ApiModelProperty(value = "商家的代理商ID") private Long distributor_id; + @ApiModelProperty(value = "拉卡拉银联商户号(唯一)") + private String lkl_mer_cup_no; + @ApiModelProperty(value = "合同签署状态:0-无任何签署;1-一方签署;2-双方已签署;") private Integer signed_status; diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/LklTkController.java b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/admin/LklTkAdminController.java similarity index 92% rename from mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/LklTkController.java rename to mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/admin/LklTkAdminController.java index dcda37f2..44bfb7cb 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/LklTkController.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/admin/LklTkAdminController.java @@ -6,7 +6,7 @@ * Vestibulum commodo. Ut rhoncus gravida arcu. */ -package com.suisung.mall.shop.lakala.controller; +package com.suisung.mall.shop.lakala.controller.admin; import com.suisung.mall.common.service.impl.BaseControllerImpl; import com.suisung.mall.shop.lakala.service.impl.LklTkServiceImpl; @@ -21,7 +21,7 @@ import javax.annotation.Resource; @Api(tags = "拉卡拉商户进件控制器") @RestController @RequestMapping("/admin/shop/lakala/tk") -public class LklTkController extends BaseControllerImpl { +public class LklTkAdminController extends BaseControllerImpl { @Resource private LklTkServiceImpl lklTkService; diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/LakalaController.java b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/mobile/LakalaController.java similarity index 98% rename from mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/LakalaController.java rename to mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/mobile/LakalaController.java index 3eb2a2b7..e1719698 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/LakalaController.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/mobile/LakalaController.java @@ -6,7 +6,7 @@ * Vestibulum commodo. Ut rhoncus gravida arcu. */ -package com.suisung.mall.shop.lakala.controller; +package com.suisung.mall.shop.lakala.controller.mobile; import cn.hutool.json.JSONObject; import com.suisung.mall.common.api.CommonResult; diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/mobile/LklTkController.java b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/mobile/LklTkController.java new file mode 100644 index 00000000..0179718f --- /dev/null +++ b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/mobile/LklTkController.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2025. Lorem ipsum dolor sit amet, consectetur adipiscing elit. + * Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan. + * Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna. + * Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus. + * Vestibulum commodo. Ut rhoncus gravida arcu. + */ + +package com.suisung.mall.shop.lakala.controller.mobile; + +import cn.hutool.json.JSONObject; +import com.suisung.mall.common.service.impl.BaseControllerImpl; +import com.suisung.mall.shop.lakala.service.impl.LklTkServiceImpl; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; + +@Api(tags = "拉卡拉商户进件控制器") +@RestController +@RequestMapping("/mobile/shop/lakala/tk") +public class LklTkController extends BaseControllerImpl { + + @Resource + private LklTkServiceImpl lklTkService; + + + // https://mall.gpxscs.cn/api/mobile/shop/lakala/ledger/applyLedgerMerReceiverBindNotify + @ApiOperation(value = "拉卡拉进件申请异步回调通知", notes = "拉卡拉进件申请异步回调通知") + @RequestMapping(value = "/registrationMerchantNotify", method = {RequestMethod.POST, RequestMethod.GET}) + public JSONObject registrationMerchantNotify(HttpServletRequest request) { + return lklTkService.registrationMerchantNotify(request); + } + + +} diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklTkServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklTkServiceImpl.java index 781fc7b9..c733ef64 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklTkServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklTkServiceImpl.java @@ -20,6 +20,7 @@ import com.suisung.mall.common.utils.RestTemplateHttpUtil; import com.suisung.mall.common.utils.StringUtils; import com.suisung.mall.common.utils.UploadUtil; import com.suisung.mall.core.web.service.RedisService; +import com.suisung.mall.shop.lakala.utils.LakalaUtil; import com.suisung.mall.shop.store.service.ShopMerchEntryService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -31,6 +32,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import java.io.File; import java.util.HashMap; import java.util.Map; @@ -201,20 +203,20 @@ public class LklTkServiceImpl { } } - + // TODO 咨询清楚 JSONObject bizContent = new JSONObject(); bizContent.put("activityId", 687); bizContent.put("termNum", "1"); - bizContent.put("mcc", "1"); + bizContent.put("mcc", "12015"); // 超市的 code bizContent.put("fees", new JSONArray() {{ put(new JSONObject() {{ put("feeCode", "WECHAT"); - put("feeValue", 0.38); + put("feeValue", 0.20); }}); }}); - formData.put("bizContent", bizContent); + // 附件文件 JSONArray attachments = new JSONArray(); JSONObject ID_CARD_FRONT = updatePhoto(shopMerchEntry.getIndividual_id_images(), "ID_CARD_FRONT", true); if (ID_CARD_FRONT != null) { @@ -255,7 +257,6 @@ public class LklTkServiceImpl { if (BANK_CARD != null) { attachments.put(BANK_CARD); // 银行卡图片 } - formData.put("attchments", attachments); @@ -277,10 +278,26 @@ public class LklTkServiceImpl { // TODO 新增 lkl_ledger_member 数据, 等待异步审核通知,更改状态 - String merchantNo = response.getBody().getStr("merchantNo"); //拉卡拉内部商户号 + // String merchantNo = response.getBody().getStr("merchantNo"); //拉卡拉内部商户号 return Pair.of(true, "进件成功!"); } + /** + * 拉卡拉进件异步通知 + * + * @param request + * @return + */ + public JSONObject registrationMerchantNotify(HttpServletRequest request) { + log.debug("拉卡拉进件异步通知开始"); + // 验签 + String authorization = request.getHeader("Authorization"); + String requestBody = LakalaUtil.getBody(request); + log.debug("分账绑定关系申请业务回调返回参数:{}", requestBody); + + return new JSONObject().put("body", requestBody); + } + /** * 获取拉卡拉省市区编码 * diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopMerchEntryService.java b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopMerchEntryService.java index 8b90279a..0f81f231 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopMerchEntryService.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopMerchEntryService.java @@ -127,6 +127,15 @@ public interface ShopMerchEntryService { */ Boolean updateMerchEntryStoreStatus(String loginMobile, Integer storeStatus); + /** + * 更新商家入驻申请的拉卡拉商户号 + * + * @param loginMobile + * @param lklMerCupNo + * @return + */ + Boolean updateMerchEntryLklMerCupNo(String loginMobile, String lklMerCupNo); + /** * 更新商家入驻申请的店铺 ID * diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopMerchEntryServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopMerchEntryServiceImpl.java index 880bc269..4801005b 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopMerchEntryServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopMerchEntryServiceImpl.java @@ -678,7 +678,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl updateWrapper = new UpdateWrapper<>(); @@ -686,6 +686,17 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl updateWrapper = new UpdateWrapper<>(); + updateWrapper.eq("login_mobile", loginMobile).set("lkl_mer_cup_no", lklMerCupNo); + return update(updateWrapper); + } + /** * 更新商家入驻申请的店铺 ID *