进件关联

This commit is contained in:
2026-01-16 17:42:02 +08:00
parent 1f6593c957
commit 592cc99db4
6 changed files with 21 additions and 33 deletions

View File

@@ -3,7 +3,6 @@ package com.czg.controller.admin;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.czg.EntryManager; import com.czg.EntryManager;
import com.czg.annotation.Debounce; import com.czg.annotation.Debounce;
import com.czg.config.RabbitPublisher;
import com.czg.dto.req.AggregateMerchantDto; import com.czg.dto.req.AggregateMerchantDto;
import com.czg.dto.resp.WechatBankBranchRespDto; import com.czg.dto.resp.WechatBankBranchRespDto;
import com.czg.order.entity.ShopDirectMerchant; import com.czg.order.entity.ShopDirectMerchant;
@@ -33,9 +32,6 @@ public class EntryManagerController {
@Resource @Resource
private EntryManagerTask entryManagerTask; private EntryManagerTask entryManagerTask;
@Resource
private RabbitPublisher rabbitPublisher;
/** /**
* ocr识别填充 * ocr识别填充
* 阿里 ocr识别图片 * 阿里 ocr识别图片
@@ -68,12 +64,6 @@ public class EntryManagerController {
return CzgResult.success(EntryManager.queryBankBranchList(bankAliceCode, cityCode)); return CzgResult.success(EntryManager.queryBankBranchList(bankAliceCode, cityCode));
} }
@GetMapping("test")
public CzgResult<Void> test(String shopId, String licenceNo) {
rabbitPublisher.sendEntryManagerMsg(shopId + ":" + licenceNo);
return CzgResult.success();
}
/** /**
* 获取进件列表 * 获取进件列表
*/ */

View File

@@ -5,9 +5,7 @@ import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.czg.EntryManager; import com.czg.EntryManager;
import com.czg.PayCst; import com.czg.PayCst;
import com.czg.constant.PayChannelCst;
import com.czg.dto.resp.QueryStatusResp; import com.czg.dto.resp.QueryStatusResp;
import com.czg.order.dto.ShopMerchantDTO;
import com.czg.order.entity.ShopDirectMerchant; import com.czg.order.entity.ShopDirectMerchant;
import com.czg.order.service.ShopMerchantService; import com.czg.order.service.ShopMerchantService;
import com.czg.pay.AlipayAuthInfoDto; import com.czg.pay.AlipayAuthInfoDto;
@@ -79,10 +77,10 @@ public class EntryManagerTask {
} }
shopDirectMerchantService.updateById(shopDirectMerchant); shopDirectMerchantService.updateById(shopDirectMerchant);
if (StrUtil.isNotBlank(wechatMerchantId) || StrUtil.isNotBlank(alipayMerchantId)) { if (StrUtil.isNotBlank(wechatMerchantId) || StrUtil.isNotBlank(alipayMerchantId)) {
ShopMerchantDTO shopMerchantDTO = new ShopMerchantDTO(); // ShopMerchantDTO shopMerchantDTO = new ShopMerchantDTO();
shopMerchantDTO.setShopId(shopId); // shopMerchantDTO.setShopId(shopId);
shopMerchantDTO.setChannel(PayChannelCst.NATIVE); // shopMerchantDTO.setChannel(PayChannelCst.NATIVE);
shopMerchantDTO.setRelatedLicenceNo(shopDirectMerchant.getLicenceNo()); // shopMerchantDTO.setRelatedId(shopDirectMerchant.getShopId());
NativeMerchantDTO nativeMerchantDTO = new NativeMerchantDTO(); NativeMerchantDTO nativeMerchantDTO = new NativeMerchantDTO();
nativeMerchantDTO.setWechatMerchantId(wechatMerchantId); nativeMerchantDTO.setWechatMerchantId(wechatMerchantId);
nativeMerchantDTO.setAlipayMerchantId(alipayMerchantId); nativeMerchantDTO.setAlipayMerchantId(alipayMerchantId);
@@ -90,9 +88,9 @@ public class EntryManagerTask {
AlipayAuthInfoDto alipayAuthInfoDto = JSONObject.parseObject(shopDirectMerchant.getAlipayAuthInfo(), AlipayAuthInfoDto.class); AlipayAuthInfoDto alipayAuthInfoDto = JSONObject.parseObject(shopDirectMerchant.getAlipayAuthInfo(), AlipayAuthInfoDto.class);
nativeMerchantDTO.setAlipayAuthInfo(alipayAuthInfoDto); nativeMerchantDTO.setAlipayAuthInfo(alipayAuthInfoDto);
} }
shopMerchantDTO.setNativeMerchantDTO(nativeMerchantDTO); // shopMerchantDTO.setNativeMerchantDTO(nativeMerchantDTO);
shopMerchantService.editEntry(shopMerchantDTO, false); // shopMerchantService.editEntry(shopMerchantDTO, false);
shopMerchantService.upMerchant(shopDirectMerchant.getLicenceNo(), nativeMerchantDTO); shopMerchantService.upMerchant(shopDirectMerchant.getShopId(), nativeMerchantDTO);
} }
} }
} }

