修复 拉卡拉 分账接口bug

This commit is contained in:
Jack 2025-04-28 11:40:16 +08:00
parent ce558afe78
commit f335937d3e
7 changed files with 90 additions and 10 deletions

View File

@ -210,6 +210,9 @@ public class ShopMerchEntry implements Serializable {
@ApiModelProperty(value = "商家的代理商ID") @ApiModelProperty(value = "商家的代理商ID")
private Long distributor_id; private Long distributor_id;
@ApiModelProperty(value = "拉卡拉银联商户号(唯一)")
private String lkl_mer_cup_no;
@ApiModelProperty(value = "合同签署状态0-无任何签署1-一方签署2-双方已签署;") @ApiModelProperty(value = "合同签署状态0-无任何签署1-一方签署2-双方已签署;")
private Integer signed_status; private Integer signed_status;

View File

@ -6,7 +6,7 @@
* Vestibulum commodo. Ut rhoncus gravida arcu. * 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.common.service.impl.BaseControllerImpl;
import com.suisung.mall.shop.lakala.service.impl.LklTkServiceImpl; import com.suisung.mall.shop.lakala.service.impl.LklTkServiceImpl;
@ -21,7 +21,7 @@ import javax.annotation.Resource;
@Api(tags = "拉卡拉商户进件控制器") @Api(tags = "拉卡拉商户进件控制器")
@RestController @RestController
@RequestMapping("/admin/shop/lakala/tk") @RequestMapping("/admin/shop/lakala/tk")
public class LklTkController extends BaseControllerImpl { public class LklTkAdminController extends BaseControllerImpl {
@Resource @Resource
private LklTkServiceImpl lklTkService; private LklTkServiceImpl lklTkService;

View File

@ -6,7 +6,7 @@
* Vestibulum commodo. Ut rhoncus gravida arcu. * 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 cn.hutool.json.JSONObject;
import com.suisung.mall.common.api.CommonResult; import com.suisung.mall.common.api.CommonResult;

View File

@ -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);
}
}

View File

@ -20,6 +20,7 @@ import com.suisung.mall.common.utils.RestTemplateHttpUtil;
import com.suisung.mall.common.utils.StringUtils; import com.suisung.mall.common.utils.StringUtils;
import com.suisung.mall.common.utils.UploadUtil; import com.suisung.mall.common.utils.UploadUtil;
import com.suisung.mall.core.web.service.RedisService; 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 com.suisung.mall.shop.store.service.ShopMerchEntryService;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -31,6 +32,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.File; import java.io.File;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -201,20 +203,20 @@ public class LklTkServiceImpl {
} }
} }
// TODO 咨询清楚
JSONObject bizContent = new JSONObject(); JSONObject bizContent = new JSONObject();
bizContent.put("activityId", 687); bizContent.put("activityId", 687);
bizContent.put("termNum", "1"); bizContent.put("termNum", "1");
bizContent.put("mcc", "1"); bizContent.put("mcc", "12015"); // 超市的 code
bizContent.put("fees", new JSONArray() {{ bizContent.put("fees", new JSONArray() {{
put(new JSONObject() {{ put(new JSONObject() {{
put("feeCode", "WECHAT"); put("feeCode", "WECHAT");
put("feeValue", 0.38); put("feeValue", 0.20);
}}); }});
}}); }});
formData.put("bizContent", bizContent); formData.put("bizContent", bizContent);
// 附件文件
JSONArray attachments = new JSONArray(); JSONArray attachments = new JSONArray();
JSONObject ID_CARD_FRONT = updatePhoto(shopMerchEntry.getIndividual_id_images(), "ID_CARD_FRONT", true); JSONObject ID_CARD_FRONT = updatePhoto(shopMerchEntry.getIndividual_id_images(), "ID_CARD_FRONT", true);
if (ID_CARD_FRONT != null) { if (ID_CARD_FRONT != null) {
@ -255,7 +257,6 @@ public class LklTkServiceImpl {
if (BANK_CARD != null) { if (BANK_CARD != null) {
attachments.put(BANK_CARD); // 银行卡图片 attachments.put(BANK_CARD); // 银行卡图片
} }
formData.put("attchments", attachments); formData.put("attchments", attachments);
@ -277,10 +278,26 @@ public class LklTkServiceImpl {
// TODO 新增 lkl_ledger_member 数据 等待异步审核通知更改状态 // TODO 新增 lkl_ledger_member 数据 等待异步审核通知更改状态
String merchantNo = response.getBody().getStr("merchantNo"); //拉卡拉内部商户号 // String merchantNo = response.getBody().getStr("merchantNo"); //拉卡拉内部商户号
return Pair.of(true, "进件成功!"); 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);
}
/** /**
* 获取拉卡拉省市区编码 * 获取拉卡拉省市区编码
* *

View File

@ -127,6 +127,15 @@ public interface ShopMerchEntryService {
*/ */
Boolean updateMerchEntryStoreStatus(String loginMobile, Integer storeStatus); Boolean updateMerchEntryStoreStatus(String loginMobile, Integer storeStatus);
/**
* 更新商家入驻申请的拉卡拉商户号
*
* @param loginMobile
* @param lklMerCupNo
* @return
*/
Boolean updateMerchEntryLklMerCupNo(String loginMobile, String lklMerCupNo);
/** /**
* 更新商家入驻申请的店铺 ID * 更新商家入驻申请的店铺 ID
* *

View File

@ -678,7 +678,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
@Override @Override
public Boolean updateMerchEntryStoreStatus(String loginMobile, Integer storeStatus) { public Boolean updateMerchEntryStoreStatus(String loginMobile, Integer storeStatus) {
if (StrUtil.isBlank(loginMobile) && ObjectUtil.isEmpty(storeStatus)) { if (StrUtil.isBlank(loginMobile) && ObjectUtil.isEmpty(storeStatus)) {
return null; return false;
} }
UpdateWrapper<ShopMerchEntry> updateWrapper = new UpdateWrapper<>(); UpdateWrapper<ShopMerchEntry> updateWrapper = new UpdateWrapper<>();
@ -686,6 +686,17 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
return update(updateWrapper); return update(updateWrapper);
} }
@Override
public Boolean updateMerchEntryLklMerCupNo(String loginMobile, String lklMerCupNo) {
if (StrUtil.isBlank(loginMobile) && StrUtil.isBlank(lklMerCupNo)) {
return false;
}
UpdateWrapper<ShopMerchEntry> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("login_mobile", loginMobile).set("lkl_mer_cup_no", lklMerCupNo);
return update(updateWrapper);
}
/** /**
* 更新商家入驻申请的店铺 ID * 更新商家入驻申请的店铺 ID
* *