From fcef86762dbd8d83f3033cc48861e3eb9641e5b8 Mon Sep 17 00:00:00 2001 From: wangff Date: Mon, 17 Nov 2025 11:12:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=89=93=E6=A0=87=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E6=96=B0=E5=A2=9E=E8=B4=A6=E6=88=B7=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../enums/wallet/PingAnAccountStatusEnum.java | 2 +- .../java/com/cool/store/dao/ShopInfoDAO.java | 2 +- .../wallet/impl/WalletServiceImpl.java | 36 ++++++++++++------- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/coolstore-partner-common/src/main/java/com/cool/store/enums/wallet/PingAnAccountStatusEnum.java b/coolstore-partner-common/src/main/java/com/cool/store/enums/wallet/PingAnAccountStatusEnum.java index e11760ae6..7d0203753 100644 --- a/coolstore-partner-common/src/main/java/com/cool/store/enums/wallet/PingAnAccountStatusEnum.java +++ b/coolstore-partner-common/src/main/java/com/cool/store/enums/wallet/PingAnAccountStatusEnum.java @@ -16,7 +16,7 @@ import lombok.Getter; public enum PingAnAccountStatusEnum { UNCOMMITTED(1, "待提交"), - UNAUTHORIZED(2, "带鉴权"), + UNAUTHORIZED(2, "待鉴权"), AUTHENTICATING(3, "鉴权中"), OPEN(4, "开通"), ; diff --git a/coolstore-partner-dao/src/main/java/com/cool/store/dao/ShopInfoDAO.java b/coolstore-partner-dao/src/main/java/com/cool/store/dao/ShopInfoDAO.java index 37d13e74f..c10400783 100644 --- a/coolstore-partner-dao/src/main/java/com/cool/store/dao/ShopInfoDAO.java +++ b/coolstore-partner-dao/src/main/java/com/cool/store/dao/ShopInfoDAO.java @@ -97,8 +97,8 @@ public class ShopInfoDAO { * @return */ public Long addShopInfo(ShopInfoDO shopInfo){ - shopInfoMapper.insertSelective(shopInfo); shopInfo.setStoreId(UUIDUtils.get32UUID()); + shopInfoMapper.insertSelective(shopInfo); return shopInfo.getId(); } diff --git a/coolstore-partner-service/src/main/java/com/cool/store/service/wallet/impl/WalletServiceImpl.java b/coolstore-partner-service/src/main/java/com/cool/store/service/wallet/impl/WalletServiceImpl.java index 94d69fedc..c642f5db8 100644 --- a/coolstore-partner-service/src/main/java/com/cool/store/service/wallet/impl/WalletServiceImpl.java +++ b/coolstore-partner-service/src/main/java/com/cool/store/service/wallet/impl/WalletServiceImpl.java @@ -27,6 +27,7 @@ import com.cool.store.vo.wallet.BankVO; import com.github.pagehelper.PageInfo; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; @@ -149,25 +150,36 @@ public class WalletServiceImpl implements WalletService { // 营业执照已上传,调用打标接口 if (Objects.nonNull(licenseTransactDO) && StringUtils.isNotBlank(licenseTransactDO.getCreditUrl())) { try { - // 调用 签约人账户打标(升级)接口 - log.info("营业执照已上传,账户打标"); - AccountAddTagRequest tagRequest = AccountAddTagRequest.builder() - .outStoreId(storeId) - .licenseNo(licenseTransactDO.getCreditCode()) - .licenseName(licenseTransactDO.getBusinessLicense()) + // 判断一下账户的开通状态 + if (enableAddTag(storeId)) { + // 调用 签约人账户打标(升级)接口 + log.info("营业执照已上传,账户打标"); + AccountAddTagRequest tagRequest = AccountAddTagRequest.builder() + .outStoreId(storeId) + .licenseNo(licenseTransactDO.getCreditCode()) + .licenseName(licenseTransactDO.getBusinessLicense()) // .licenseExpire(Objects.nonNull(licenseTransactDO.getValidity()) ? CoolDateUtils.DateFormat(licenseTransactDO.getValidity(), "yyyy-MM-dd") : "2999-12-31") - .legalName(licenseTransactDO.getLicenseLegalPerson()) - .legalNo(licenseTransactDO.getLicenseLegalIdCardNo()) - .legalPhone(licenseTransactDO.getLicenseLegalMobile()) - .build(); - AddTagDTO addTagDTO = walletApiService.addTag(tagRequest); - log.info("打标接口调用成功,response:{}", JSONObject.toJSONString(addTagDTO)); + .legalName(licenseTransactDO.getLicenseLegalPerson()) + .legalNo(licenseTransactDO.getLicenseLegalIdCardNo()) + .legalPhone(licenseTransactDO.getLicenseLegalMobile()) + .build(); + AddTagDTO addTagDTO = walletApiService.addTag(tagRequest); + log.info("打标接口调用成功,response:{}", JSONObject.toJSONString(addTagDTO)); + } } catch (Exception e) { log.error("营业执照已上传,打标失败", e); } } } + /** + * 账户存在且未打标 + */ + private boolean enableAddTag(String storeId) { + List accountInfo = walletApiService.getAccountInfo(new OutStoreIdRequest(storeId)); + return CollectionUtils.isNotEmpty(accountInfo) && accountInfo.size() == 1 && accountInfo.get(0).getLabelingStatus().equals(0); + } + /** * 查询并校验门店是否存在以及阶段是否处于平安钱包未开通状态 */