View File

@@ -23,7 +23,7 @@ public class ShopMerchantDTO {
* 聚合支付商户 * 聚合支付商户
* native 必填 对应 tb_shop_direct_merchant 的 licence_no 营业执照 * native 必填 对应 tb_shop_direct_merchant 的 licence_no 营业执照
*/ */
private String relatedLicenceNo; private Long relatedId;
/** /**
* 原生支付参数 * 原生支付参数
*/ */

View File

@@ -3,7 +3,6 @@ package com.czg.order.entity;
import com.mybatisflex.annotation.Column; import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id; import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table; import com.mybatisflex.annotation.Table;
import jakarta.validation.constraints.NotEmpty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@@ -42,9 +41,9 @@ public class ShopMerchant implements Serializable {
/** /**
* 聚合支付商户 * 聚合支付商户
* native 必填 对应 tb_shop_direct_merchant 的 licence_no 营业执照 * native 必填 对应 tb_shop_direct_merchant 的 shopId
*/ */
private String relatedLicenceNo; private Long relatedId;
/** /**
* 微信appid * 微信appid

View File

@@ -28,7 +28,7 @@ public interface ShopMerchantService extends IService<ShopMerchant> {
* 已绑定的支付 * 已绑定的支付
* 更新商户支付参数 * 更新商户支付参数
*/ */
void upMerchant(@NotBlank String relatedLicenceNo, @NotNull NativeMerchantDTO nativeMerchantDTO); void upMerchant(@NotBlank Long relatedId, @NotNull NativeMerchantDTO nativeMerchantDTO);
ShopMerchant getByShopId(Long shopId); ShopMerchant getByShopId(Long shopId);

View File

@@ -48,15 +48,15 @@ public class ShopMerchantServiceImpl extends ServiceImpl<ShopMerchantMapper, Sho
} }
shopMerchantVO.setShopId(shopId); shopMerchantVO.setShopId(shopId);
shopMerchantVO.setChannel(one.getChannel()); shopMerchantVO.setChannel(one.getChannel());
shopMerchantVO.setRelatedLicenceNo(one.getRelatedLicenceNo()); shopMerchantVO.setRelatedId(one.getRelatedId());
if (StrUtil.isNotBlank(one.getNativePayJson())) { if (StrUtil.isNotBlank(one.getNativePayJson())) {
shopMerchantVO.setNativeMerchantDTO(JSONObject.parseObject(one.getNativePayJson(), NativeMerchantDTO.class)); shopMerchantVO.setNativeMerchantDTO(JSONObject.parseObject(one.getNativePayJson(), NativeMerchantDTO.class));
} }
if (StrUtil.isNotBlank(one.getPolyPayJson())) { if (StrUtil.isNotBlank(one.getPolyPayJson())) {
shopMerchantVO.setPolyMerchantDTO(JSONObject.parseObject(one.getPolyPayJson(), PolyMerchantDTO.class)); shopMerchantVO.setPolyMerchantDTO(JSONObject.parseObject(one.getPolyPayJson(), PolyMerchantDTO.class));
} }
if (StrUtil.isNotBlank(one.getRelatedLicenceNo())) { if (one.getRelatedId() != null) {
shopMerchantVO.setShopDirectMerchant(shopDirectMerchantService.getOne(query().eq(ShopDirectMerchant::getLicenceNo, one.getRelatedLicenceNo()))); shopMerchantVO.setShopDirectMerchant(shopDirectMerchantService.getOne(query().eq(ShopDirectMerchant::getShopId, one.getRelatedId())));
} }
return shopMerchantVO; return shopMerchantVO;
} }
@@ -76,11 +76,12 @@ public class ShopMerchantServiceImpl extends ServiceImpl<ShopMerchantMapper, Sho
shopMerchant = new ShopMerchant(); shopMerchant = new ShopMerchant();
shopMerchant.setAlipayAppId(SystemConstants.PayType.ALIPAY_APP_ID); shopMerchant.setAlipayAppId(SystemConstants.PayType.ALIPAY_APP_ID);
shopMerchant.setWechatAppId(SystemConstants.PayType.WECHAT_APP_ID); shopMerchant.setWechatAppId(SystemConstants.PayType.WECHAT_APP_ID);
shopMerchant.setRelatedId(shopMerchantParam.getShopId());
} }
shopMerchant.setShopId(shopMerchantParam.getShopId()); shopMerchant.setShopId(shopMerchantParam.getShopId());
if (isUp) { if (isUp) {
shopMerchant.setChannel(CzgStrUtils.getStrOrNull(shopMerchantParam.getChannel())); shopMerchant.setChannel(CzgStrUtils.getStrOrNull(shopMerchantParam.getChannel()));
shopMerchant.setRelatedLicenceNo(CzgStrUtils.getStrOrNull(shopMerchantParam.getRelatedLicenceNo())); shopMerchant.setRelatedId(shopMerchantParam.getShopId());
if (shopMerchantParam.getNativeMerchantDTO() != null) { if (shopMerchantParam.getNativeMerchantDTO() != null) {
shopMerchant.setNativePayJson(JSONObject.toJSONString(shopMerchantParam.getNativeMerchantDTO())); shopMerchant.setNativePayJson(JSONObject.toJSONString(shopMerchantParam.getNativeMerchantDTO()));
} }
@@ -88,9 +89,9 @@ public class ShopMerchantServiceImpl extends ServiceImpl<ShopMerchantMapper, Sho
shopMerchant.setPolyPayJson(JSONObject.toJSONString(shopMerchantParam.getPolyMerchantDTO())); shopMerchant.setPolyPayJson(JSONObject.toJSONString(shopMerchantParam.getPolyMerchantDTO()));
} }
} else { } else {
//不是新增且不是修改 只有进件完成会进入这里 //只有进件会进入这里
if (StrUtil.isBlank(shopMerchant.getRelatedLicenceNo())) { if (shopMerchant.getRelatedId() == null) {
shopMerchant.setRelatedLicenceNo(shopMerchantParam.getRelatedLicenceNo()); shopMerchant.setRelatedId(shopMerchantParam.getShopId());
} }
if (StrUtil.isBlank(shopMerchant.getNativePayJson()) && shopMerchantParam.getNativeMerchantDTO() != null) { if (StrUtil.isBlank(shopMerchant.getNativePayJson()) && shopMerchantParam.getNativeMerchantDTO() != null) {
shopMerchant.setNativePayJson(JSONObject.toJSONString(shopMerchantParam.getNativeMerchantDTO())); shopMerchant.setNativePayJson(JSONObject.toJSONString(shopMerchantParam.getNativeMerchantDTO()));
@@ -101,12 +102,12 @@ public class ShopMerchantServiceImpl extends ServiceImpl<ShopMerchantMapper, Sho
@Override @Override
@CacheEvict(allEntries = true) @CacheEvict(allEntries = true)
public void upMerchant(@NotBlank String relatedLicenceNo, @NotNull NativeMerchantDTO nativeMerchantDTO) { public void upMerchant(@NotBlank Long relatedId, @NotNull NativeMerchantDTO nativeMerchantDTO) {
ShopMerchant upShopMerchant = new ShopMerchant(); ShopMerchant upShopMerchant = new ShopMerchant();
upShopMerchant.setAlipayAppId(nativeMerchantDTO.getAlipayMerchantId()); upShopMerchant.setAlipayAppId(nativeMerchantDTO.getAlipayMerchantId());
upShopMerchant.setWechatAppId(nativeMerchantDTO.getWechatMerchantId()); upShopMerchant.setWechatAppId(nativeMerchantDTO.getWechatMerchantId());
upShopMerchant.setNativePayJson(JSONObject.toJSONString(nativeMerchantDTO)); upShopMerchant.setNativePayJson(JSONObject.toJSONString(nativeMerchantDTO));
update(upShopMerchant, query().eq(ShopMerchant::getRelatedLicenceNo, relatedLicenceNo)); update(upShopMerchant, query().eq(ShopMerchant::getRelatedId, relatedId));
} }
@Cacheable(key = "#shopId") @Cacheable(key = "#shopId")