fix:打标接口调用新增账户状态校验

This commit is contained in:
wangff
2025-11-17 11:12:11 +08:00
parent 35a1e1292a
commit fcef86762d
3 changed files with 26 additions and 14 deletions

View File

@@ -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<AccountInfoDTO> accountInfo = walletApiService.getAccountInfo(new OutStoreIdRequest(storeId));
return CollectionUtils.isNotEmpty(accountInfo) && accountInfo.size() == 1 && accountInfo.get(0).getLabelingStatus().equals(0);
}
/**
* 查询并校验门店是否存在以及阶段是否处于平安钱包未开通状态
*/