定时任务 修改进件信息处理

This commit is contained in:
2026-01-15 10:38:58 +08:00
parent cdd012c2fe
commit b8a6ce495c
2 changed files with 15 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ package com.czg.task;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson2.JSONObject;
import com.czg.EntryManager;
import com.czg.PayCst;
import com.czg.constant.PayChannelCst;
@@ -9,12 +10,12 @@ import com.czg.dto.resp.QueryStatusResp;
import com.czg.order.dto.ShopMerchantDTO;
import com.czg.order.entity.ShopDirectMerchant;
import com.czg.order.service.ShopMerchantService;
import com.czg.pay.AlipayAuthInfoDto;
import com.czg.pay.NativeMerchantDTO;
import com.czg.service.order.service.ShopDirectMerchantService;
import com.mybatisflex.core.query.QueryWrapper;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@@ -86,7 +87,10 @@ public class EntryManagerTask {
NativeMerchantDTO nativeMerchantDTO = new NativeMerchantDTO();
nativeMerchantDTO.setWechatMerchantId(wechatMerchantId);
nativeMerchantDTO.setAlipayMerchantId(alipayMerchantId);
shopMerchantDTO.setNativeMerchantDTO(nativeMerchantDTO);
if (StrUtil.isNotBlank(shopDirectMerchant.getAlipayAuthInfo())) {
AlipayAuthInfoDto alipayAuthInfoDto = JSONObject.parseObject(shopDirectMerchant.getAlipayAuthInfo(), AlipayAuthInfoDto.class);
nativeMerchantDTO.setAlipayAuthInfo(alipayAuthInfoDto);
}
shopMerchantDTO.setNativeMerchantDTO(nativeMerchantDTO);
shopMerchantService.editEntry(shopMerchantDTO, false);
}

View File

@@ -103,6 +103,15 @@ public class ShopMerchantServiceImpl extends ServiceImpl<ShopMerchantMapper, Sho
shopMerchant.setNativePayJson(JSONObject.toJSONString(shopMerchantParam.getNativeMerchantDTO()));
}
}
if (PayChannelCst.NATIVE.equals(shopMerchantParam.getChannel())) {
if (StrUtil.isNotBlank(shopMerchant.getRelatedLicenceNo()) && (StrUtil.isNotBlank(shopMerchant.getAlipayAppId()) || StrUtil.isNotBlank(shopMerchant.getWechatAppId()))) {
ShopMerchant upShopMerchant = new ShopMerchant();
upShopMerchant.setAlipayAppId(shopMerchant.getAlipayAppId());
upShopMerchant.setWechatAppId(shopMerchant.getWechatAppId());
upShopMerchant.setNativePayJson(JSONObject.toJSONString(shopMerchantParam.getNativeMerchantDTO()));
update(upShopMerchant, query().eq(ShopMerchant::getRelatedLicenceNo, shopMerchantParam.getRelatedLicenceNo()));
}
}
return saveOrUpdate(shopMerchant);
}